Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Are you missing an assembly reference?" compile error - Visual Studio

I am currently working on a server control for other applications in our company to interface with a WCF service. Every time I make a change code change and recompile the control, I increment the the AssemblyVerison and AssemblyFileVersion class in the AsseemblyInfo.cs by one. For example, my latest build went from 1.0.07.0 to 1.0.08.0.

When the consuming application updates the file by copying the latest file in the bin directory and tries to compile, they receive the following error:

The type or namespace name 'MyControl' does not exist in the namespace 'MyNamespace' (are you missing an assembly reference?)

In order to resolve this error, they have to delete the current reference and re-add the reference.

Is there any way to update the server control without having to delete and re-add the reference?

I am not strong naming the server control.
@JPunyon - Do you mean have the consuming application add the server control project to their solution?

like image 467
Michael Kniskern Avatar asked Jan 16 '09 16:01

Michael Kniskern


People also ask

What is an assembly reference?

Reference assemblies are a special type of assembly that contain only the minimum amount of metadata required to represent the library's public API surface.


1 Answers

In my case it was a project defined using Target Framework: ".NET Framework 4.0 Client Profile " that tried to reference dll projects defined using Target Framework: ".NET Framework 4.0".

Once I changed the project settings to use Target Framework: ".NET Framework 4.0" everything was built nicely.

Right Click the project->Properties->Application->Target Framework

like image 59
EZDsIt Avatar answered Oct 05 '22 15:10

EZDsIt