VS2015 build error: Cannot add the specified assembly to the global assembly cache
VS2015 build error: Cannot add the specified assembly to the global assembly cache
我正在尝试将 GAC 部署到共享点中。部署失败并显示此错误消息:
Error occured in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache: Microsoft.Practices.Sharepoint.Common.dll
问题是 C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Practices.SharePoint.Common\v4.0_2.0.0.0__ef4330804b3c4129\
文件夹中提到的 .dll 以某种方式被另一个名为 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
的 .dll 锁定。
只有一个可行的解决方案是重新启动 windows 服务器,但是一旦我尝试部署更新的版本,问题就会再次发生。
是否有任何其他解决方案如何防止阻止这个和其他类似的 dll?
谢谢
名为 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
的进程提供 Visual Studio IDE 中的功能 "CodeLens"。此功能在 VS 中提供了一些不错的功能,例如实时显示对声明上方函数的引用、源代码控制状态、测试状态和其他一些。
如果您在
中禁用 Visual Studio 中的 "CodeLens",问题就会消失
Visual Studio Options > Text Editor > All Languages > Code Lens
如果您不想一直在该计算机上禁用 CodeLens,您可以在部署前终止 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
。这将在 Visual Studio 的所有 运行 个实例中暂时禁用 CodeLens,但 CodeLens 将在重新启动 Visual Studio.
后再次工作
要在尝试将程序集注册到 GAC(全局程序集缓存)之前自动终止进程,请将以下命令添加到调用 gacutil 之前的同一位置:
taskkill /f /im Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
问题的实际触发点是解决方案中的至少一个项目从 Visual Studio IDE 中的 GAC 加载程序集 Microsoft.Practices.Sharepoint.Common.dll
。您可以通过将程序集引用指向 GAC 外部的 Microsoft.Practices.Sharepoint.Common.dll
版本来防止这种情况。
问题也是 discussed at Microsoft Connect。 Microsoft 认为这不是错误,并表示不建议在构建期间将程序集注册到 GAC 并使用来自 GAC 的程序集。
我有同样的问题“部署步骤 'Add Solution' 出错:错误:无法将指定程序集添加到全局程序集缓存:itextsharp.dll。" 我从 GAC 中卸载 itextsharp.dll 并解决了问题。
我正在尝试将 GAC 部署到共享点中。部署失败并显示此错误消息:
Error occured in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache: Microsoft.Practices.Sharepoint.Common.dll
问题是 C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.Practices.SharePoint.Common\v4.0_2.0.0.0__ef4330804b3c4129\
文件夹中提到的 .dll 以某种方式被另一个名为 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
的 .dll 锁定。
只有一个可行的解决方案是重新启动 windows 服务器,但是一旦我尝试部署更新的版本,问题就会再次发生。
是否有任何其他解决方案如何防止阻止这个和其他类似的 dll?
谢谢
名为 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
的进程提供 Visual Studio IDE 中的功能 "CodeLens"。此功能在 VS 中提供了一些不错的功能,例如实时显示对声明上方函数的引用、源代码控制状态、测试状态和其他一些。
如果您在
中禁用 Visual Studio 中的 "CodeLens",问题就会消失Visual Studio Options > Text Editor > All Languages > Code Lens
如果您不想一直在该计算机上禁用 CodeLens,您可以在部署前终止 Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
。这将在 Visual Studio 的所有 运行 个实例中暂时禁用 CodeLens,但 CodeLens 将在重新启动 Visual Studio.
要在尝试将程序集注册到 GAC(全局程序集缓存)之前自动终止进程,请将以下命令添加到调用 gacutil 之前的同一位置:
taskkill /f /im Microsoft.Alm.Shared.Remoting.RemoteContainer.dll
问题的实际触发点是解决方案中的至少一个项目从 Visual Studio IDE 中的 GAC 加载程序集 Microsoft.Practices.Sharepoint.Common.dll
。您可以通过将程序集引用指向 GAC 外部的 Microsoft.Practices.Sharepoint.Common.dll
版本来防止这种情况。
问题也是 discussed at Microsoft Connect。 Microsoft 认为这不是错误,并表示不建议在构建期间将程序集注册到 GAC 并使用来自 GAC 的程序集。
我有同样的问题“部署步骤 'Add Solution' 出错:错误:无法将指定程序集添加到全局程序集缓存:itextsharp.dll。" 我从 GAC 中卸载 itextsharp.dll 并解决了问题。