Could not load a file or assembly SMDiagnostics.dll
Asked Answered
P

2

6

I´m trying to build my c# .NET solution containing 18 projects. Out of the blue I´m receiving an odd error message for one of my projects (the web gui).

Error as follows

"Error 1839 'Could not load file or assembly 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'"

All but one of the projects are running on .net framework 3.5 but I have framework 4.0 installed on my machine. Visual studio is trying to load the file from 4.0 but not 3.5 (I´ve tried to move the file to 3.5, but that did not work)

Does anyone know what´s wrong here or have any idea what I can do to fix this ?

regards Throstur

Pneumonia answered 5/6, 2012 at 10:32 Comment(4)
Check the framework version configured in your project. Search for "4.0" text and try build again.Candor
in project properties (right click on project => properties). In Application tabJacobinism
all projects are 3.5 except one which is 2.0. Does assembly information -> assembly version have to be the same version as the framework ?Pneumonia
Facing same problem. Nandan's answer can work if you are authorized to get the target framework to 4.0. But I can't do it. My project's binaries from DEV Express and others working on 3.5, Let me know if there is any real solution to the problem ??Pasto
H
4

I got the same above error out of the blue.. The project target framework was set to 3.5. Changed it to 4.0 and I was able build successfully.

Hertz answered 17/9, 2012 at 6:34 Comment(0)
F
2

All my projects were set to use .NET 4.0, and other answers didn't work for me, but eventually figured it out. Simple:

  1. Right click Visual Studio and "Run as Administrator"
  2. In the newly opened Visual Studio instance, open your solution and run it.

For me, it just worked as expected. Thanks to this answer for helping me figure it out.

Flem answered 24/7, 2015 at 18:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.