終於我能夠解決它。
在我的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所述刪除了這些標籤。它解決了我的問題。