ssisgacwindows-11script-componentvsta

Why won't Windows 11 allow an Administrator to run gacutil.exe?


I am creating .dtsx packages with Script Components on a development (DEV) machine using VS2019. DEV is Windows 11 Enterprise 64 Bit and I have local administrator rights.

Because it seems like Visual Studio Tools for Applications (VSTA) does not save assemblies that are added when you save the Script and Script Component, I have registered those assemblies manually using GACUtil.exe on DEV. I have successfully tested the packages on DEV in VS2019.

On my production (PROD) machine, I am executing the packages using DTExec.exe. PROD is also Windows 11 Enterprise 64 bit. I have several other packages (that do not have script components) that have been working via DTExec on PROD method for more than a year.

As I expected, when I tried to run my package on PROD, I received the following error:

Error: 2024-07-25 06:17:34.19
   Code: 0xC0047062
   Source: Data Flow Task Data Flow Task (SC Source [155])
   Description: CS0234 - The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?), main.cs, 17, 19
End Error

So I proceeded to attempt to register the assemblies as I did on DEV (using the gacutil.exe command from a terminal window opened as Administrator) but then received the following alert:

This App can't run on your PC

Followed by this message in the terminal:

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools>gacutil.exe /if R:\shrdata\VICUSTSV\Inventory Management\Code\System.Text.Json.dll
Access is denied.

What I have attempted so far:

  1. I have re-installed both .NET SDK and .NET runtime on PROD without any resolution
  2. I have tried to run gacutil.exe from the VS2019 CLI on PROD resulting in the same error
  3. I have checked permissions on the file gacutil.exe which shows "Full Control" to administrators.

Other research:

  1. I did find StackExchange entries suggesting using Windows Compatibility on the GACUtil.exe file, but it didn't seem to apply since both of my machines are Win 11 and GACUtil is working on one of them.
  2. I did find this answer to a related question Copy NETFX Tools folder from DEV to PROD However, I think this is a last resort. It seems to be an extreme workaround and doesn't really answer the question of why gacutil is not working.

So my question is: How can I get gacutil to register assemblies on PROD?


Solution

  • So it turns out that I had 2 Windows SDKs installed: \NETFX 4.7.2 Tools and \NETFX 4.8 Tools. The environmental variables paths must have been wrong or pointing to the wrong folder, because when I navigated to the NETFX 4.7.2 folder in the terminal (with Admin privileges) to run gacutil.exe, it worked just fine.