Click here to Skip to main content
15,891,702 members
Articles / Productivity Apps and Services / Biztalk
Tip/Trick

Tip 1 - .NET Assembly Add to GAC using Visual Studio

Rate me:
Please Sign up or sign in to vote.
4.86/5 (9 votes)
22 Dec 2015CPOL1 min read 17.8K   8   3
How to add DLL to gac using Visual Studio, for the purpose of use inside biztalk environment in orchestration

Introduction

This tip provides a simple explanation of how to install a DLL into the Global Assembly Cache (GAC).

  • The Global Assembly Cache provides a solution to the problem of duplicated DLLs.
  • The GAC is a machine-wide repository for shared assemblies.
  • Once an assembly is added to the GAC, it is available to all applications that wish to use it.

To use DLL Assembly in Biztalk Orchestration, you need the following:

  1. Add DLL To Gac
  2. Any Assembly added to Gac must have a strong name
  • Strong-naming an assembly creates a unique identity for the assembly.
  • This can prevent assembly conflicts.

Getting Started

A. Assembly Strong Name

  1. Open Visual Studio, create C# Class Library
  2. Add any code you need
  3. Go to project Properties

  4. Open Signing Tab, check sign the assembly, choose strong name key.

  5. Create a new strong name: you can protect with password and signature algorithm.

B. Assembly Add To Gac

  1. From project properties: go to Build Events Tab, Click Edit Post build.

  2. Write Command line using GAC Tool that adds assembly to Gac.
    • Find the path of gacutil:

      %ProgramFiles%\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe

    • Specify the targetpath (DLL Path)
    • For more information about GAC Tool, you need to follow this article.

  3. The last step is to build the DLL, show in output window, how DLL is successfully added to GAC.

Other Approach: Using CMD "Command Prompt"

  • Run command prompt as administrator.
  • Write the same CMD command before, but redirect to DLL folder.
  • It will register assembly to Gac.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions

 
GeneralJust for a RELEASE mode Pin
Mario Z22-Dec-15 23:16
professionalMario Z22-Dec-15 23:16 
GeneralRe: Just for a RELEASE mode Pin
Mohamed Zakarya23-Dec-15 6:22
Mohamed Zakarya23-Dec-15 6:22 
GeneralRe: Just for a RELEASE mode Pin
Mario Z23-Dec-15 20:20
professionalMario Z23-Dec-15 20:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.