I have:
the following BuildWebHost
:
public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseKestrel() .UseIISIntegration() .UseStartup<Startup>() .Build();
this web.config for ASP.NET Core 2 MVC in the sites root folder:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\\ProjectOutput.dll" stdoutLogEnabled="true" stdoutLogFile=".\\logs\\stdout" forwardWindowsAuthToken="false" /> </system.webServer> </configuration>
What works:
index.html
with any content in the root folder of the site.
What doesn't work:
dotnet publish
What could I be missing that would cause my project to not start, without any logging?
I know I commented an houre ago, but reading this issue I thought I had the same problem. What helped for me was removing the following from the Startup.cs in the configureServices method:
Services.AddDeveloperSigningCredential();
I noticed that when publishing the application, the application in IIS was still asking for a tempkey.rsa. That's weird because this one is not published with it. So after removing the certain line of code it's all working.
Also a great tip to remember, if you can't figure out the error: go to the folder of your application. Open command. And enter: dotnet .\\NAMEOFSTARTING.DLL
This way you start your website from the command, and see possible errors.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.