MSDebug File



 
Product(s):All MicroStation-based product
 Version(s):All
 Environment: N\A
 Area: Administration
 Subarea: N\A

The -debug command line parameter creates the msdebug.txt file in a 'Temp' folder. The 'Temp' folder location used varies by version of both application and Windows.

For CONNECT Edition the default location is the user's own 'Temp' folder defined by variable _USTN_LocalUserTempPath:

C:\Users\<username>\AppData\Local\Temp\Bentley\MicroStation\10.0.*

Once created an msdebug.txt file can be loaded into Bentley Configuration Explorer for review, this offers a more user friendly way to read the content.

Bentley Configuration Explorer is a powerful analysis and editing tool for configuration management and maintenance.

Create msdebug.txt:

For a quick one-off use

Press: Windows key + R

In the Run dialog  type (or paste):

"C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\microstation.exe" -debug

The file will be saved to C:\Users\<username>\AppData\Local\Temp\Bentley\MicroStation\10.0.0\msdebug.txt and will open in Notepad (the application associated with the .txt file extension):

OR

Open a Command Prompt (Press the windows key and type 'cmd').

At the prompt type (or paste):

"C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\microstation.exe" -debug

The file will be saved to C:\Users\<username>\AppData\Local\Temp\Bentley\MicroStation\10.0.0\msdebug.txt and will open in Notepad (the application associated with the .txt file extension):

For repeated use modify MicroStation's shortcut icon:

Navigate to the shortcut (for Windows 10 this will be "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MicroStation CONNECT Edition\MicroStation CONNECT Edition\MicroStation CONNECT Edition.lnk") and right-click > Properties.

On the Shortcut tab: add <space>-debug to the end of the MicroStation shortcut (in the Target: field)

On the General tab: rename the shortcut

For other applications

For applications based on MicroStation the steps are similar, the paths used will be vary according to the application, e.g. for AECOsim Building Designer the debug command will be:

"C:\Program Files\Bentley\AECOsim CONNECT Edition\AECOsimBuildingDesigner\AECOsimBuildingDesigner.exe" -debug

Debug switches

The contents of msdebug.txt can be controlled by the addition of a switch at the end of the debug command when used in all three of the situations above.

-e.g.:

"C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\microstation.exe" -debug=n

where 'n' is a value from 1 to 5, with the following results:
Value of nType of report
1Brief report that shows the current string value of each Configuration Variable as it is processed.
2In addition, shows the current translation of each Configuration Variable as it is processed.
3In addition, shows conditional break information by displaying the line number when each if preprocessor directive is processed.
4In addition, prints final translations of all Configuration Variables at the end of the report. This is the default setting.
5In addition, shows final values of all Configuration Variables at each level (System, Application, Organization, WorkSpace, WorkSet, Role, User).

Msdebug.txt Contents

There are two sections in the MSDebug.txt file. The first section contains a list of all the configuration files that are processed and what configuration variables were set in each file. Each configuration file that is processed has a starting point and an ending point identified as follows:

Processing macro file [C:\Bentley\Program\MicroStation\config\mslocal.cfg]
.
.
.
End of macro file [C:\Bentley\Program\MicroStation\config\mslocal.cfg]

Located in-between these two lines are all variables and their settings that get loaded from that particular configuration file:

Examples:

Processing macro file [d:\Bentley\Program\MicroStation\config\system\mslocal.cfg]
(system): MS_SPELLINGLANGUAGE=AmericanEnglish [AmericanEnglish]
(system): MS_HELPLOAD_LANGUAGE=en [en]
End of macro file [d:\Bentley\Program\MicroStation\config\system\mslocal.cfg]

Processing macro file [d:\Bentley\Program\MicroStation\config\appl\qvisgl.cfg]
(appl): MS_GRAPHICSACCELERATOR=qvisgl [qvisgl]
End of macro file [d:\BentleyProgram\MicroStation\config\appl\qvisgl.cfg]

It also indicates at what level the variable has been set (e.g. system, appl, user, site, project, or predefined).

The last section of the MSDebug.txt file is the Configuration Variable Summary. Here you will find the following:

A listing of all configuration variables
At what level each variable was set
The full path to the location of the files
Whether or not the variable is locked or unlocked

The msdebug file can help you troubleshoot things like processor exception errors by helping you find where specific files are located. The steps for this procedure are listed below:

  1. Create the msdebug.txt file
  2. Open it in an ASCII text editor (like NotePad).
  3. Search for the following variables:

MS_USERPREF (this will tell you where your user preference file is located)
MS_INITAPPS (this will tell you if any other programs are being initiated during startup)
MS_SYMBRSRC (this will point you to the location where all the MicroStation resource files are located)
MS_DGNAPPS (this will tell you what other programs are being launched with MicroStation)
MS_DGNMACROS (this will tell you what macros are being launched with MicroStation)
_USTN_UIPATH (this will tell you the location of any *.m0* files)

Be sure to search for all instances of the variables.


Information for Pre-CONNECT Versions

For MicroStation V8 XM Edition and later, the file is created in the directory specified by the MicroStation configuration variable MS_TMP.

MicroStation V8i:     C:\Documents and Settings\username\Local settings\Temp
MicroStation V8 XM Edition :     C:\Documents and Settings\username\Local settings\Temp

For V8 2004 and earlier, it is created in the folder where "Start in:" is set to (in MicroStation's program icon Properties dialog), which is typically the same folder where the ustation.exe file is located.

MicroStation V8.0 through V8 2004 Edition:     C:\Program Files\Bentley\Program\MicroStation
MicroStation/J:     C:\Bentley\Program\Microstation
MicroStation 95/SE:     C:\win32app\ustation

NOTES:  

Create msdebug.txt:

1. From a DOS prompt in a Command Shell Window

Go to a Command prompt and change to the directory where ustation.exe is located and type the following command: ustation.exe -debug

Examples:
For MicroStation V8i: C:\Program Files\Bentley\MicroStation\ustation.exe -debug*
For MicroStation V8 XM: C:\Program Files\Bentley\MicroStation\ustation.exe -debug*
For MicroStation V8: c:\Program Files\Bentley\Program\Microstation\ustation.exe -debug
For MicroStation/J: c:\bentley\program\microstation\ustation.exe -debug
For MicroStation 95\SE: c:\win32app\ustation\ustation.exe -debug

2. From MicroStation's shortcut icon

Append <space>-debug to the end of the MicroStation shortcut (in the Target: field).

Examples:
For MicroStation V8i: C:\Program Files\Bentley\MicroStation\ustation.exe -debug*
For MicroStation V8: Target: c:\Program Files\Bentley\Program\Microstation\ustation.exe -debug*
For MicroStation/J: Target: c:\bentley\program\microstation\ustation.exe -debug
For MicroStation 95\SE: Target: c:\win32app\ustation\ustation.exe -debug

Save the changes and then double click the icon.
NOTE: Remember to remove this change after creating the MSDebug.txt file.

3. From Windows "Run"

Choose Start > Run
Type the path to the ustation.exe file
NOTE: If the path contains spaces, you must use quotes around the path

Examples:
For MicroStation V8i: C:\Program Files\Bentley\MicroStation\ustation.exe -debug*
For MicroStation V8: "c:\Program Files\Bentley\Program\Microstation\ustation.exe" -debug*
For MicroStation/J: c:\Bentley\Program\MicroStation\Ustation.exe -debug
For MicroStation 95\SE: c:\win32app\ustation\ustation.exe -debug
Click OK.

*NOTE: The location for ustation.exe for MicroStation V8i will be found at:
C:\Program Files (x86)\Bentley\Program\MicroStation\ on 64-bit operating systems such as Vista and Windows 7.

You should get a DOS window that says "Debugging output saved to [msdebug.txt]".
Hit the Enter key
Locate the msdebug.txt file in the appropriate directory.

See Also

To create a msdebug file in the MicroStation CONNECT Edition, see:
https://communities.bentley.com/products/microstation/w/microstation__wiki/23926.export-configuration-variable-values-to-a-text-file

How to setup MicroStation logging with ProjectWise Explorer Integration

External Links

Bentley LEARN Server

Other language sources

Deutsch