找不到 Microsoft.web.Infrastructure.dll - Visual Studio 2015 [英] Microsoft.web.Infrastructure.dll not found - Visual studio 2015

查看:36
本文介绍了找不到 Microsoft.web.Infrastructure.dll - Visual Studio 2015的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的解决方案的许多项目的 package.config 中有这个 dll (Microsoft.web.Infrastructure.dll).没有构建错误,dll 正在下载到解决方案的包文件夹.我在应用程序命中的每个项目上丢失 dll 时遇到运行时错误.当我查看单个项目 bin 文件夹时,我没有看到这个 dll 被复制.然而,正如我之前提到的,dll 被下载到解决方案的包文件夹中.

I have this dll (Microsoft.web.Infrastructure.dll) in many project's package.config of my solution. There are no build errors and the dll is getting downloaded to Solution's packages folder. I am getting runtime error on missing dll on each of the project the application hits. When I look at the individual project bin folder, I don't see this dll copied. However as I mentioned earlier the dll is downloaded to packages folder of solution.

临时解决方案 -

  1. 手动将这个 dll 复制到所有单独的项目 bin
  2. 将此 dll 放在 GAC 中

这个问题只出现在我的机器上,而不出现在任何其他同事的机器上. 令人惊讶的是,他们中的一些人将此 dll 复制到项目文件夹中,而另一些人则没有.在 GAC 中没有这个 dll 并且没有任何手动工作,它对他们有效,干净的重建为他们做了一切.

This problem is only on my machine and not on any other colleague's machine. Surprisingly some of them have this dll copied into project folder while some of them don't. It works for them without this dll in GAC and without any manual effort, a clean rebuild did everything for them.

我有一个短期修复,但我更想知道它在其他机器上是如何工作的以及我缺少什么.

I have a short term fix but I am more curious to know how it working on other machines and what I am missing.

到目前为止我尝试过的东西 - 清理 Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root....清洁解决方案并关闭重新打开解决方案,最后重建解决方案

Things that I have tried so far - Clean Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root.... Clean solution and close reopen solution and finally Rebuild solution

与 Visual Studio 2013 相比,Visual Studio 2015 没有清晰的 nuget 缓存.

仅供参考 - 我有 Visual Studio 2015,所有其他机器都在 2013 年,如果不是别的东西,这就是我现在正在看的地方.

FYI - I have Visual Studio 2015 and all other machines are on 2013, if not something else this is where I am looking at now.

感谢任何帮助.

推荐答案

请检查项目参考中是否存在 Microsoft.web.Infrastructure.dll.如果没有,请尝试使用 Win 的建议,通过以下命令在包管理器控制台中重新安装包:

Please check whether the Microsoft.web.Infrastructure.dll is exist in the Project References. If not, please try Win’s suggestion to reinstall your package in the Package Manager Console by following command:

更新包 - 重新安装 Microsoft.Web.Infrastructure

Update-Package –reinstall Microsoft.Web.Infrastructure

因为NuGet Restore 仅将基于 package.config 文件的包还原到包目录,而不会添加对您项目的引用强> 默认情况下.所以我们需要强制重新安装包以将引用和内容文件添加到项目中.

Because the NuGet Restore only restores packages based on the package.config file to the packages directory, but does not add the reference to your project by default. So we need to force reinstall the package to add references and content files into project.

如果您的项目引用中已经存在该dll,您需要检查Copy Local"的属性值.Copy Local 属性确定是否将引用复制到本地 bin 路径.如果要将引用复制到 bin 文件夹,则应设置 CopyLocal=True.有关更多信息,请参阅设置复制本地属性细节.

If the dll is already existed in your Project References, you need to check the property value of "Copy Local". The Copy Local property determines whether a reference is copied to the local bin path. The CopyLocal=True should be set if the reference want to be copied to bin folder. See Set the Copy Local Property for more detail.

这篇关于找不到 Microsoft.web.Infrastructure.dll - Visual Studio 2015的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆