I am hosting a asp.net 5 application on azure, the code is complied for beta8, the application runs fine on the local environment and when i publish the code on the azure si
For us the fix was to to UseIISIntegration()
on the WebHostBuilder
.
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseKestrel()
.UseIISIntegration() // Necessary for Azure.
.UseStartup<Program>()
.Build();
host.Run();
}
Our web.config looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore"
path="*"
verb="*"
modules="AspNetCoreModule"
resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
Our project.json looks like this:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {}
},
"buildOptions": {
"emitEntryPoint": true
},
"publishOptions": {
"include": [
"web.config"
]
},
"scripts": {
"postpublish": [
"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
]
}
}
Our nuget.config looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
I have this problem in the azure app service, since the version of asp.net core is preview version, so I update the asp.net core version by NuGet to 2.0.1 and redeploy the app.
The app works again.
I was facing the same issue following are steps how I resolved.
I just ran into this error whilst deploying an ASP.core app using .NET 5.4.2. The fix was to deploy to a fresh app service instance. My guess was that there was some junk left lying around from a previous deployment which used a different framework version.
I'm using .NET Core 2.1 and EF Core deployed to an Azure web app. I got this error when I switched from using a database account with db owner rights to a limited database account. I suspect EF needs a right I'm missing when the app starts.