So I am trying to fix an error on a C# .NET website. I have deployed the site to an online environment and I get the following error:
{
"error": "This operation is not supported for a relative URI."
}
I tried to create the error locally, but there it all works fine.
This is my web.config
file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
I have seen solutions, but they don't help. It's especially hard to debug when I am not able to recreate the error locally.
This SO question is the most simular: This operation is not supported for a relative URI, error browsing SVC-service
The error was allready on the website when I got working on it, so I have no idea for how long this is going on.
EDIT
Here are some server logs I found after the request is being made:
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
Route matched with {action = "PublicSite", controller = "Home"}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] PublicSite(System.String) on controller companyX.Controllers.HomeController (companyX).
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Executing action method companyX.Controllers.HomeController.PublicSite (companyX) - Validation state: Valid
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action companyX.Controllers.HomeController.PublicSite (companyX) in 243.2585ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 855.4192ms 500 application/json
Notice the 500 at the end.