aspnet / IISIntegration

[Archived] ASP.NET Core IIS integration. Project has moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
148 stars 59 forks source link

IIS: Wildcard + URL in route results in configuration error #30

Closed ala53 closed 8 years ago

ala53 commented 8 years ago
[Route("/Important/{*routeInfo}")
public IActionResult DoSomethingImportant(string routeInfo) {
  //...
}

If that route is called with /Important/http://github.com, it works on Kestrel but errors on IIS (at least through auto-deploy azure). The error is: Config Error: Cannot read configuration file Config File: \?\D:\home\site\wwwroot\Important\http:\web.config ...claiming the physical path is Physical Path: D:\home\site\wwwroot\Login\http:\github.com

In short form, ASP.net doesn't hook the URL...and IIS can't find any to match.

davidfowl commented 8 years ago

Check your web.config and see if forwardWindowsAuthToken=false is set, if it is, remove it and try deploying again.

ala53 commented 8 years ago

It is not. The contents of web.config are:

<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="%home%\site\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout.log" startupTimeLimit="3600"></httpPlatform>
  </system.webServer>
</configuration>
davidfowl commented 8 years ago

set stdoutLogEnabled=true and take a look at the logs. Also take a look at the event log.xml and see if there's anything interesting in there.

muratg commented 8 years ago

@ala53 Could you provide us a simplified repro code?

ala53 commented 8 years ago

Hello As requested: https://github.com/ala53/iis-error-sample It is hosted here: http://zsb-test-123.azurewebsites.net/

Unfortunately, the initial post is wrong. It isn't a problem with IIS on all systems. It only occurs when using the Visual Studio auto deploy to azure.

See here: http://zsb-test-123.azurewebsites.net/this-will-work-fine.com and http://zsb-test-123.azurewebsites.net/http://this-will-crash-the-server.com When hosted locally, it works fine.

muratg commented 8 years ago

@Tratcher

ala53 commented 8 years ago

The entire issue can be reproduced via this:

        [HttpGet, Route("/{*routeData}")]
        public string HttpGetRoutedData(string routeData)
        {
            return "Your route data was: " + routeData;
        }
muratg commented 8 years ago

@BrennanConroy Can you investigate?

BrennanConroy commented 8 years ago

This is an Antares issue, I have contacted them to see if they can resolve it.

Tratcher commented 8 years ago

Note this also repros with Asp.Net 4 on azure web sites.

gemehendrix commented 8 years ago

I'm also getting issue. The character causing the problem appears to be the colon.