Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good morning, I am having the following problem, after changing an application from net3.1 to net6.0, I get the error that I leave below, locally the application works correctly, but when I publish it on the server, I have that error.

Net6.0 is installed on the server.

I'm not sure if it could be a problem in some dependency or how I can address it. Any ideas?

Thank you!

An error occurred while starting the application.
TypeLoadException: Could not load type 'Internal.Resources.WindowsRuntimeResourceManagerBase' from assembly 'System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

What I have tried:

I tried deleting some dependencies and updating others.

I leave the list of dependencies here:

Microsoft.EntityFrameworkCore 7.0.5
Microsoft.EntityFrameworkCore.SqlServer 7.0.5
Microsoft.IdentityModel.Clients.ActiveDirectory 5.3.0
Microsoft.Extensions.Configuration 7.0.0
Microsoft.Extensions.Configuration.Abstractions 7.0.0
AutoMapper.Extensions.Microsoft.DependencyInjection 12.0.1
Azure.Storage.Blobs 12.19.1
BuildBundlerMinifier 3.2.449
Microsoft.ApplicationInsights.AspNetCore 2.22.0-beta4
Microsoft.TypeScript.MSBuild 5.3.2
Microsoft.VisualStudio.Web.CodeGeneration.Design 8.0.0
NLog.Web.AspNetCore 5.3.4
Posted

1 solution

Your versions listed do not look right. Try removing them, then adding each one via NuGet.

You could set up a dummy project for the Target version of .Net, then add the libs. Once done, look at the .csproj file and copy the correct versions and paste manually into your project.

Also, why .Net 6.0? .Net 8.0 is now released.
 
Share this answer
 
Comments
Fercap89 23-Nov-23 20:37pm    
Thanks for the answer, I tried to do that and I was left with a more compact set of dependencies, anyway, the error persists, could it be something in the dependencies or some server configuration, as I understand coreLib is a central NetCore library, will I have to try reinstalling it?
Graeme_Grant 23-Nov-23 22:48pm    
If you have correct dependencies, then no, you don't. It could be a breaking change that you have hit. ref: .NET breaking changes reference - .NET | Microsoft Learn[^].

Turn on strict Exception settings to see where in your code the issue is: Debug > Window > Exception Settings > tick "Common Runtime Exceptions".

If that does not isolate it, then maybe start blocking out sections of code to eliminate possibilities until the error disappears. Then you will know where to look.

Lastly, if everything fails, try reinstalling both the 32-bit and 64-bit .Net core SDKs on the server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900