Last post Dec 19, 2007 01:21 PM by lee12
Dec 18, 2007 11:23 AM|lee12|LINK
I installed 3.5 extensions was able to create project with asp.net mvc web application templatefor couple of days. today I am seeing this error and cannot open/create mvc projects
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets(1,1): The imported project file could not be loaded. Invalid character in the given encoding. Line 1, position 1.
Dec 18, 2007 03:26 PM|SteveSanderson|LINK
Lee, I've no idea what would cause this issue. It's strange for something to work for a few days and then stop. Did you install something new in the meantime?
Have you checked the contents of the file referenced (Microsoft.WebApplication.targets)? Is it a valid XML file? It does get loaded when the project file is opened in Visual Studio, so if that was corrupted it would prevent you from opening your MVC projects.
The problem may go away if you replace that file with a new copy. You could either re-install the .NET 3.5 framework, or just copy the file from another PC.
Dec 18, 2007 04:30 PM|lee12|LINK
where would I get a new copy of the file
I tried uninstall->install
both did not work
I installed acrobat reader, before that it was working, this was the only new thing that got installed
Dec 18, 2007 06:32 PM|DavidHogue|LINK
C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets is a file from Visual Studio 2008. Check if the file is there and if it is open it with notepad and see if it looks ok. Maybe Visual Studio 2008 is not
installed? Maybe the file got corrupted or overwritten? If so, you could try copying the file from another machine with 2008 installed or reinstall Visual Studio.
You could also try this: open your .csproj file with notepad and look for a line like <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" Condition="" />. Comment out that line or delete
it and try opening the project again (or even try changing v9.0 to v8.0). I'm not sure if this solution is a good idea though. You would might lose some features when building, like getting a _PublishedWebsites folder.
Dec 18, 2007 06:41 PM|lee12|LINK
thanks, will try when I go home and post results back
Dec 19, 2007 01:21 PM|lee12|LINK
I had to reinstall VS to fix the issue. the file in question got corrupted