Visual-studio – Visual Studio Cannot Open File

visual studiovisual-studio-2008

I'm working on my first project in Visual Studio and I haven't used Windows much since '05, so please bear with me.

I've got my project open in Visual Studio 2008, and I'm trying to open a particular file for editing, but I get an error that says

"c:\path\to\file
Cannot open file.

I've verified that the file exists, and I can open it from Windows Explorer, but nothing from inside Visual Studio, any ideas?


I'm not familiar with Visual Studio, so my terminology might be incorrect.

The file appears in the tree in the Visual Studio Explorer pane, so I double clicked it, and got the error. The error said nothing more than the file path: Cannot open file.

How can I check permissions/ACLs in Windows? I assumed that since I could open it in Windows Explorer, I would be able to open it in Visual Studio.

And it's a .cpp file.

Best Answer

You may want to right-click on the file in the tree, and delete it from the project.

Then, add back an existing item.

Hopefully that will fix the problem.