Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
MicroStation Wiki MSDebug File
    • Sign In

    • +MicroStation Wiki
    • -Administration Wiki
      • Adding "Display Style List" to custom Toolbox
      • +Administration - Legacy Content
      • Answers for the Levelly Challenged
      • Batch Convert Utility
      • Bentley Tablet Driver And CalComp DrawingBoard
      • Bypassing Port Problems In Windows 2000 And Windows XP
      • Cannot find survey ft option in Design File Settings > Units
      • Configuration Variable Processing
      • Configuration Variables In MicroStation V8
      • Creating Tool Icons
      • Customize item missing from Workspace menu
      • Customize Toolbox - Tool opens new Toolbox
      • DGN file association in Windows 10 (MicroStation Does not appear in list)
      • DGN Index Service - How to set up
      • DGN Index Service Setup ended prematurely – error 1603
      • Enabling Lock Pages In Memory Under Windows 7 and Vista
      • Error - Cannot locate a default SHX font. Please install msdefault.shx
      • Error - Unable to load/create dialog item of type 'IconCmd', id
      • Error 1402. Could not open key
      • Error 1603 during install
      • Error 1610 during install
      • Error 1625 during install
      • Error message when starting MicroStation, "ucf not found"
      • File Associations
      • File Correction and Audit Tools
      • Getting Started With The Standards Checker
      • Haven't Upgraded To The MicroStation V8 Format Yet
      • How to Back Up and Restore User Preferences
      • How to Copy User Preferences and User Configuration Files to a new or different PC
      • How to quickly add a number of folders to Microstation's reference files search paths
      • How To Reset User Preferences and Delete MicroStation's Temporary Files
      • Installing MicroStation V8 XM Edition silently
      • Installing MicroStation V8i (SELECTseries 3) Without an Internet Connection
      • Installing MicroStation V8i silently
      • Is there any easy way to determine key-ins or variable names?
      • Key-in command to define different pattern setting options
      • Keyin to encrypt dgn files
      • MicroStation - Creating a Custom Colour Book
      • MicroStation Command Line Options And Switches
      • MicroStation Failed to Start
      • MicroStation file access issues with shared network drives
      • MicroStation Memory Management
      • +MicroStation V8i Variables
      • MicroStation Virtualization FAQ
      • Migrating Customizations to MS V8i
      • Migrating Customizations to MS XM
      • MSDebug File
      • MSXML Issue
      • Networking Workspaces
      • Networking Workspaces the easy way
      • New Variables
      • Overriding And Resynchronizing Level Attributes
      • Restore MicroStation to Factory defaults
      • Script error during MicroStation Installation
      • Serving Up Efficiency
      • Sharing Your Workspace
      • System Fault 5 MDL abort in DITEMS
      • The Power Of The Workspace
      • To also see hidden Config-Variables
      • Unable to connect to an Oracle Database
      • Understanding File Locations And Reference Attachments In MicroStation
      • Updating To MicroStation V8 Format
      • Upgrading From 08.09.02.52 To 08.09.02.77
      • Windows Explorer ProgramData folder
      • Workmodes DGN/DWG
      • Workspaces on the Network
    • +Annotations Wiki
    • +Bentley View Wiki
    • +MicroStation PowerDraft
    • +Programming Wiki
    • +Visualization Wiki

     
     Questions about this article, topic, or product? Click here. 

    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 n Type of report
    1 Brief report that shows the current string value of each Configuration Variable as it is processed.
    2 In addition, shows the current translation of each Configuration Variable as it is processed.
    3 In addition, shows conditional break information by displaying the line number when each if preprocessor directive is processed.
    4 In addition, prints final translations of all Configuration Variables at the end of the report. This is the default setting.
    5 In 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:  

    • These locations are for Windows XP. For Windows Vista, Windows 7, and Windows 8.x, refer to the location specified by the MicroStation configuration variable MS_TMP. 
    • The default path is commonly %temp%\Bentley\.... or $(MS_TMP)msdebug.txt, which defaults (via _USTN_LocalUserTempPath) to the environment %temp% + the version specific additions. On standard Windows installations %temp% defaults to c:\users\<username>\AppData\Local\Temp, so the whole path would be C:\Users\username\AppData\Local\Temp\Bentley\MicroStation\8.21.3\msdebug.txt. 
    • To eliminate having to search for the resulting msdebug.txt, use the command line parameter -debugfileopen (introduced in MicroStation V8i SELECTseries 3) instead of -debug (see below for explanation on the latter).

    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

    • CONNECT Edition
    • MicroStation
    • PRTUtilities
    • MSDebug
    • Configuration Variables
    • Configuration
    • Share
    • History
    • More
    • Cancel
    • Dan Koval Created by Bentley Colleague Dan Koval
    • When: Fri, Sep 6 2013 1:50 PM
    • Leonard Jones Last revision by Bentley Colleague Leonard Jones
    • When: Wed, Apr 14 2021 2:39 PM
    • Revisions: 14
    • Comments: 3
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies