I know that this question is asked a lot. And I have checked all of the questions and all of the answers, but most of them are out of dated or not working.
I'm facing an issue when running my .Net core project, whenever I lunch the project, the error screen is displayed directly (Error image is attached with the description).
.NET core version is 2.2, IIS is 10.0 and Visual Studion Community 2019
Here's a snippet of my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".kml" mimeType="application/vnd.google-earth.kml+xml" />
<mimeMap fileExtension=".kmz" mimeType="application/vnd.google-earth.kmz" />
</staticContent>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="bin\IISSupport\VSIISExeLauncher.exe" arguments="-argFile IISExeLauncherArgs.txt" stdoutLogEnabled="false" />
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="sameorigin" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="31000000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
I've tried the following steps:
Installed .net core hosting bundle
Removed the duplicate displaying in the error screen from web.config
Wasn't able to add the IIS_USRS to permissions in IIS because I didn't find such a user.
Removing the project and then cloning again from my git repository (the same error occured)
Is there a way to run Go web application on IIS?
I found a setting for azure but its not working on my dev machine
this is a web config for azure :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="d:\home\site\wwwroot\go\bin\go.exe"
arguments="run d:\home\site\wwwroot\server.go"
startupTimeLimit="60">
<environmentVariables>
<environmentVariable name="GOROOT" value="d:\home\site\wwwroot\go" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Your local IIS does not work simply because you need to install a separate component, called HttpPlatformHandler module,
https://azure.microsoft.com/en-us/blog/announcing-the-release-of-the-httpplatformhandler-module-for-iis-8/
http://www.iis.net/downloads/microsoft/httpplatformhandler
Reverse proxy or FastCGI were the older approaches which are no longer necessary with this new approach.
HttpPlatformHandler module doesn't work for me. I found this post by Sutean Rutjanalard on Medium very helpful, which use ASP.NET Core Module instead.
Basically, you need to create Application pool with "No Managed Code" as you do with a .net core app. And the following is the web.config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\YourGoApp.exe" />
</system.webServer>
</configuration>
There are many other questions similar to this in SO, i am still posting here because none of them are working out for my environment.
The exact error i am getting is,
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Enabling Directory browsing in IIS doesn't help at all.
Also tried adding adding all verbs in ExtensionLessUrlHandler-Integrated-4.0 in IIS Handler mappings.
And also tried removing module WebDAVModule and WebDAV handler in config as shown below.
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>
Thanks in advance for your answers!
If anyone is still facing this issue, I got it resolved by adding the lines below in my config file:
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
I have followed the ServiceStack (3.9.37) tutorials and have created an empty ASP.Net Web Application and have the webservice working as expected here:
http://www.somedomain.com:53032/api/metadata
I have also linked in Swagger-UI Package (3.9.35)
I have added Plugins.Add(new SwaggerFeature()); in AppHost.Configure
My problem is that the Swagger-UI is not available as I would expect here:
http://www.somedomain.com:53032/swagger-ui/index.html
I get error "Handler for Request not found: " with a stack trace.
I have tried target framework 4.0 and 4.5 with same result. Visual Studio Version is 2012
Anything I have missed to get this linking in correctly ?
Worked out that it was a path issue. Resolved by following modifications to web.config:
//Added Location node
//path moved here
<location path="api"> // Path moved to location area !!!
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime/>
<httpHandlers>
//Path returned to wildcard
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
</httpHandlers>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true"/>
</handlers>
</system.webServer>
</location>
I have a little weird behavior with my ASP.NET MVC 2 application.
I'm using IIS 7.5, Windows Authentication and ASP.NET Impersonation for my webpage to load.
After several searches, I didn't found a nice way to get rid of the 500.24 Request that I keep getting on every page load (The favicon.ico at the root directory triggers this) :
I've looked at some articles like this one or that one but this doesn't seems to solve my issue. I need these settings on for my application to work here : .NET 4 Framework Integrated Mode pipeline, Windows Authentification and ASP.NET Impersonation.
Here's a simplified version of my web.config, if it can help anyone (of course, I've removed the connections strings for security reasons..)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off" />
<identity impersonate="true" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Windows">
<!-- roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" / -->
<!-- forms loginUrl="~/Account/LogOn" timeout="2880" / -->
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/Globe" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/Globe" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/Globe" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<security>
<requestFiltering>
<verbs>
<add verb="PUT" allowed="true" />
<add verb="DELETE" allowed="true" />
</verbs>
</requestFiltering>
</security>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
</configuration>
My application IS working, the favicon.ico IS loading, I'm just wondering why it does fires a 500.24 on every request (Of course, maybe it's Fiddler who can't authenticate itself and causes de 500.24 HTTP Error, but when it does normally it triggers a 401.2 - Unauthorized instead...)
My guess is that favicon.ico is either running in a different application pool, or there is a web.config in the root of the site that has issues.
So:
1) Check to see if the root of the site (the directory where /favicon.ico lives) includes a web.config. If it does, then check to see if it is setting a system.web/httpModule, or httpHandler, or system.web/identity (impersonate) or something like that, and the application pool is running in integrated mode.
So what you need to do is either remove the offending httpmodule/httphandler/impersonate setting, or change the application pool to run as classic, or add the same configuration your site includes which is <validation validateIntegratedModeConfiguration="false" />
What CarlosAg said. Cheap fix might be to move the favicon into the offended app rather than barking up the tree.
I did find the answer to my problem =)
You're gonna laugh at me, for sure.. =P
Well, part of the answer is the <validation validateIntegratedModeConfiguration="false" /> in the C:\inetpub\wwwroot that CarlosAg pointed out, but the other part was that I simply forgot to add the <link rel="icon" href="<%: Url.Content("~/favicon.ico")%>" type="image/x-icon" /> to my Site.Master file in my ASP.NET MVC 2 Application. Since Chrome and IE does look at the root directory for a favicon.ico, it appeared to work, but I didn't notice until now that Firefox wasn't loading up the favicon.
Now the favicon loads on every browser, and there is no 500.24 HTTP Request sent over in Fiddler.
Thanks ! =)