Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012 Annoyance - The type or namespace name does not exist in the namespace

All,

I don't know if this has just started happening in VS2012. I've not seen it happen in VS2010 or previous versions.

I have a solution in VS2012 with a number of my own custom projects. The main project is a SharePoint 2010 project. This references a number of class library projects which are used in the SharePoint project.

I can build solution and everything compiles fine. As soon as I start the solution the following errors are encountered for the same two projects in the solution:

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

I can get round this by building anyone of the projects the error occurs in and then I can start the solution to run up in SharePoint.

I don't know if this is specifically related to a SharePoint project or if others get it in their solutions. It is just a bit of a pain having to do this. It does not happen all of the time. It just seems intermittent.

I am not making any changes to the referenced projects - only the main project.

Cleaning and building the solution does not resolve this either. I need to manually build one of the offending projects. All projects are set to build within Configuration Manager - and the main project is set to Deploy - which all looks correct.

Any thoughts?

Cheers,

Andez

like image 459
Andez Avatar asked Nov 02 '22 22:11

Andez


1 Answers

The same behavior (as the poster describes) does occur with x64 builds for me.

My workaround is to switch to Any CPU (in the Configuration Manager: Active Solution Platform) . It may sound awful, but at least I can continue working on my project.

like image 144
Jeroen van Onzen Avatar answered Nov 11 '22 07:11

Jeroen van Onzen