vb.net - Visual Studio 2013 - 系统找不到指定的引用

标签 vb.net visual-studio

我用谷歌搜索并检查了这里的现有帖子,但没有找到任何相关的帖子,所以这是我的问题。

我使用的是VS2013 Primium版。我有几个类库项目(全部使用框架4.0)。当这些类库成为 Web 解决方案的一部分时,将显示类库中的引用路径,并且项目可以正常编译,如下所示。 When class library is part of Web Solution

但是,相同的类库项目在成为 Windows 服务解决方案的一部分时不会加载引用路径。

When project is loaded in windows service

我仔细检查了我的所有项目都使用相同的框架版本。知道出了什么问题吗?

最佳答案

我终于能够解决这个问题了。

按照描述在我的 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 。它解决了我的问题。

关于vb.net - Visual Studio 2013 - 系统找不到指定的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41800254/

相关文章:

c# - 替换 Visual Studio 中的所有属性

css - 有什么方法可以让字体的颜色在 css 中有值(value)?

android - 有没有办法将 ProGuard 与 MonoDroid 一起使用?

visual-studio - Qt Visual Studio 社区插件

visual-studio - Visual Studio 中 VSCode 的 CTRL + D ("add selection to next location match") 的等效快捷方式是什么?

string - "value of type datagridviewcell can not be converted to string"vb.net

c# - Matrix3D 入门 (Silverlight)

vb.net - VB .NET 安装项目 - 许可协议(protocol) - 强制用户在同意之前滚动?

vb.net - 如何在 Windows 关机时正常关闭控制台应用程序

regex - 数字位数未知的 VB 模式