终于我能够解决它。
在我的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所述删除了这些标签。它解决了我的问题。