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

Michael Kniskern picture Michael Kniskern · Jan 16, 2009 · Viewed 141.5k times · Source

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?

Answer

EZDsIt picture EZDsIt · Jul 15, 2014

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