So, on a Win 2008 R2 Std x64, I have 6 (six) gacutil.exe all different (not counting ones in VS folders), in:
Questions are:
x64
versions have any difference in behavior?v7.0A
versions to other v6.0A
?NETFX 4.0 Tools
versions for .NET 4.0 assemblies, and the "standard" version for the rest?Or, if there is some general type article on the subject, I will be grateful.
Update 1. Concerning Hans Passant's answer:
Update 2.
So, to me seems like one can safely use either number 3 (then .NET4.0 is unavailable) or number 5 otherwise for all GAC operations on Windows x86 and x64. And the answers to the questions are:
NETFX 4.0 Tools
version (if .NET4.0 is available) for all GAC operations.Gacutil.exe is a Windows SDK tool, not a .NET framework tool. You got two versions of the SDK on your machine. You got 6.0A from the VS2008 install, 7.0A from the VS2010 install. You also have a 64-bit operating system so you got the 64-bit tools as well. Which doesn't matter for gacutil.exe, not sure why they include it separately. Probably to keep the Visual Studio Command Prompt working, note that you have separate 32-bit and 64-bit versions of it. Which matters a lot for C++ projects. VS2010 allows targeting both CLR version 4 and CLR version 2 so that's 6 versions total.
What does matter a great deal is that you have two GACs on your machine. The GAC for .NET 4 assemblies is stored in c:\windows\microsoft.net\assembly. For earlier versions it is stored in c:\windows\assembly. You must use the proper version of gacutil.exe to get an assembly into the proper GAC. For an assembly that targets .NET 4, you must use the one in Bin\NETFX 4.0 Tools. And for earlier ones, you must use the one in Bin.
Using it not at all is best, assemblies should have the Copy Local property set on a dev machine. The GAC is a deployment detail, you'll get in trouble when your GAC has an assembly that your user's GAC doesn't have.
Short version: If you have .NET 4.0 installed, use NETFX 4.0 Tools
version. Otherwise it doesn't really matter.
Answers to questions:
NETFX 4.0 Tools
version. Not sure if it is possible to have a v7.0 SDK and not have .NET 4.0 installed.NETFX 4.0 Tools
version for all GAC operations.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With