0

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

GAC_32 GAC_64 GAC_MSIL

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

1 Answer 1

1

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

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

EDIT:

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=1.0.0.0, Culture=neutral, PublicKeyToken=XXX") 
5
  • Hi how to verify that DLL installed in server GAC folder by command or location? Commented Jan 8, 2019 at 10:00
  • Please check my updated answer. Commented Jan 8, 2019 at 10:41
  • when i deploy can i use the same PublicKeyToken=b03f5f7f11d50a3a or use with which come with dll? Commented Jan 8, 2019 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. Commented Jan 8, 2019 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=1.3.6.2, Culture=neutral, PublicKeyToken=xxxx' or one of its dependencies. The system cannot find the file specified." Commented Jan 9, 2019 at 4:47

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.