I am trying to create a custom webhook application and can’t seem to figure out how to call it. At this point i just want it to prove that it is started and can receive the payload.
The server is local IIS, and it is being tested via a call over the Internet. That test shows up in the IIS log with a 405 error:
2020-12-08 23:03:10 xx.xx.xx.xx POST / – 3443 – xx.xx.xx.xx Java/1.8.0_212 – 405 0 1 71
Loading the page in a browser on the local machine returns a 403 (The Web server is configured to not list the contents of this directory.)
The project itself is asp.net (.net framework), https, webapi, blank project. It is published via MSDeploy to the localhost. Project properties->Web is set to “Don’t open a page.” Servers is Local IIS, and Create Virtual Directory worked, verified from IIS manager that it points to the application directory.
Based on examples, i modified WebApiConfig.cs and added a class for the handler.
WebApiConfig.cs:
Handler.cs:
The errors are the same whether or not the application is running. the application does not show anything in the Output windows other than: Auto-attach to process ‘[704] w3wp.exe’ on machine ‘xxxxxxx’ succeeded. (Just a couple times during testing, after some time of leaving it to run it did indeed say hello, but i do not know what caused that. Most of the time, it just stays empty.)
How to i get c# to pick up the call?
no comments yet
Be the first to share what you think!
C# devs
null reference exceptions