2017-01-23 142 views
1

我在這裏搜索並檢查了現有的文章,但沒有找到任何相關的文章,所以這裏是我的問題。Visual Studio 2013 - 系統找不到指定的文件

我正在使用VS2013 Primium版。我有幾個類庫項目(都使用框架4.0)。當這些類庫成爲Web Solution的一部分時,會顯示類庫中的引用路徑,並且項目編譯如下所示。 When class library is part of Web Solution

但是,相同的類庫項目在成爲Windows Service Solution的一部分時不加載參考路徑。

When project is loaded in windows service

我翻了一番檢查我所有的項目都使用相同的框架版本。任何想法出了什麼問題?

回答

2

終於我能夠解決它。

在我的Windows服務解決方案中重新創建了我的庫項目,如here所述。

我在我的web解決方案中打開了相同的庫項目。不知何故,我的網絡解決方案在我的圖書館項目文件中添加了nuGet恢復標籤。

<RestorePackages>true</RestorePackages> 
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> 
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> 
<PropertyGroup> 
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> 
</PropertyGroup> 
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" /> 

這些標籤正在引起麻煩。一旦我按照here所述刪除了這些標籤。它解決了我的問題。

相關問題