Could not load file or assembly GalaSoft.MvvmLight.Extras.dll


I have an Net Core 3 WPF application, and I am using mvvm light libs. If I compile in debug mode with visual studio, I don't get any error and I can run the application with no problems.

However, if I try to publish the application with this command line:

dotnet publish -c Release -r win-x64 self-contained true

I get an error that says:

C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(307,5): error : Error compiling C:\Users\User.nuget\packages\mvvmlightlibs\\lib\net45\GalaSoft.MvvmLight.Extras.dll: Could not load file or assembly 'CommonServiceLocator, Version=, Culture=neutral, PublicKeyToken=489b6accfaf20ef0'. El sistema no puede encontrar el archivo especificado. (0x80070002) [M:\GTS\software\MyProject\software\MyProject\MainProject\MyProjectFile.csproj]

But if I go to the compilation folder I see that the application is compiled and I can run it, and also I si that the dlls of mvvm light are add to the folder.

Really, I realized that the assembly that is not loaded is CoomonServiceLocator, and for the name of the folder, it is net45, but I am using Net Core 3 in this project.

How could I solve this problem? Or could I ignore it?


asked on Stack Overflow Oct 11, 2019 by Álvaro García

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0