元素<import>中“Project”属性的值“”无效。 vs2012 </进口>

时间:2012-10-04 17:05:57

标签: c# visual-studio-2012 csproj

尝试在visual studio 2012中加载某些项目时出现以下错误:

G:\path\project.csproj : error  : The value "" of the "Project" attribute in element <Import> is invalid. Parameter "path" cannot have zero length.

我在svn结账后重新启动机器。这些项目可以正确加载到其他机器上。

有人可以帮我解决这个问题吗?谷歌没有给我答案,我希望如此。

修改

这是csproj文件的相关部分。

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Import Project="$(StyleCopTargets)" />

</Project>

1 个答案:

答案 0 :(得分:6)

你写的从新鲜开始。我怀疑没有安装StyleCop,因此别名值被替换为空白,使该字段也为空。

删除引用或安装StyleCop。我认为应该这样做。

编辑:为方便起见: http://stylecop.codeplex.com/