My PC
Windows 8 Preview Release
Visual Studio 2010 Express for Windows Phone
My App is in
Solution A
Project B
Story
The screen is freezing when I type codes
I power off the PC then restart
When I load the sln in VS2010 for wp
VS2010 said
"Solution A (0 projects)
Project B (unavailable)
The project file cannot be loaded
So I tried to "Edit B.csproj" in VS2010, it shows error
B.csproj : error : Unable to read the project file 'B.csproj'.
B.csproj: The project file could not be loaded. Root element is missing.
Help
How can I open my solution correctly? :(
sln extension. Double-click the . csproj file to open it in Visual Studio.
First you have to navigate to the project's node in Solution Explorer. Then you have to right-click > Unload the project. Then you have to right-click > Edit the csproj file. Then you have to find the offending line in the csproj file and modify or delete it.
CSPROJ files are are meant to be opened and edited in Microsoft Visual Studio (Windows, Mac) as part of Visual Studio projects. However, because CSPROJ files are XML files, you can open and edit them in any text or source code editor.
When you create and build solutions in Visual Studio, Visual Studio uses MSBuild to build each project in your solution. Every Visual Studio project includes an MSBuild project file, with a file extension that reflects the type of project—for example, a C# project (. csproj), a Visual Basic.NET project (.
The easiest thing to do is probably to create a new project file. The simplest way to do this would be to:
B
, with the same name.B.csproj
file to the directory where all your source for B
is, overwriting the existing B.csproj
file (but take a copy of it, just incase you need it!).A
.You'll note that the project doesn't contain any of the files / references you'd expect and will probably contain a "broken" reference to Class1.cs
or any other files that were added to the new project file when Visual Studio created it. Now:
Assuming there's nothing too complicated about your project, you should only now need to re-add any References and it should compile and run. Any further things you can probably work out by using a tool like Beyond Compare to compare the new project file and the original project file to look for things you've missed.
If you were, you'd be able to recover a previous version of your project file and not have to go through this hassle. Pretty much any source control solution you can think of can be run on a PC without requiring a dedicated server. One of the easiest to setup is VisualSVN Server, which is free for personal and commercial use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With