Csla.resources file not found exception in unit testingCsla.resources file not found exception in unit testing
Old forum URL: forums.lhotka.net/forums/t/9930.aspx
Michael posted on Monday, January 10, 2011
Hi everyone
On the very first test in a batch of MbUnit unit tests, regardless of which tests are selected, I get a System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30'
Every test after this runs fine. I can get around this by having a blank test execute before the real tests, but naturally I'd prefer to solve the problem. This has only recently started happening, either after upgrading Gallio/MbUnit or moving to Visual Studio 2010 (compiling to .NET 3.5).
I'm posting this to both the CSLA forum and Gallio Dev Google Group.
The stack track is listed below.
Kind regards
Michael
Csla.DataPortalException: DataPortal.Create failed (System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The system cannot find the file specified.
File name: 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' ---> System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The system cannot find the file specified.
File name: 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Csla.DataPortal.ResolveEventHandler(Object sender, ResolveEventArgs args) in D:\Development\cslacs\Csla\DataPortal.cs:line 1076
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Csla.Properties.Resources.get_ValidationRulesException() in D:\Development\cslacs\Csla\Properties\Resources.Designer.cs:line 975
at Csla.Validation.ValidationRules.CheckRules(List`1 list) in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1187
at Csla.Validation.ValidationRules.CheckRules() in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1128
at CadTechAustralia.CadTracker.Business.Project.DataPortal_Create() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 984
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 357
) ---> Csla.Reflection.CallMethodException: DataPortal_Create method call failed ---> System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The system cannot find the file specified.
FileName: Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30
FusionLog: WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Csla.DataPortal.ResolveEventHandler(Object sender, ResolveEventArgs args) in D:\Development\cslacs\Csla\DataPortal.cs:line 1076
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
--- End of inner exception stack trace ---
FileName: Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30
FusionLog:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Csla.Properties.Resources.get_ValidationRulesException() in D:\Development\cslacs\Csla\Properties\Resources.Designer.cs:line 975
at Csla.Validation.ValidationRules.CheckRules(List`1 list) in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1187
at Csla.Validation.ValidationRules.CheckRules() in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1128
at CadTechAustralia.CadTracker.Business.Project.DataPortal_Create() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 984
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 357
--- End of inner exception stack trace ---
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Csla.Properties.Resources.get_ValidationRulesException() in D:\Development\cslacs\Csla\Properties\Resources.Designer.cs:line 975
at Csla.Validation.ValidationRules.CheckRules(List`1 list) in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1187
at Csla.Validation.ValidationRules.CheckRules() in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1128
at CadTechAustralia.CadTracker.Business.Project.DataPortal_Create() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 984
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 357
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 364
at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 270
at Csla.Reflection.LateBoundObject.CallMethod(String method) in D:\Development\cslacs\Csla\Reflection\LateBoundObject.cs:line 70
at Csla.Server.SimpleDataPortal.Create(Type objectType, Object criteria, DataPortalContext context) in D:\Development\cslacs\Csla\Server\SimpleDataPortal.cs:line 51
--- End of inner exception stack trace ---
BusinessObject: New project
BusinessException: System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The system cannot find the file specified.
File name: 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' ---> System.IO.FileNotFoundException: Could not load file or assembly 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The system cannot find the file specified.
File name: 'Csla.resources, Version=3.8.3.0, Culture=en, PublicKeyToken=93be5fdc093e4c30'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Csla.DataPortal.ResolveEventHandler(Object sender, ResolveEventArgs args) in D:\Development\cslacs\Csla\DataPortal.cs:line 1076
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Csla.Properties.Resources.get_ValidationRulesException() in D:\Development\cslacs\Csla\Properties\Resources.Designer.cs:line 975
at Csla.Validation.ValidationRules.CheckRules(List`1 list) in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1187
at Csla.Validation.ValidationRules.CheckRules() in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1128
at CadTechAustralia.CadTracker.Business.Project.DataPortal_Create() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 984
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 357
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Csla.Properties.Resources.get_ValidationRulesException() in D:\Development\cslacs\Csla\Properties\Resources.Designer.cs:line 975
at Csla.Validation.ValidationRules.CheckRules(List`1 list) in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1187
at Csla.Validation.ValidationRules.CheckRules() in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1128
at CadTechAustralia.CadTracker.Business.Project.DataPortal_Create() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 984
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 357
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 364
at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 270
at Csla.Reflection.LateBoundObject.CallMethod(String method) in D:\Development\cslacs\Csla\Reflection\LateBoundObject.cs:line 70
at Csla.Server.SimpleDataPortal.Create(Type objectType, Object criteria, DataPortalContext context) in D:\Development\cslacs\Csla\Server\SimpleDataPortal.cs:line 51
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Csla.Properties.Resources.get_ValidationRulesException() in D:\Development\cslacs\Csla\Properties\Resources.Designer.cs:line 975
at Csla.Validation.ValidationRules.CheckRules(List`1 list) in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1187
at Csla.Validation.ValidationRules.CheckRules() in D:\Development\cslacs\Csla\Validation\ValidationRules.cs:line 1128
at CadTechAustralia.CadTracker.Business.Project.DataPortal_Create() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 984
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 357
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 364
at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in D:\Development\cslacs\Csla\Reflection\MethodCaller.cs:line 270
at Csla.Reflection.LateBoundObject.CallMethod(String method) in D:\Development\cslacs\Csla\Reflection\LateBoundObject.cs:line 70
at Csla.Server.SimpleDataPortal.Create(Type objectType, Object criteria, DataPortalContext context) in D:\Development\cslacs\Csla\Server\SimpleDataPortal.cs:line 51
at Csla.DataPortal.Create(Type objectType, Object criteria) in D:\Development\cslacs\Csla\DataPortal.cs:line 161
at Csla.DataPortal.Create[T]() in D:\Development\cslacs\Csla\DataPortal.cs:line 90
at CadTechAustralia.CadTracker.Business.Project.NewProject() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Business\Project\Project.cs:line 927
at CadTechAustralia.CadTracker.Test.Business.TestBase.SetUp() in D:\Development\CadTechAustralia\CadTechAustralia.CadTracker\CadTechAustralia.CadTracker.Test.Business\TestBase.cs:line 73 JonnyBee replied on Monday, January 10, 2011
Hi Michael,
Does your app use a custom assembly resolver?
The problem is loading Csla.resources for culture 'en'. Since this is the default language it is compiled into Csla.dll.
So check the output folder structure where your unit tests run:
1. Verifiy there is no csla.resources.dll in the bin folder
2. Verify there is no .\en\csla.resources.dll in the bin folder.
If all else fails - use filemon or procmon from Sysinternals to trace file access and check where/what is csla.resources attempted to be loaded.
Michael replied on Monday, January 10, 2011
Hi Jonny
There is no csla.resources.dll in the bin or \en folder.
The exception is thrown in the CSLA DataPortal assembly resolver, which is for the serialization bug workaround. It is triggered by a CommonRule. The funny thing is, it doesn't try to load the assembly on the subsequent tests.
Regards
Michael
RockfordLhotka replied on Tuesday, January 11, 2011
It could have something to do with how their test framework is initializing the AppDomain that runs the test code. This doesn't happen with mstest or nunit - at least not in any of the CSLA tests, or the tests Magenic has built for various customers.
Serialization, AppDomain creation, and type resolution are tricky - hard to get right. CSLA includes that resolution code to address the approaches taken by IIS and COM+, so it seems likely that this unit test framework is using some model similar to those technologies - but obviously not quite the same.
Michael replied on Tuesday, January 11, 2011
Hi Rocky
I'm still awaiting a reply from the Gallio dev guys. It may be something they changed in the latest release. I'll post any relevant answers here also in case someone else runs into the problem.
Regards
Michael
Michael replied on Friday, July 22, 2011
Hi Rocky and Jonny
We are porting our application from AutoCAD 2011 to 2012. We are still supporting both. AutoCAD 2011 runs .NET 3.5; 2012 runs 4.0. We are still using CSLA 3.8.3.
In 2012, I am getting this same exception whenever the CSLA resources is accessed. It's looking for Csla.resources, Version=3.8.3.0, Culture=en-US. I have found two temporary solutions:
- Change CSLA's neutral language from none to English (United States); or
- Manually load a non-English Csla.resources.dll file when our application is starting up. I have no idea why this even works! All the expected strings used from CSLA's resource file are still in English. If I load one of these other resource assemblies after getting the above exception, the trick does not work.
I have reproduced the problem on my dev machine running Win 7 x64, and on Win 7 x86 and x64 virtual machines. It only happens inside the AutoCAD 2012 process; in our own separate exe, it works fine. Changing the Windows region and language to English (United States) makes no difference.
I will be asking Autodesk for their thoughts also, but I'd really appreciate some help.
Kind regards
Michael
Michael replied on Saturday, July 23, 2011
OK, I have found a more tolerable solution. In the serialisation workaround, if the requested assembly name contains "Csla.resources, Version=3.8.3.0, Culture=en" I don't try to load the assembly and return null.
Copyright (c) Marimer LLC