The value “” of the “Project” attribute in element <Import> is invalid. vs2012

断了今生、忘了曾经 提交于 2019-12-03 17:41:13

问题


I'm getting the following error while trying to load some projects in 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.

I'm trying this with a fresh start on the machine after a svn checkout. These projects can be loaded on other machines correctly.

Can some one help me out with this one? Google didn't give me the answer, I hope SO will.

EDIT

This is the relevant part of the csproj file.

<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:


You write you start from fresh. I suspect StyleCop isn't installed so the alias value is replaced with a blank leaving the field also blank.

Either remove the reference or install StyleCop. I think that should do the trick.

edit: just for convenience: http://stylecop.codeplex.com/



来源:https://stackoverflow.com/questions/12732224/the-value-of-the-project-attribute-in-element-import-is-invalid-vs2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!