How to add system.threading.dll to GAC

0

So I open Developer Command Prompt for VS 2017 and I can easily add dll to GAC writing this:

gacutil.exe -i HtmlAgilityPack.dll

but if I try to add .dll which has 2 dots in it, I receive wrong extension.

gacutil.exe -i System.Threading.dll

So I tried multiple ways to escape it:

gacutil.exe -i 'System.Threading.dll'
gacutil.exe -i "System.Threading.dll"

Same error: An attempt was made to load a program with an incorect format.

If I try:

gacutil.exe -i `System.Threading.dll`

The filename,directory name or volume label syntax is incorrect

mybirthname

Posted 2019-05-07T23:11:14.527

Reputation: 347

@Ramhound If the assembly was not strong named, the error will be different. Also this is .Net Framework assembly so I assume they strong named it. Why I need this, I inherited legacy project which has build error exactly like this https://forum.red-gate.com/discussion/78282/sqldatacompare-engine-needs-system-threading-dll. I'm forbidden to rollback to previous version of .Net. So in the Sql Red gate forum one user mention that adding the dll to GAC solve their problem. The problem is that sqldatacompare-engine is using .net 3.5 and I'm on version 4.6.1

– mybirthname – 2019-05-07T23:29:32.737

You can also register it by the assembly name. Have you tried that? You will want to specify the Version in that case

– Ramhound – 2019-05-07T23:39:49.990

@Ramhound I pretty much doing this from selected article:gacutil.exe -i System.Threading.dll is what they suggest. I'm in the folder path of the System.Threading.dll when executing this command – mybirthname – 2019-05-07T23:49:40.137

Still thinking your attempting to use the GAC incorrectly – Ramhound – 2019-05-08T00:10:13.190

No answers