[CONNECT .NET] Get Configuration Variable Value

A customer asked: "My problem is having a class that will read a MicroStation config variable."  An extended version of this answer is available.

DgnPlatformNet

The answer is straightforward, once you've (a) asked the right question, and (b) found the appropriate help document.  Look in the DgnPlatformNet help doc. to find the ConfigurationManager class. All its methods are static.  Here's an example...

string CfgVarName = "MS_DEF"; // Example
string cfgVarValue = ConfigurationManager.GetValue (CfgVarName);

MstnPlatformNet

There's also the Workspace Interface, which you'll find in the MstnPlatformNet help doc. That's a wrapper around the VBA (COM) functionality, and is best avoided in favour of the ConfigurationManager class mentioned above.

Unhelpful Documentation

This is yet another example of confusion created by the .NET documentation, which is scattered over several .chm files. Depending where you start, you get a different answer. The MstnPlatformNet doc doesn't mention the ConfigurationManager, and the DgnPlatformNet doc doesn't mention the Workspace Interface.