Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core 2.1 Preview 2 App Not working on Azure App Service

I've been running my ASP.NET Core 2.1 Preview-1 app on Azure since this release became available. I had installed the ASP.NET Core runtime extensions through the portal and it's been working fine.

Now that Microsoft released ASP.NET Core 2.1 Preview-2, I installed the upgrade to the SDK. Updated my Nuget packages so that I have the preview-2 versions of everything. See my csproj file below: enter image description here

I also removed the ASP.NET Core Runtime extensions from Azure App Service for my app which was showing 2.1 Preview-1. Instead installed ASP.NET Core 2.1 run times for x86 and x64 separately -- see below: enter image description here

Compiled the app and published it to my Azure App service but I'm getting errors. First I got the 502.5 error. Now, I'm getting:

The specified CGI application encountered an error and the server terminated the process.

What am I missing here?

UPDATE:

As the answer suggested, I set my target to x86 (to play it safe) -- see below:

enter image description here

I removed the extension and the individual x86 and x64 run times and installed only the x86 with support for ASP.NET Core 2.1 preview-2 -- see below: enter image description here

I restarted the app several times and I'm still getting 502.5.

I then tried to do a self deploy through CLI command line by issuing the following command:

dotnet publish -c Release -r win10-x64

And I get the following error:

C:\Program Files\dotnet\sdk\2.1.300-preview2-008530\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(125,5): error : The RuntimeIdentifier platform 'win10-x64' and the PlatformTarget 'x86' must be compatible.

Does this mean I have the x86 version of the SDK installed and I must target x86?

I didn't have half the trouble that I'm going through now going from ASP.NET Core 2.0 to 2.1!!!!

UPDATE 2: Just ran dotnet --info in Kudu console. If I'm reading this correctly, I don't have the correct runtime.

enter image description here

Update 3:

I think this screen shot confirms what I was saying. enter image description here

Update 4:

I installed x86 version of ASP.NET Core 2.1 Runtime -- see below: enter image description here

When I run dotnet --info in Kudu console, I get the following which confuses me. I'm still not seeing the version I was expecting to see:

enter image description here

And when I hit the URL, I'm still getting 502.5 and the same message in Kudu console when I run dotnet MyApp.dll telling me that the correct version of the runtime is not found.

How will I get the correct version in there? I thought installing it through the portal would do it.

like image 916
Sam Avatar asked Apr 12 '18 03:04

Sam


People also ask

Does Azure App Service use Kestrel?

In 2021, a group of engineers across multiple teams, including . NET and Azure, got together to transition the App Service Frontend fleet to Kestrel + YARP.

How do I check Azure App Service errors?

Detailed Error Logs Another way to view the failed request traces is to navigate to your app page in the portal. From the left menu, select Diagnose and solve problems, then search for Failed Request Tracing Logs, then click the icon to browse and view the trace you want.

How do I check my .NET framework version in Azure App Service?

Using Azure Console 01 Sign in to Azure Management Console. 02 Navigate to App Services blade at https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Web%2Fsites.


1 Answers

We've managed to publish ASP.NET Core 2.1 RC1 webapp to Azure app-service using "self-contained" deployment mode.

Platform target: Any CPU

Here are the package references from our .csproj:

<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0-rc1-final" PrivateAssets="All" /> <PackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="2.1.0-rc1-final" />

like image 115
Sergiy Avatar answered Oct 13 '22 06:10

Sergiy