.. _installation:

*************
Installation
*************

.. _introduction:

Introduction
============

The C#/.Net version of the OpenEye Toolkits is a P/Invoke
wrapper created using SWIG. It is important to note that this is not a new
version of the toolkits written in C# nor is it a C# interpretation of the
toolkit API, but a rather faithful reproduction of the toolkit API in C#.
And while this manual is specific to C#, the version of the toolkits works
with all .Net languages include Visual Basic .Net, F# and IronPython.

A few of the idiomatic differences include:

* There are relatively few classes in OEChem and they have a rather
  shallow inheritance hierarchy.

* Most OEChem algorithms are in C++ free functions. These are
  mapped to static methods in the class `OEChem`.

* C# doesn't support all the operator overloading of C++, so some C++
  operators are   mapped to methods. For example, "operator bool()" is mapped to
  a member function called "IsValid()", "operator()" is mapped to "Call()".

.. _csharp_prerequisites:

Prerequisites
===============

In order to use the OpenEye toolkits with C#/.Net, you need a copy of
Visual Studio. We currently support VS2022 including the free "Express" version.

.. note::

   VS2022 requires the `.NET Framework 4.8 <https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48>`_.
   We do not yet support .NET Core.


GPU Prerequisites
=================

.. note::

  **GPU-Enabled OpenEye products** are not supported on Windows platforms or in the C# language.

Download the OpenEye .Net distribution
======================================

The distribution is obtained from http://www.eyesopen.com/downloads. There
is a 64-bit download for each supported version of Visual Studio.

Installation
=============

Each distribution is provided as ZIP file, that you can simply
extract.  Inside the ``C#-Examples`` folder, you will find a pair of
folders for each toolkit. One for the main examples and one for the
documentation examples. Each sub-folder contains a solution (.sln)
file appropriate for your chosen Visual Studio version.


.. _GAC:

The Global Assembly Cache
==========================

If you desire to install all the OpenEye assemblies into the Global
Assembly Cache, there is a convenience script included in the
``Scripts`` directory. Double-click on :program:`Install_to_GAC.bat`
to install all the assemblies.

If you need to uninstall the assemblies for some reason, simply
double-click on :program:`Uninstall_from_GAC.bat`.

.. note:: There is no requirement to install anything into the
  GAC. If you are not sure you need this, you probably don't.

