Posted - Feb 21 2023 : 03:08:53 AM
| Our custom Source Links plugin which works without problems in Visual Studio 2019 cannot be loaded in Visual Studio 2022. This appears in VA.log:
ERROR: [SourceLinks] Exception Caught:
An exception occurred during validation of plugin assembly: "C:\TOOLS\SourceLinksPlugin\SourceLinksFileMakerPlugin.slp"
Inner Exception :
Could not load file or assembly 'file:///C:\TOOLS\SourceLinksPlugin\SourceLinksFileMakerPlugin.slp' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at e6.d.b(String assemblyPath)
The SourceLinksExamplePlugin loads correctly even in VS 2022, so it must be some problem in our code or its dependencies, but I do not know how to find out what causes the issue. Can you give us a hint what can be wrong or how we get more detailed diagnostics?
Our plugin is quite simple modification of the example code, built under .NET Framework 4.6.1, with added dependency on our ODBC client which is built as DLL under .NET Standard 2.0.