0

Environment: VS2015, .NET 4.5, .exe Console App + .dll@.NET 4.5 + other C++@CLR .dlls depencencies of my first .NET .dll

Everything was running fine, until I tried to move my project to .NET 3.5 and then back to 4.5. Since then on, VS2015 refused to run my app, although it does build succesfully in both .NETs. The reason:

{“Could not load file or assembly ‘TheAssemblyYouHaveReferenced’ or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)”:”TheAssemblyYouHaveReferenced’}

I can't run it neither in win prompt.

Those must be other dependencies of my own .dll (that I've created and use it as reference.)

Check this: All of a sudden, also other VS2015 project that uses this problematic .dll exhibits exaclty same exception when I try to run that .exe With this other project, I did nothing, except that the shared .dll has been build in 3.5 and back to 4.5

Here is what I have tried to resolve it:

  • I have signed all assemblies (referenced .dll and the .exe, which uses .dll) and rebuilt.

  • I have switched off Properties->Build->Generate serialization assembly: OFF on all assemblies.

- I have used sn.exe to disable verification. This however, does not even work for some of the further dependencies. I.e. .dlls used by my .dll which are C++@CLR

- I also tried this link - No help ...

Now, I am clueless what do I do to bring the behavior of my VS2015 to the state before I compiled in .NET 3.5 and back to 4.5

Sold Out
  • 1,321
  • 14
  • 34
  • Did you try this possible fix: http://stackoverflow.com/questions/17463679/error-loading-system-management-automation-assembly – Ton Plooij May 05 '16 at 11:52
  • @TonPlooij Thanx for the tip. I tried - did not help :*( – Sold Out May 05 '16 at 16:10
  • Well, I restarted my PC, few times opened another projects, changed the common .dll to .NET 3.5, made some updates in the project, few times rebuilt, ran, debugged. Then I reopened the problematic project again, rebuilt with older common .dll which was just built on 3.5 . Lo and behold it runs my exe ! But loading all dlls took extremely long time. After first successful run, its running normaly. Until VS decides to take another crappy day. There must be a nasty bug in VS. Hence, I learned MSVS goes sucks (especially for C++), just like did Exlipse before majority abbandoned it... – Sold Out May 05 '16 at 17:55
  • LOL :D https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/6273141-so-many-years-so-many-versions-of-vs-but-why-visua – Sold Out May 06 '16 at 09:08

0 Answers0