profile
viewpoint

Ask questionsHTTP Error 500.31 - ANCM Failed to Find Native Dependencies

I upgraded an ASP.NET Core 2.2 application to 3.0.

It works fine in the development environment, but when I publish it to the test environment I get a HTTP Error 500.31 - ANCM Failed to Find Native Dependencies error.

Annotation 2019-09-25 170442

The documentation says that this error most commonly means that the Microsoft.NETCore.App or Microsoft.AspNetCore.App runtime isn't installed but I installed the ASP.NET Core/.NET Core: 3.0 Runtime & Hosting Bundle, and I'm not sure what else I can do.

The Event Viewer/stdout logs this:

An assembly specified in the application dependencies manifest (ETR Lite.deps.json) was not found: package: 'Microsoft.Data.SqlClient', version: '1.0.19249.1' path: 'runtimes/win/lib/netcoreapp2.1/Microsoft.Data.SqlClient.dll'

I don't understand why it's looking under netcoreapp2.1 for a netcoreapp3.0 application, and why it can't find the dependency even though it's present in the refs folder.

If I manually put that DLL in the folder it's looking for it I get

An assembly specified in the application dependencies manifest (ETR Lite.deps.json) was not found: package: 'System.Runtime.Caching', version: '4.5.0' path: 'runtimes/win/lib/netcoreapp2.0/System.Runtime.Caching.dll'

which I understand even less.

The dotnet --info output is:

It was not possible to find any installed .NET Core SDKs Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from: https://aka.ms/dotnet-download

Host (useful for support): Version: 3.0.0 Commit: 7d57652f33

.NET Core SDKs installed: No SDKs were found.

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

I tried installing the SDK but it didn't make any difference.

aspnet/AspNetCore

Answer questions davidfowl

What's installed on your production environment? Did you install the new hosting bundle?

useful!

Related questions

The SPA default page middleware could not return the default page '/index.html' in production application hot 102
The SPA default page middleware could not return the default page '/index.html' in production application hot 96
Asp.Net MVC Core: “Error unprotecting the session cookie” exception hot 79
No DefaultChallengeScheme found from preview8 to preview9 hot 67
BadHttpRequestException: Reading the request body timed out due to data arriving too slowly hot 65
Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder`1.HasIndex(System.Linq.Expressions.Expression`1<System.Func`2<System.__Canon,System.Object>>)'. hot 59
The library &#39;hostpolicy.dll&#39; required to execute the application was not found - AspNetCore hot 58
error CS1503: Argument 2: cannot convert from 'method group' to 'EventCallback' hot 57
Error: Invocation canceled due to the underlying connection being closed. hot 54
Unexpected end of request content k8s pod - AspNetCore hot 53
Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRounting = false' inside 'ConfigureServices'. hot 50
IIS in-process hosting incorrectly throws ConnectionResetException for HTTP POST hot 47
HTTP Error 500.30 - ANCM In-Process Start Failure hot 43
Error: Server returned handshake error: Handshake was canceled. hot 43
Issue with BuildServiceProvider() in ConfigureServices() hot 42
source:https://uonfu.com/
answerer
David Fowler davidfowl Microsoft Bellevue, WA http://davidfowl.com/ Partner Software Architect at Microsoft on the ASP.NET team, Creator of SignalR
Github User Rank List