I am using Visual Studio 2015 to publish my main ASP.NET application for IIS 7.5. All I'm trying to do is look at the regular default.htm page in my wwwroot. Everything works fine when I use VS IIS Express, however, when I publish, it is IIS 7.5 and specify the physical path to the wwwroot folder created by Visual Studio when publishing, I get only a blank screen (404). Which is strange, when I run the default app.run method from the Configure startup.cs method, it works fine:
app.Run(async (context) => { await context.Response.WriteAsync("Hello World!"); });
However, when I comment on this, use app.UseDefaultFiles () and app.UseStaticFiles (), I get nothing. Here is my Startup.cs file:
public class Startup {
Here is my web.config file:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/> </handlers> <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/> </system.webServer> </configuration>
And here is my project.json file:
{ "version": "1.0.0-*", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final" }, "commands": { "web": "Microsoft.AspNet.Server.Kestrel" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "exclude": [ "wwwroot", "node_modules" ], "publishExclude": [ "**.user", "**.vspscc" ] }
I have already made sure that httpPlatformHandler v1.2 is loaded, and when I publish from VS, I am targeting the DNX version of dnx-clr-winx86.1.0.0-rc1-update1 along with a checkmark for the two options below (delete all existing files before publishing and compile the source files into NuGet packages). Everything works fine in IIS Express. This is when I try to use IIS 7.5, when it starts to get scared.
Any suggestions?