Skip to main content

References from the Global Assembly Cache (GAC)

🔗 Original page — Source of this material


Description​

When using C# snippets, you have access to all the features of the C# language. It includes an extensive library of classes and methods that cover most tasks you might encounter. You can learn about the classes and their capabilities on the page .NET Framework Class Library

If you can't find a class that solves your problem, you can connect an external class library. To do this, you need to add the References from GAC element to the panel, where you can add your library.

How to use it?​

If you can't find a class that solves your problem when using C# snippets, you can connect an external class library. To do this, add the References from GAC element to the static blocks panel.

image-20200817-105211

A new element will appear on the static blocks panel:

image-20200817-105241

When you open this element, a window will appear listing the currently connected libraries.

image-20200817-105308

Use the “Add” button to add your library, either by selecting it from the list or uploading it from a file.

image-20200817-105344

You can also set a filter to search for the data you need.

image-20200817-105411

Once you've added the required library, you need to specify a new namespace using the block ❗→ using Directives and Shared Code.

image-20220211-163401

When using either the standard .NET Framework class library or a third-party library, to access classes without specifying the namespace and to keep your code neat, it's recommended to use ❗→ using Directives and Shared Code.