Today, I tried to open one of my Visual Studio 2010 Express Edition projects and it failed to open. I thought that maybe the the file has been corrupted or something, but it turns out that all of my projects are doing this, including the ones that I haven't touched for months! This is the error message I'm getting:
D:\CSharp\Sandbox\MustardApplication1\MustardApplication1\MustardApplication1.csproj : error : Unable to read the project file 'MustardApplication1.csproj'.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1693,24): The project file could not be loaded. '', hexadecimal value 0x0C, is an invalid character. Line 1693, position 24.
I have no idea what it's talking about, and I don't know what to do next. I can't even create a new "Windows Forms Application"; I get the same error message. Can anyone help me out?
Somehow your Microsoft.Common.targets got corrupted.
Specifically, 0x0C is not a valid ASCII character (maps to ESC IIRC).
Look at the specific spot (line 1693, col 24), and remove or fix the offending part.
A reinstall/repair of the .NET 4 framework might work.
Alternatively, if you are using Windows 7, try using the 'restore previous version' command.
MSBuild has several .targets files which it uses to define common tasks. It happens to be an XML file, and hexedecimal value 0x0C is most definitely not a valid character.
I would say to open up that file in a good text editor such as Notepad++ and remove the offending character, but you may have to just replace that file with the default one since it appears to have been corrupted. Where you get just that file to replace I have no idea :(
At least you know exactly where to look.
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