Comments
1 comment
-
Thanks for your post and so sorry to hear you're running into an issue!
SmartAssembly will locate a dependency by searching in the following locations and order:
1. The GAC (Global Assembly Cache). The dependency must have an assembly name which includes the same version number and public key token.
2. The framework folder and associated folders (for SDKs, Silverlight, XNA, etc.).
3. The main assembly folder for a dependency with a similar assembly name (even if the version and/or public key token are different).
It sounds like SmartAssembly may be picking up on the 3.4. version of Autofac from either the GAC or a framework or associated folder, but you can force SmartAssembly to use the correct version by opening your saproj file in a text editor and adding a MandatoryPath attribute for Autofac pointing to the correct location of the dll:<Assembly AssemblyName="dependency_assembly_name" MandatoryPath="C:pathDependencyToUse.dll"> ... </Assembly>
Can you kindly give this a try?
Add comment
Please sign in to leave a comment.
When I try to run this transformed exe, sitting alongside all the other dependencies (untouched), it crashes on startup. When I turn on Error Reporting, I can see that the exception is:
"Could not load file or assembly 'Autofac, Version=3.4.0.0"
Our product only uses Autofac version 4.2.0.0 and the appropriate autofac.dll is there beside the program. For some reason I can't understand, running the exe through the SA build causes it to try and use a different version of Autofac. Is there something SA might be doing to it that causes the resulting assembly to pick the wrong version?