Introduction

Delivering your .NET AddIn for MicroStation can be tricky, particulary if your main deliverable references other .NET assemblies that you use.

An AddIn is always a DLL that you install to a folder that MicroStation can see, such as ../MicroStation/mdlapps. MicroStation can 'see' a folder when one of its configuration variables points to that folder. In this case, it's MS_MDLAPPS that is of interest. By default, MS_MDLAPPS points to ../MicroStation/mdlapps.

To deliver your AddIn, install it in a folder mentioned in MS_MDLAPPS.

MS_MDLAPPS

You may want to install your AddIn elsewhere. One reason is to avoid polluting the delivered MicroStation folders. For example, you might want to install your AddIn here …

G:/MyCompany/mdlapps/

It's up to you to create that MyCompany folder using the usual Windows tools.

Now modify MicroStation's configuration by extending MS_MDLAPPS so it points to your folder in addition to the default ../MicroStation/mdlapps folder …

MS_MDLAPPS > G:/MyCompany/mdlapps/

When you use MicroStation key-in mdl load MyApp, MicroStation searches the folders listed in MS_MDLAPPS to find your DLL.

If your AddIn is implemented in a single DLL, then that's all you need do. However, if your AddIn is more complex, and uses other .NET assemblies (DLLs), then you need to do some more.

MS_ADDINPATH

If you want to separate your .NET AddIns from C++ applications, you can define configuration variable MS_ADDINPATH. Put your AddIn DLL in a folder defined by that variable. For example …

MS_ADDINPATH > G:/MyCompany/AddIns/

MicroStation can find your AddIn, and your .NET deliverables are separated both from MicroStation's own assemblies and from C++ apps in the MS_MDLAPPS folder.

MS_ADDIN_DEPENDENCYPATH

Your AddIn may reference other assemblies, whether those you have written or third-party libraries. At run-time, your AddIn must be able to find those other assemblies. MicroStation configuration variable MS_ADDIN_DEPENDENCYPATH provides help.

  1. Create a folder for your assemblies. For example …
    G:/MyCompany/assemblies
  2. Copy the dependent assemblies to that path
  3. Define configuration variable MS_ADDIN_DEPENDENCYPATH to point to that location …
    MS_ADDIN_DEPENDENCYPATH > G:/MyCompany/assemblies/

When you key-in mdl load MyApp, MicroStation helps your AddIn to find its dependent assemblies indicated by MS_ADDIN_DEPENDENCYPATH.

Questions

Post questions about .NET, the MstnPlatformNet and the DgnPlatformNet to the MicroStation Programming Forum.