We were unsuccessful in getting an OWIN Web API service deployed using a Windows Service (as described in this StackOverflow question). After numerous attempts to resolve the issue, we decided to simply create an ASP.NET Web API site and deploy it through IIS.
When run locally, all actions are reachable. However, if we publish the site (using Build -> Publish, or any variant thereof), we observe the following:
The URL ACL has been created as follows:
netsh http add urlacl http://+:8098/api user=Everyone
The firewall doesn't appear to be blocking the port (as we can get to it through step 1, above). The URL ACL exists, and everyone in the company has access to it (as they should). We do not know why this is occurring, and can't seem to find a suitable answer.
Can someone please suggest a cause or possible solution that we might have overlooked?
UPDATE
The following (abbreviated) warning info appeared in the Windows Application Event Log after removing logic from the Controllers and republishing:
Event code: 3005
Event message: An unhandled exception has occurred.
Exception information:
Exception type: HttpException
Exception message: Could not find a part of the path 'D:\websites\LoggingWebApi\bin\roslyn\csc.exe'.
This is interesting. It looks like Publish is not distributing the Roslyn compiler with the build.
UPDATE 2 The simplest action method on the controller is this:
[HttpGet]
[Route("Status")]
public string Status()
{
return "Online";
}
Even after manually copying the Roslyn assemblies to the server in the bin folder, that method returns HTTP 503. No error messages appear in the Application Event Log.
When this method is run locally (on my machine) it returns a JSON string that I can open in a text editor.
The URL ACL has been created as follows:
netsh http add urlacl http://+:8098/api user=Everyone
I had a similar issue and ended up deleting the URL ACL reservation on the web server. That fixed it. Give that a try.
netsh http delete urlacl url=http://+:8098/api
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With