我使用的是Windows 7 Enterprise 32位.我使用过Windows命令行,并且还使用了VSTS 2008命令行,但是在执行gacutil.exe时,发现命令未找到错误.
我想知道是否需要从某处安装gacutil.exe或gacutil.exe位于我的计算机的其他位置(我搜索了我的计算机,但找到了几个名为gacutil.exe的文件,我不知道应该使用哪一个) ?
顺便说一句:我使用的是.Net 3.5.
我已经在.net框架中组装了一个程序集,我打算将其发布到GAC,但是我无法找到gacutil它.
我一直在谷歌搜索,我发现了很多建议,但没有任何作用:
[DOES NOT WORK][DOES NOT
WORK][returns an error: this assembly is built by a runtime newer
than the currently loaded runtime and cannot be loaded]有没有人有想法解决这个问题?
我正在从Visual Studio命令提示符2010中运行GacUtil.exe,以便向GAC注册dll(CatalogPromotion.dll).运行该实用程序后,它说Assembly Successfully added to the cache,并且运行gacutil /l CatalogPromotionDll显示GAC包含程序集,但是当我从Windows资源管理器导航到C:\ WINDOWS\assembly时,我看不到程序集. 为什么我不能从Windows资源管理器中看到WINDOWS\assembly中的程序集,但我可以使用gacutil.exe看到它?
背景:这是我在VS Tools的命令提示符中输入的内容:
C:\_Dev Projects\VS Projects\bmccormack\CatalogPromotion\CatalogPromotionDll\bin
\Debug>gacutil /i CatalogPromotionDll.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
C:\_Dev Projects\VS Projects\bmccormack\CatalogPromotion\CatalogPromotionDll\bin
\Debug>gacutil /l CatalogPromotionDll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
CatalogPromotionDll, Version=1.0.0.0, Culture=neutral, … 我一直在寻找一段时间试图更好地理解这一点,但我没有找到任何直截了当的答案.
我有一个组件需要添加到GAC.我正在运行Windows 7 64位,并且为了解决问题(SSIS 2005无法识别DLL),我正在尝试确保在适当的GAC中注册了DLL(.NET 4.0) .
所以这是我的问题:
Windows 7中64位和32位GAC的物理位置在哪里?我知道C:\ Windows\assembly,但不知道这是哪一个,另一个是哪里.
我使用哪个版本的gacutil将程序集添加到64位GAC?32位GAC?我知道C:\ Program Files(x86)\ Microsoft Visual Studio 10.0\VC,我假设这是32位,但不确定64位gacutil在哪里.
什么决定了应用程序在组件中查找哪个GAC?我假设这取决于应用程序是64位还是32位,但我想知道它是否还有更多.
提前致谢.
更新:
在深入了解ShaneBlake的回答之后,我记得.NET 2.0和.NET 4.0 GAC位于不同的位置.所以:
.NET 2.0 GAC :(
c:\windows\assembly32位和64位?)
.NET 4.0 GAC
c:\windows\Microsoft.NET\assembly\GAC_32(仅限32位)
c:\windows\Microsoft.NET\assembly\GAC_64(仅限64位)
c:\windows\Microsoft.NET\assembly\GAC_MSIL(32位和64位?)
这听起来与这个问题有关,但它们并不是一回事.这个问题没有出现任何集会.除了我安装的特定设备之外,我的所有设
我希望有人能解决这个问题......我做错了什么?或者我在VS中发现了一些错误?
我在Windows 7旗舰版上使用Visual Studio 2010 Professional Beta 2.我刚刚下载了Rhino Mocks并决定使用命令行实用程序GACUTIL将其安装到GAC中.然后我重新启动了.
在这里你可以看到我的GAC中的程序集(点击放大):
以下是Visual Studio中可用的程序集列表:
这是我安装它的命令提示符,然后确认它:
C:\Users\jason\Downloads>gacutil -i Rhino.Mocks.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.21006.1
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
C:\Users\jason\Downloads>gacutil /l |grep -i rhino
Rhino.Mocks, Version=3.6.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL
Run Code Online (Sandbox Code Playgroud) 我希望管理员为我注册一些DLL,但他可能不想安装整个SDK.
他可以安装gacutil.exe吗?如果是这样,他在哪里可以得到它?我只是将gacutil.exe文件通过电子邮件发送给他,他必须把它放在他的机器上才能使用它?
我有一个完整的dll目录,我需要注册到GAC.我想避免明确地注册每个文件 - 但似乎gacutil没有"register directory"选项.任何人都有快速/简单的解决方案?
我无法从GAC卸载程序集(log4net.dll).它给出了以下错误.
"一个或多个申请需要组装".
但是,如果我使用ProcessExplorer搜索程序集,则不会出现任何问题?如何从GAC中删除此程序集?
有没有一种简单的方法在PowerShell中(我想使用gacutil.exe)从文本文档中读取路径\程序集并在GAC中注册它?例如,一个.txt文件看起来像:
c:\test\myfile.dll
c:\myfile2.dll
d:\gac\gacthisfile.dll
Run Code Online (Sandbox Code Playgroud)
PowerShell脚本会将其读入流中,然后在找到的每个程序集上运行gacutil?我想这会是这样的:
#read files into array?
foreach ($file in Get-ChildItem -Filter "*.dll" )
{
Write-Host $file.Name
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil.exe /nologo /i $file.Name
}
Run Code Online (Sandbox Code Playgroud) 关于GAC
我有一个快速的问题我创建了一个程序集Awesome.DLL.如果它已签名,则安装到GAC中:
C:\MyApps\Awesome\Awesome\Awesome\bin\Release>sn -k Awesome.snk
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Key pair written to Awesome.snk
C:\MyApps\Awesome\Awesome\Awesome\bin\Release>gacutil /i Awesome.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
C:\MyApps\Awesome\Awesome\Awesome\bin\Release>gacutil /l Awesome.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
Number of …Run Code Online (Sandbox Code Playgroud)