3

The problem that i have is that when i open the solution that i am working on, in some files it will not recognize a namespace even thought that namespace is part of the same project and the solution builds fine. I could get rid of this problem by deleting my .suo file in the solution root folder but it is getting annoying to delete the .suo file every time i load the solution, plus i like the options that visual studio remembers the documents that i had opened when i closed the solution. I have heard that this may be caused by an extension but i disabled all the extensions and it still happens.

I am using visual studio ultimate 2013. I am working on a big solution that is connected with tfs and many peoples are working on it.

Does anybody have any idea why this is happening?

7
  • Could you possibly add some screenshots? Commented Jun 30, 2015 at 10:09
  • @Hughnited I'm sorry but the code is confidential but basically the problem is the same as when you add a using directive without adding it to the reference but in this case the reference is to something in the same solution. And the strangest thing is that the error display only when i open the documents that have this using. If i don't open this documents the solution builds without displaying any error at all. And the error displayed is the typical "The type or namespace name 'namespace name' could not be found (are you missing a using directive or an assembly reference?)" Commented Jun 30, 2015 at 10:22
  • I suppose you have already tried clean and rebuild the solution or restart visual studio? Also, are you the only one in your team experiencing this? Commented Jun 30, 2015 at 10:30
  • @Hughnited Yes i have tried everything. Rebuilding and restarting doesn't help but removing the project from the solution and adding it again helps but only until i close the solution. As far as i know i am the only one experiencing this. Commented Jun 30, 2015 at 10:34
  • Have a look at the following link: stackoverflow.com/questions/3304741/… Commented Jun 30, 2015 at 10:54

2 Answers 2

3

This question is old and I'm on a newer version of Visual Studio (2017), but having the same problem and my Google search led me to this question.

The solution to this in VS 2017 seems to be to delete the .vs folder that's in the same folder as the solution file. It's hidden, so you'll have to either show hidden files to see it or open a command prompt in that location and run the command

attrib -h .vs

Sign up to request clarification or add additional context in comments.

1 Comment

This also fixed the problem for me in VS2019
0

Sometimes, if you have this problem and need a quick workaround, you can build .dll and reference that in project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.