Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


Cannot find resource files after upgrading from .NET 3.5 to .NET 4

Hi,

We have just updated all the projects in a solution to .NET 4, and have cleaned and rebuilt all projects.

The projects are in VB, we are using MLString.

However the application keeps crashing when it tries to resolve a source file string translation, for example when it hits this statement:

mEventArgs.EventName = ml_string(4,"Finished!")

We get the following error, that TradeSift.Models.resources.dll cannot be found.


Could not load file or assembly 'file:///C:\InterAnalysis Projects\InterAnalysis HEAD\TradeSift\Source\TradeSift\bin\Debug\TradeSift.Models.resources.dll' or one of its dependencies. The system cannot find the file specified.

Error: Could not load file or assembly 'file:///C:\InterAnalysis Projects\InterAnalysis HEAD\TradeSift\Source\TradeSift\bin\Debug\InterAnalysis.Exceptions.resources.dll' or one of its dependencies. The system cannot find the file specified.
Number: 53
Source: mscorlib
Target: System.Reflection.RuntimeAssembly _nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
Stack: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codebase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codebase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
System.Reflection.Assembly.LoadFrom(String assemblyFile)
TradeSift.Projects.clsProjectManager.MyResolveEventHandler(Object sender, ResolveEventArgs args)
TradeSift.Projects\Project Management\clsProjectManager.vb:line 2293
------------------------------------

This post seems to describe the problem we had:
Framework 4.0 dll loaded by a 2.0 executable cannot find "xxxx.resources.dll"

We do use our own resolver (AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf MyResolveEventHandler) if a dll cannot be found and amending it to just return Nothing if the missing assembly ends with ".resources" seems to work.