Could not load file or assembly 'Google.Protobuf...'

1 year ago
Hi,
I'm trying to upgrade from 4.5 to 4.6 using sources. Everything works fine on my dev machine, but when I send it to my server, I get the following error in the event logs (because the site does not start):

Application: w3wp.exe
CoreCLR Version: 7.0.323.6910
.NET Version: 7.0.3
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'Google.Protobuf, Version=3.14.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604'. The system cannot find the file specified.
File name: 'Google.Protobuf, Version=3.14.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604'
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.AppDomain.Load(AssemblyName assemblyRef)
   at Nop.Core.Infrastructure.AppDomainTypeFinder.LoadMatchingAssemblies(String directoryPath) in D:\Projects\Agrico\Code\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:line 132
   at Nop.Core.Infrastructure.WebAppTypeFinder.GetAssemblies() in D:\Projects\Agrico\Code\src\Libraries\Nop.Core\Infrastructure\WebAppTypeFinder.cs:line 59
   at Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType(Type assignTypeFrom, Boolean onlyConcreteClasses) in D:\Projects\Agrico\Code\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:line 269
   at Nop.Core.Infrastructure.AppDomainTypeFinder.FindClassesOfType[T](Boolean onlyConcreteClasses) in D:\Projects\Agrico\Code\src\Libraries\Nop.Core\Infrastructure\AppDomainTypeFinder.cs:line 257
   at Nop.Web.Framework.Infrastructure.Extensions.ServiceCollectionExtensions.ConfigureApplicationSettings(IServiceCollection services, WebApplicationBuilder builder) in D:\Projects\Agrico\Code\src\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ServiceCollectionExtensions.cs:line 69
   at Program.<Main>$(String[] args) in D:\Projects\Agrico\Code\src\Presentation\Nop.Web\Program.cs:line 21

Obviously, the file is in the root directory of the site, so I don't know why it's "not found". I have tried everything I could think of: copied from a different source, copied in the /plugins/bin/ folder, copied in every single plugin's folder, renamed the plugins folder, added an assembly redirect in the web.config, rebooted the server, reinstalled the .NET assemblies and the hosting bundle (just in case), checked if the file was "blocked" by Windows because it comes from the internet (no it's not). Nothing works.

Do you have an idea of what it could be?
1 year ago
Here are the loaded files around google.protobuf.dll..

https://drive.google.com/file/d/1naSXtC-7gtTNRgbiGMt79IXE4-GCroVP/view?usp=sharing
1 year ago
It's resolved. Turns out, the library was a remnant of old versions. I deleted everything again and republished from sourced. Over 150 dll files disappeared. Our synchronisation/CI software did us dirty on this one by re-adding old files I had deleted between 2 publish.

I leave this here in case it could help someone.
4 months ago
ThunderMusic wrote:
It's resolved. Turns out, the library was a remnant of old versions. I deleted everything again and republished from sourced. Over 150 dll files disappeared. Our synchronisation/CI software did us dirty on this one by re-adding old files I had deleted between 2 publish.

I leave this here in case it could help someone.


Thanks, this was helpful