RSS

VS2010: “Type or namespace name could not be found”, problem & solution

12 Mar

I recently converted a VS2008 project to VS2010. An interesting probelm is that the project compiles and runs well in VS2008, however, when compiling in VS2010, errors occur:

“The type or namespace name  could not be found (are you missing an assembly reference?)… ”

Wow, what does this mean?

A search in Google shows that there are a lot of different explanations, but it seems there is no one that works, at least for my case.

Finally, I got the trick:

In the project properties, change the Dotnet framework from 2.0,3.0 or 3.5 to 4, compile and run!

Net40

Happy coding!

 
17 Comments

Posted by on March 12, 2010 in CAD, Dotnet/C#

 

Tags:

17 Responses to VS2010: “Type or namespace name could not be found”, problem & solution

  1. Shoneen

    October 6, 2010 at 4:43 pm

    THANKS ! Worked for me.

     
  2. Sasikumar

    October 13, 2010 at 9:08 pm

    hi,
    i am developing a website which includes to get sqlserver database values into excel sheet. i got a coding but i unable to import the namespace SECURITY. will u help me for my problem..
    regards
    sasi

     
  3. rick

    November 23, 2010 at 5:51 pm

    Hi
    Check the .cs properties – change from content to compile.
    Cheers
    Rick

     
  4. xinyustudio

    November 23, 2010 at 8:06 pm

    Rick, nice comment. Thanks!

     
  5. baxxtab

    December 18, 2010 at 7:22 am

    Thank you!!! My problem was it defaulted to Framework 4.0 Client where my library was 4.0.

    Thanks Microsoft for your half-hearted help.

     
  6. citizhang

    December 30, 2010 at 6:03 am

    thank you!!! it saved me from trying to rebuild the whole solution!

     
  7. Liam

    January 14, 2011 at 7:55 am

    Thank you! I almost chewed off my own arm trying to figure out why my reference wasn’t being picked up.

     
  8. Tana

    June 16, 2011 at 2:52 pm

    It did not work with me

     
  9. Fernando

    July 20, 2011 at 3:16 am

    Gracias, a mi me funciono
    Windows Home x64
    VS2010
    MySQL Connector Net 6.4.3

     
  10. Stuart

    August 4, 2011 at 7:59 pm

    Thanks!!!!

     
  11. Guest

    October 1, 2011 at 2:48 am

    Thanks a lot.

     
  12. Maria

    November 2, 2011 at 11:05 pm

    Also watch to make sure you don’t have the Client Profile option selected unless you intended to! It seems to be the default, and has caused me problems before

     
  13. vnaresh

    November 28, 2011 at 7:10 pm

    still same error coming

     
  14. xinyustudio

    November 28, 2011 at 8:12 pm

    What are the specific errors? Do the comments above all fail?

     
  15. kismet

    January 10, 2012 at 1:12 am

    Thanks!

     
  16. Ed.

    January 26, 2012 at 10:06 am

    Thanks! That did it.

     
  17. Gnanasekaran

    May 16, 2012 at 3:13 pm

    Thank u very much, u my god

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.