Could not load file or assembly NLog

Error: http://pbrd.co/1vTqOTb

I am getting an error in my XAML in my WPF project:

"Error  11  Could not load file or assembly 'NLog, Version=2.0.0.0, 
 Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of its dependencies. 
 The system cannot find the file specified. MainWindow.xaml 73  9   TestApp"

      

I searched the whole solution and didn't find any "NLog", I tried to add the NLog DLL to each of my projects in the solution, but it makes no difference. Any idea?

+3


source to share


2 answers


It turned out that NLog was .Net 4.0 and the project was .Net 4.5 I changed the project to 4.0 and another dependent project to 4.0 and its working. Thank!



+4


source


Whenever you link to another library, chances are they will need a different library. When you refer to WPF, there are many base libraries that pull up.

First, make sure the DLL references you referenced are set to Copy Local = True according to their properties. Also make sure they have the same PublicKeyToken as your error - if they are referenced by a strong name (and most of .NET), then a slightly different version will not be considered the correct file.



Another thing you should consider is to check if the DLL exists in your GAC and manually install it if it doesn't. This can often be the cause of such frustrating errors due to incorrectly installed sdk (I have the same problem with the Blend libraries)

+2


source







All Articles