locked
How to register dll on production environment(.net framework 4.5) RRS feed

  • Question

  • I have report server on which .net framework 4.5 is installed.I am unable to find gacutil.exe. How can register dll on production server.
    • Moved by Jiayi Li Monday, August 31, 2015 1:45 AM
    Friday, August 28, 2015 10:03 AM

Answers

  • Hi,

    Thanks for the support.

    I am using Wix for msi setup. i have an error like 'The assembly is not strongly named or is not signed with the minimal key length'. But my assembly is not strongly named. Is it compulsory that the dll should be strongly named to register it in GAC? If there is another option please suggest me.

    regards,

    Software Engineer 

    Infor

    Hi Infor,

    Yes, you must use a strong name. To generate this cryptographic key pair, use the SN Tool. Strong-named assemblies can be installed in the Global Assembly Cache.

    The Strong Name tool (Sn.exe) helps sign assemblies with strong names. Sn.exe provides options for key management, signature generation, and signature verification.

    https://msdn.microsoft.com/en-us/library/k5b5tt23(v=VS.100).aspx

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 7, 2015 8:37 AM

All replies

  • I want to register dll in GAC.

    Friday, August 28, 2015 10:10 AM
  • Hi DSnehal,

    This fourm is about .NET Framework Setup and Servicing, your issue would be related to CLR, I help you move this case to Common Language Runtime Internals and Architecture   forum for dedicated support.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Monday, August 31, 2015 1:44 AM
  • Hi DSnehal,

    >>I am unable to find gacutil.exe

    Gacutil comes with Visual Studio, not with VSTS. It is part of Windows SDK and can be download separately at http://www.microsoft.com/en-us/download/details.aspx?id=16217

    After installed successfully, you can find the GAC in any windows box under C:\windows\assembly\

    or %windir%\assembly

    Here is a good overview from Dave's Blog:

    http://blogs.iis.net/davcox/archive/2009/07/14/where-is-gacutil-exe.aspx

    Once you can find gacutil.exe tool, then follow the following msdn link.

    How to: Install an Assembly into the Global Assembly Cache

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 31, 2015 9:07 AM
  • Hi Kristin,

    Thanks for reply.

    Previously we were using drag drop option to register dll in GAC . But in 4.0 framework or higher versions this facility is not available.  As an alternative we planned to use GACUTIL. But we are unable to find GACUTIL, as it is part of SDK. 

     Is it compulsory to install SDK on customer’s production environment OR is there is any other option to register dll in GAC?

    regards,

    Software Engineer 

    Infor

    Monday, August 31, 2015 10:45 AM
  • Hi Infor,

    >>Previously we were using drag drop option to register dll in GAC .

    No, you cannot drag drop .NET 4 files into the GAC. In .net 4.0 Microsoft removed the ability to add DLLs to the Assembly simply by dragging and dropping.

    Instead you need to use gacutil.exe, or create an installer to do it. 

    >>Is it compulsory to install SDK on customer’s production environment OR is there is any other option to register dll in GAC?

    Can I download and install gacutil.exe without having to install VS or the SDK?

    From above thread, I got that the best thing to do here is to create a quick setup.exe or msi which will install the files into the GAC.

    Since there are two ways to install an assembly into the global assembly cache: One is using the Global Assembly Cache tool (Gacutil.exe). and another is using Microsoft Windows Installer. I would suggest you choose the second way.

    Please refer to the following threads,I believe you can get some hints from below.

    Deployment to GAC via Setup msi

    How to register dll in GAC with .Net MSI

    Deployment to GAC via Setup msi

    http://forums.asp.net/t/1496141.aspx?How+to+install+assembly+in+the+GAC+using+MSI+

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Kristin Xie Tuesday, September 1, 2015 2:12 AM
    Tuesday, September 1, 2015 2:05 AM
  • Hi,

    You could use Powershell to register the assembly (need to run as admin):

    Set-location "c:\temp"
    [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
    $publish = New-Object System.EnterpriseServices.Internal.Publish
    $publish.GacInstall("c:\temp\MyDLL.dll")
    iisreset

    Remove Assembly:

    Set-location "c:\temp"
    [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
    $publish = New-Object System.EnterpriseServices.Internal.Publish
    $publish.GacRemove("c:\temp\MyDLL.dll")
    iisreset

    Credits go to Cameron Dwyer: https://camerondwyer.wordpress.com/2013/05/22/how-to-install-a-dll-to-the-gac-on-windows-2012-using-only-powershell-without-having-to-install-sdk-or-visual-studio/

    Rgds MM


    PS: Please mark as answer if helpful. Thanks!
    Blog: http://www.manuelmeyer.net

    Wednesday, September 2, 2015 9:48 AM
  • Hi,

    Thanks for the support.

    I am using Wix for msi setup. i have an error like 'The assembly is not strongly named or is not signed with the minimal key length'. But my assembly is not strongly named. Is it compulsory that the dll should be strongly named to register it in GAC? If there is another option please suggest me.

    regards,

    Software Engineer 

    Infor

    Friday, September 4, 2015 5:38 AM
  • Hi,

    Yep. The assembly must be strong named if you want to install it in the GAC. If there is no strong name, you have to deliver the assembly with your project. GAC is not possible.

    Rgds MM


    PS: Please mark as answer if helpful. Thanks!
    Blog: http://www.manuelmeyer.net

    Friday, September 4, 2015 11:58 AM
  • Hi,

    Thanks for the support.

    I am using Wix for msi setup. i have an error like 'The assembly is not strongly named or is not signed with the minimal key length'. But my assembly is not strongly named. Is it compulsory that the dll should be strongly named to register it in GAC? If there is another option please suggest me.

    regards,

    Software Engineer 

    Infor

    Hi Infor,

    Yes, you must use a strong name. To generate this cryptographic key pair, use the SN Tool. Strong-named assemblies can be installed in the Global Assembly Cache.

    The Strong Name tool (Sn.exe) helps sign assemblies with strong names. Sn.exe provides options for key management, signature generation, and signature verification.

    https://msdn.microsoft.com/en-us/library/k5b5tt23(v=VS.100).aspx

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 7, 2015 8:37 AM
  • Hi,

    Thanks.. It worked fine to register dll in GAC. I am using WIX to copy files in a folder which is in Program files. If I copy files at other location it works fine but in Program files I am unable to copy files. What could be the issue. Please help..

    regards,

    Software Engineer 

    Infor

    Tuesday, September 22, 2015 6:18 AM