• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

XML2BGL Unhandled Exception

I have recently made some edits to a model I wasn't pleased with because I saw areas where it could improve. I made these edits in 3DS Max and was able to successfully convert my .FBX to a .MDL. Now all I need to do is compile my .MDL with my .XML describing where I want to place it as a .BGL and load it into the sim... but I can't get the last step to work. I originally didn't care enough to look at the SDK documentation to see how the .XML is supposed to be formatted, and just formatted it myself, which resulted in the compiler throwing errors at me. I resolved these errors by correctly following the format... but now I simply get an unhandled exception.

It seems as if XML2BGL is trying to verify that the .BGL was properly compiled and just throws an exception. But I'm not sure what is causing it. Maybe somebody with more experience than me can assist?

The error:
************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'C:\Program Files (x86)\Airport Design Editor\Conversions\combined_scene_KSAN_APT_OBJ_OBJPALMS_JETWAYAPT.bgl'.
File name: 'C:\Program Files (x86)\Airport Design Editor\Conversions\combined_scene_KSAN_APT_OBJ_OBJPALMS_JETWAYAPT.bgl'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.Move(String sourceFileName, String destFileName)
   at Xml2Bgl.Xml2BglUtil.moveBgl(String xmlFilename, String compileTo)
   at Xml2Bgl.Xml2BglUtil.Compile(String compilerPath, String xmlFilename, String compileTo)
   at Xml2Bgl.Form1.onCompileP3DButtonClick(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at ComponentFactory.Krypton.Toolkit.KryptonButton.OnClick(EventArgs e)
   at ComponentFactory.Krypton.Toolkit.KryptonButton.OnButtonClick(Object sender, MouseEventArgs e)
   at ComponentFactory.Krypton.Toolkit.ButtonController.OnClick(MouseEventArgs e)
   at ComponentFactory.Krypton.Toolkit.ButtonController.MouseUp(Control c, Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewManager.MouseUp(MouseEventArgs e, Point rawPt)
   at ComponentFactory.Krypton.Toolkit.VisualControlBase.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at ComponentFactory.Krypton.Toolkit.VisualControlBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
    Assembly Version:
    Win32 Version: 2.0.50727.9035 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/Airport%20Design%20Editor/XML2BGL/Xml2Bgl.exe
    Assembly Version:
    Win32 Version: 2.0.50727.9031 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/
    Assembly Version:
    Win32 Version: 2.0.50727.9037 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/
    Assembly Version:
    Win32 Version: 2.0.50727.9031 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/Airport%20Design%20Editor/XML2BGL/ComponentFactory.Krypton.Toolkit.DLL
    Assembly Version: 2.0.2685.14972
    Win32 Version: 2.0.2685.14972
    CodeBase: file:///C:/Program%20Files%20(x86)/Airport%20Design%20Editor/XML2BGL/AMS.Profile.DLL
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/Airport%20Design%20Editor/XML2BGL/jmSdeDialogs.DLL
    Assembly Version:
    Win32 Version: 5.08.00
    CodeBase: file:///C:/Program%20Files%20(x86)/Airport%20Design%20Editor/XML2BGL/jmSDELib.DLL
    Assembly Version:
    Win32 Version: 2.0.50727.9031 (WinRelRS5.050727-9000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging

For example:

    <system.windows.forms jitDebugging="true" />

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

I have even tried taking a .BGL, producing a .MDL via BGL2XML, then without altering, attempt to compile with XML2BGL and will run into an unhandled exception. Because the last line of the BGL2XML output states "compiled using FSX compiler," I use the FSX compiler to attempt to create a .BGL again, but that produces an unhandled exception. In fact I have tried many iterations of BGLCOMP (FSX, P3Dv1, P3Dv3, P3dv4, P3Dv4.4) and they all produced this unhandled exception.
Last edited:

You may wish to edit the title and content of your opening post above, so that you do not confuse other forum participants about the fact that you are discussing BGL2XML and not XML2BGL (which is a distinct and separate FS utility that is for entirely different purposes of use).

Assuming that you have author permission to decompile and re-distribute their 3D model(s), or that this is for personal use only:

What I would recommend is that you use Arno's ModelConverterX (aka "MCX") to import 3D scenery objects in BGL and/or other intermediate 3D file formats.

Once imported, one can then export in various 3D model file formats that can be imported by 3DSMAX.

Beware: IIUC, animations in "Jetway" 3D models exported by MCX 'may' require an extended work-flow to restore and/or 'rig' them ...as they 'may' be lost during export when using something other than the proprietary P3D SDK ".X" file format to import into 3DSMAX. :alert:

I suggest that you instead take up this inquiry within the MCX forum: ;)


I'm not having an issue with BGL2XML. The application used is XML2BGL. If anything I am having issues with BGLCOMP, which is a FSX/Prepar3D executabled that is provided in the SDK. It says in the stack trace that the application that is crashing is XML2BGL... in fact this has nothing to do with ModelConveterX either?

I'm not sure you read my post...

Maybe you saw the first line in the error report and assumed I was using BGL2XML? Nonetheless your post will definitely confuse readers as it is entirely incorrect. I am not having issues with BGL2XML and the application that is experiencing an unhandled exception no matter what I try is XML2BGL.

While it is true this is a two-step process and potentially some errors in BGL2XML may be the root cause of the problem, I seriously doubt that as I have no trouble editing/viewing the .MDL produced by BGL2XML nor do I see any formatting errors in the .XML. I believe there is some issue with XML2BGL or BGLCOMP compatibility.
Last edited:
Oh wow. Scruffyduck, if you manage to find your way to this post I have found the solution. The error is simply in permissions. XML2BGL does not have the correct permissions to write to the folder that I have specified, being that it is in ProgramFiles. Redirecting the program to output the compiled .BGL to a folder that it has permissions, such as say, my documents, resolves the issue.

Now... if someone familiar with windows User Account Control could elaborate... how come despite me giving Users, Administrators, All Application Packages, and All Restricted Application Packages FULL ACCESS to the folder in which I am directing XML2BGL to write to, there is still a permissions issue? Running XML2BGL as an administrator does not resolve the issue. I have ensured that inherited parent folder permissions are not overwriting custom permissions for this folder.

I can write to this folder if I create my .BGL using BGLCOMP through command prompt launched as an administrator (documented in the Prepar3D SDK how to do so), and considering XML2BGL is literally just a GUI for BGLCOMP, I would think that launching XML2BGL as an administrator resolves this issue. But it doesn't! Nor does giving many groups full permission in the folder I want XML2BGL to create the .BGL in.