Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird: C# Type or Namespace name could not be found - Builds successfully

I have a weird error showing up in my project when it is open in the VS2012 IDE. Everywhere where I make use of another referenced project it suddenly says "Type or Namespace name could not be found". And by "says", I mean it has the text underlined in red with the error when I hover over it. The intellisense doesn't work for that code. BUT (and here's the weird part), the errors do not show up in the error console and the project builds and runs fine.

I can even debug and step through the code and it works perfectly fine. So at runtime the project is referenced fine but at design time the IDE can't find it. This worked for the past 2 weeks, and only then suddenly went a little bonkers. It's really annoying because I am rubbish at coding without intellisense!

Has anybody ever seen anything like this or have any suggestions?

like image 251
hofnarwillie Avatar asked Mar 13 '13 19:03

hofnarwillie


People also ask

What letter is č?

Letter. The 4th letter of the Serbo-Croatian alphabet alphabet, preceded by C and followed by Ć, and representing /tʃ/.

How do you type C with Caron?

The Alt Code for č is Alt 269. If you have a keyboard with a numeric pad, you can use this method. Simply hold down the Alt Key and type 269. When you lift the Alt Key, č appears.


2 Answers

I had this. I referenced assemblies whose "Target Framework" were set to ".Net Framework 4" in the "Application" secion of the projects properties. I changed this to ".Net Framework 4.5" not just in the referenced assembly's project but also the project I was building and it worked. Give this a try.

like image 124
txavier Avatar answered Oct 01 '22 03:10

txavier


I have found this is a known problem with VS2012. Check to see how you are building, 64 bit or 32 bit. It won't work with 64 bit but it will with 32 bit. It will say things are missing and design will not work, however the program will run fine. I have heard the new VS update that hasn't been released yet will fix it.

like image 39
Lainezor Avatar answered Oct 01 '22 04:10

Lainezor