I am running ASP.NET 5 (Core) with IIS 7.5. I already installed httpPlatformHandler and set the physical path of the site (in IIS) to the wwwroot folder that I published from visual studio 2015. All I get is a blank page with continuous loading. I am sure that everything is connected correctly. In addition, it loads normally if I uncomment the app.Run expression from the Configure method and comment out app.UseIISPlatformHandler, app.UseDefaultFiles, app.UseStaticFiles and app.UseMVC.
My code is below. I do not know what else to do at this moment. Any suggestions? If you need other snippets of code, let me know.
Startup.cs (setup method)
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { app.UseIISPlatformHandler(); app.UseDefaultFiles(); app.UseStaticFiles(); app.UseMvc(); //app.Run(async (context) => //{ // var greeting = greeter.GetGreeting(); // await context.Response.WriteAsync(greeting); //}); }
web.config
<system.webServer> <handlers> <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" /> </handlers> <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600" forwardWindowsAuthToken="true" />
New editing. I updated the folder structure to MVC (using controllers, views, etc.), and I changed the Configure method a bit. Now it loads a blank screen, and the console logs 404 not found. Additional suggestions?
Adding my full Startup.cs:
public IConfiguration Configuration { get; set; } public static string ConnectionString { get; set; } public Startup() { var builder = new ConfigurationBuilder() .AddJsonFile("appsetting.json") .AddEnvironmentVariables(); Configuration = builder.Build(); ConnectionString = Configuration.GetSection("connString").Value; }
James source share