Hi,
I’m getting the following exception when I try to set the Aspose.Pdf license file:
System.IO.FileLoadException: The located assembly's manifest
definition does not match the assembly reference. (Exception from HRESULT:
0x80131040)
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String
codeBase,Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName
assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at ☺.♣.?☻(Object , ResolveEventArgs )
at System.AppDomain.OnResourceResolveEvent(String resourceName)
at System.Reflection.Assembly._GetResource(String resourceName,
UInt64& length, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetManifestResourceStream(String
name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetManifestResourceStream(String
name)
at ♣☻.♦☻.?☻(Assembly , String )
at ♣☻.♦☻.?☻()
at ♣☻.♦☻.?☻(Stream )
at ♣☻.♦☻.?☻(String , Assembly )
at Aspose.Pdf.License.SetLicense(String licenseName)
at WorkflowScriptbd39e5ec5aae4512aa140209d3116e43.Run(Int32
ExecutionId, Int32 ExecutionDetailsId, Context ctx, Action action, String
inlink)
The Aspose.Pdf.dll file is being referenced from the GAC, and I can successfully load the Email license from the same script.
I’m able to successfully load the license file from a quick command-line test application on the same machine. The problem comes when I need to load the library from a C# “script” inside a workflow engine. This script is dynamically compiled by the engine when it runs. I know the workflow engine keeps a cache of the DLLs it loads, and I suspect that the engine does a lot of its own tricks involving assembly loading for its plugins and scripts. (I noticed that there’s an OnResourceResolveEvent handler, so it might be a conflict between these two bits of code.)
If I run the .NET SDK Fusion Log, the messages show that the Aspose.Pdf dll is being loaded by the ShadowTempDefault AppDomain, rather than the main WFEngine.exe appdomain. There is also a message in the Fusion logs about Aspose.Pdf trying to load an assembly called {35a28b1e-d8ea-4f68-ada1-53b4c978f1a1}.dll which doesn’t exist. I can attach these logs if necessary.
I believe that this is a similar issue to
https://forum.aspose.com/t/104313
in that we're both trying to use the Aspose.PDF library in a "hosted" program.
Thanks,
Andrew
<![endif]–>