Hi I compiled a dll with .netframework 4.6 and want to deploy to a server ,which has sharepoint 2016 and windows server 2016 ,what is the right command and path for deploy this dll to assembly gac folder.

In windows server 2016

I want PowerShell Command for deploy this DLL. I want to deploy to C:\Windows\assembly folder

when I go to this path C:\Windows\Microsoft.NET\assembly I found three folders, from this which one is the correct path for assemblies


  • 2
    is that dll for SharePoint? i mean, will sharepoint use it? or this is part of any wsp/ solution? – Waqas Sarwar MVP Jan 7 at 19:40
  • yes a custom web service deploy under layouts folder in all SharePoint web applications – adilahmed Jan 8 at 8:34

You should be able to deploy the dll to GAC with the following powershell commands:

[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("FULL PATH TO DLL")


If you want to check if the dll has been deployed, you can do it with the following powershell command (just replace the values for DllName, Version, Culture and PublicKeyToken with your own values):

[reflection.assembly]::Load("DllName, Version=, Culture=neutral, PublicKeyToken=XXX")
  • Hi how to verify that DLL installed in server GAC folder by command or location? – adilahmed Jan 8 at 10:00
  • Please check my updated answer. – Damjan Tomic Jan 8 at 10:41
  • when i deploy can i use the same PublicKeyToken=b03f5f7f11d50a3a or use with which come with dll? – adilahmed Jan 8 at 11:44
  • No, you have to use the values of your dll. This value (PublicKeyToken=b03f5f7f11d50a3a) is the public key from System.EnterpriseServices dll. – Damjan Tomic Jan 8 at 11:48
  • when i try to check assembly i got below error Exception calling "Load" with "1" argument(s): "Could not load file or assembly ' Version=, Culture=neutral, PublicKeyToken=xxxx' or one of its dependencies. The system cannot find the file specified." – adilahmed Jan 9 at 4:47

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.