Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio cannot find my referenced DLL's namespace

Tags:

namespaces

c#

dll

This is a very frustrating problem. All of a sudden I cannot use referenced DLLs. I added an assembly reference to a project in the same solution and the namespace is unrecognised. I can even see the reference in the object viewer. I've also changed the projects to .NET 4 and 3.5 without the client profile to no avail.

like image 391
Lee Avatar asked May 01 '12 17:05

Lee


2 Answers

Based on your screenshot, you have references to the same "ServerLibrary" DLL in multiple projects, however, it looks like one referenced version is compiled in .NET 3.5 and the other referenced version (the project reference it appears), is compiled in .NET 4. Make sure all projects point to the same version of the DLL and recompile all. That should fix your problem.

like image 125
Steve Danner Avatar answered Sep 17 '22 14:09

Steve Danner


I faced this problem, and I solved it by closing visual studio, reopening visual studio, cleaning and rebuilding the solution. This worked for me. On some other posts, I have read the replies and most of users solved the problem by following this way.

like image 22
Muhammad Sohail Avatar answered Sep 20 '22 14:09

Muhammad Sohail