How I understand it is that web.config
is required when running an ASP.NET Core web application on Azure App Service:
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MyProgram.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
dotnet publish -c Release
doesn't create this web.config
, so I created itself and put it in the solution (odd, because I've never had to do this before).
But the issue I am experiencing is that it does not publish the web.config
file? It seems to ignores it.
The only way I can get my application working in the Web App is to manually copy the web.config
file into the wwwroot folder using Kudu.
Note: This is a framework-dependent deployment (FDD), not self-contained, and using .NET Core 2.
dotnet publish compiles the application, reads through its dependencies specified in the project file, and publishes the resulting set of files to a directory. The output includes the following assets: Intermediate Language (IL) code in an assembly with a dll extension.
ASP.NET Core no longer uses the Global. asax and web. config files that previous versions of ASP.NET utilized.
Build compiles the source code into a (hopefully) runnable application. Publish takes the results of the build, along with any needed third-party libraries and puts it somewhere for other people to run it.
We finally figured it out. The project type was incorrect. It needs to be:
<Project Sdk="Microsoft.NET.Sdk.Web">
And not
<Project Sdk="Microsoft.NET.Sdk">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With