llblgen 2.6
C#
asp.net
.net 3.5
Error:
The type initializer for 'SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionInfoProviderSingleton' threw an exception. System.TypeInitializationException: The type initializer for 'SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionInfoProviderSingleton' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Quartz, Version=1.0.2.3, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at SD.LLBLGen.Pro.ORMSupportClasses.TypeDiscoverer.GatherInstanceTypes(MultiValueHashtable`2 instanceTypes, Assembly toExamine)
at SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionInfoProvider.Init()
at SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionInfoProvider..ctor()
at SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionInfoProviderSingleton..cctor()
--- End of inner exception stack trace ---
I have a new website on a new server and decided to reference an assembly from another server/website. This assembly has several types decorated with llblgen's dependency injection properties. The assembly works fine in the original website, but on the new website, it returned the above error.
Note that the above error is due to not being able to find a "Quartz.dll" assembly which, while its members are referenced in my assembly, the Quartz assembly does not have any DI decorators and is a 3rd party dll. (The Quartz assembly members are used in a separate part of my assembly, unrelated to the how the new server will use my assembly)
The solution is to add the Quartz.dll to the GAC of the new server, but this reduces my assembly's portability and in general doesn't seem to make sense why llblgen reflector would need access to that dll. To add to my confusion, my assembly references several other 3rd party dlls (like Telerik) in addition to Quartz which are not on my new server, but only the absence of the Quartz.dll throws the error.
For reference, the following is my web.config settings:
<configuration>
<configSections>
<section name="dependencyInjectionInformation" type="SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionSectionHandler, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27" />
</configSections>
<dependencyInjectionInformation>
<additionalAssemblies>
<assembly fullName="MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1c575b3f6954807b" />
</additionalAssemblies>
</dependencyInjectionInformation>
<appSettings>
<add key="markSavedEntitiesAsFetched" value="true" />
<add key="ConnectionString" value="my connection string" />
<add key="autoDependencyInjectionDiscovery" value="false"/>
</appSettings>
</configuration>
Again, I have a workaround by manually adding the unrelated dll to the new server's GAC, but this really bugs me and I'd be interested in finding out why this might be happening if anyone has some clue. Thanks!