本文介绍了VS2015生成错误:无法将指定的程序集添加到全局程序集缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将GAC部署到共享点。部署失败,并显示以下错误消息:

I'm trying to deploy GAC into the sharepoint. Deployment fails with this error message:

问题是在 C:\Windows\Microsoft.NET\程序集\GAC_MSIL\Microsoft.Practices.SharePoint.Common\v4.0_2.0.0.0__ef4330804b3c4129\ 文件夹是不知何故被另一个名为 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll 的.dll锁定。

The problem is that mentioned .dll inside C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Practices.SharePoint.Common\v4.0_2.0.0.0__ef4330804b3c4129\ folder is somehow locked by another .dll called Microsoft.Alm.Shared.Remoting.RemoteContainer.dll.

只有一种可行的解决方案正在重新启动Windows Server,但是一旦我尝试部署更新版本,问题就会再次发生。

Only one working solution is restarting windows server, but problem will happen again once I will try to deploy a newer version.

还有其他解决方案如何防止阻止此和其他类似的dll吗?

Is there any other solution how to prevent blocking this and other similar dlls?

谢谢

推荐答案

名为 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll 的进程在Visual Studio IDE中提供了 CodeLens功能。此功能在VS中提供了一些不错的功能,例如实时显示对函数声明的声明,源代码控制状态,测试状态等。

The process named Microsoft.Alm.Shared.Remoting.RemoteContainer.dll supplies the feature "CodeLens" in the Visual Studio IDE. This feature supplies some nice functionality in VS like live display of references to functions above their declaration, source control status, test status and some others.

如果您可以在

如果您不想一直在该计算机上禁用CodeLens,则可以在部署之前杀死 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll 。这将在所有正在运行的Visual Studio实例中暂时禁用CodeLens,但是CodeLens在重新启动Visual Studio之后将再次运行。

If you don't want to disable CodeLens all the time on that computer, you can just kill Microsoft.Alm.Shared.Remoting.RemoteContainer.dll before deploying. This will temporarily disable CodeLens in all running instances of Visual Studio, but CodeLens will work again after restarting Visual Studio.

在尝试将程序集注册到之前自动终止进程GAC(全局程序集缓存),请在调用gacutil之前,将以下命令添加到同一位置:

To automate killing the process before trying to register the assembly to the GAC (Global Assembly Cache), add the following command to the same place before your call to gacutil:

taskkill /f /im Microsoft.Alm.Shared.Remoting.RemoteContainer.dll






该问题的实际触发因素是,解决方案中的至少一个项目从GAC中从GAC加载了程序集 Microsoft.Practices.Sharepoint.Common.dll 。 Visual Studio IDE。您可以通过使程序集引用指向GAC之外的 Microsoft.Practices.Sharepoint.Common.dll 版本来防止这种情况。


The actual trigger of the problem is that at least one of your projects in the solution loads the assembly Microsoft.Practices.Sharepoint.Common.dll from the GAC from within the Visual Studio IDE. You can prevent this by having the assembly reference point to a version of Microsoft.Practices.Sharepoint.Common.dll outside the GAC.

问题也是。 Microsoft看不到此错误,并说不建议在构建过程中向GAC注册程序集并使用GAC中的程序集。

The issue was also discussed at Microsoft Connect. Microsoft does not see this a bug and says registering an assembly to the GAC and using assemblies from the GAC during build is not recommended.

这篇关于VS2015生成错误:无法将指定的程序集添加到全局程序集缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 15:37