2012-10-04 49 views
11

我收到以下錯誤嘗試加載一些項目在Visual Studio 2012:元素<Import>中「項目」屬性的值「」無效。 vs2012

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> 
+0

你能在文件project.csproj的內容粘貼,或至少相關的部分。 – K3N

+0

我編輯了我的問題。 –

+0

臨時刪除與StyleCopTargets行並再試一次,這是否工作? – K3N

回答

6

你寫你從新鮮開始。我懷疑StyleCop沒有安裝,所以別名值被替換爲一個空白字段也是空白。

請移除參考或安裝StyleCop。我認爲應該這樣做。

編輯:只是爲了方便: http://stylecop.codeplex.com/

+0

謝謝。這解決了問題。 –

+0

嗯,我安裝了stylecop,這個錯誤仍在發生 –