Question

Good Afternoon Stack Exchange,

I am trying to Publish my Outlook 2013 Add-In for other people to use. I have installed my addin on my computer and to begin with when I clicked a ribbon button no window would load but it did in debug mode. For some reason now it seems to work fine on my PC however when installing it on several other peoples computers it installs and the ribbon is visible however when a ribbon button is clicked nothing happens (a window is meant to open).

I decided to download "AddInSpy" and take a look at my app on both my computer and other peoples computers. All display the same error about my addin:

Add-in DLL path is not found. System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\Alexander Harvey\Desktop\Addin\Application Files\De_Facto_Addin_1_0_0_12\De_Facto_Addin.dll.deploy' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'file:///C:\Users\Alexander Harvey\Desktop\Addin\Application Files\De_Facto_Addin_1_0_0_12\De_Facto_Addin.dll.deploy'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   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.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
   at AddInSpy.AssemblyScanner.GetAssemblyInfo(String fileName, String hostName, Boolean isVstoAddIn)

I am completely stuck on this and have been trying to find a fix for 3 hours. So any help would be appreciated. Thankyou.

Was it helpful?

Solution

You should try to use logging. This means you will be able to pin-point your issue.

I recommend using Log4Net and and adding a log output on every line at startup.

I had a similar issue to you and this is how I solved it, was just a silly spelling mistake in the end :P

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top