开发者

Visual Studio project conversion error

I wrote an application using Visual Studio 2010 that I configured to run using the 3.5 framework.

I then checked in this project and had a coworker, who is using Visual Studio 2008, grab the project. He then started getting an error that says it could not find file \Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets emphasis on the v10.0.

First off, why is it trying to reference a 2010 directory when I converted it to 3.5? Shouldn't it run on a machine that does not have VS 2010 installed?

Secondly, what is Microsoft.WebApplication.targets and 开发者_C百科why do I need it?


Because the v10.0 (second) path is not present in machines that do not have V2010 installed, VS2008 was unable to load the project.

vs 2008 path-

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />

vs 2010 path-

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

but if u want to run it in both the installations, do as under- Step1: Add the V10.0 path before the V9.0 MSBuild extension path with a Condition property to check for the file based on the Solution Version.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '10.0'" />

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '9.0'" />

Here is we do not specify the Visual Studio 2010 MSBuild extension path first the Visual Studio will try to upgrade the project.

Step2:

After the project file upgrade VS2010 would have changed the FileUpgradeFlags tags value to 0, which would again trigger an upgrade. Remove the Zero from the tag.

<FileUpgradeFlags></FileUpgradeFlags>

Save the project file and reload. Now you will be able to load the project in VS2010 & VS2008 (Even if VS2010 is not installed) without any problem.


It doesn't matter what the target framework is. If the project is created using VS 2010 , it won't open in VS 2008.

However, projects created with VS 2008 can be converted to VS 2010 format.

Regarding the second error, do you have VS 2010 with "Visual Web Developer" component installed ?

This file is installed with that component.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜