acgessler / open3mod

Open 3D Model Viewer - A quick and powerful 3D model viewer
www.open3mod.com
Other
1.11k stars 259 forks source link

Trying to open Options gives exception #50

Open mediadog opened 7 years ago

mediadog commented 7 years ago

This is with the 1.1 standalone zip package, although the About tab shows 1.0. Clicking on either the Gear icon or trying to open Options via the menu results in an exception. This is on Win7 x64 with GTX970, updated libs and drivers. Happens with no model loaded immediately after start, and with a model loaded.

EDIT: This does not happen with the windows installer version, which the About reports as 1.1. Wrong version in the standalone .zip file?

** Exception Text ** System.NullReferenceException: Object reference not set to an instance of an object. at CoreSettings.CoreSettings.get_ExitOnTabClosing() at open3mod.SettingsDialog.InitializeComponent() at open3mod.SettingsDialog..ctor() at open3mod.MainWindow.OnShowSettings(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.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 ** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

open3mod Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///N:/_Upload/open3mod_1_1_standalone/open3mod.exe

System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5491 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.8686 (QFE.050727-8600) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5495 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Core Assembly Version: 3.5.0.0 Win32 Version: 3.5.30729.5420 built by: Win7SP1 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll

OpenTK.GLControl Assembly Version: 1.0.0.0 Win32 Version: 1.0.278.44921 CodeBase: file:///N:/_Upload/open3mod_1_1_standalone/OpenTK.GLControl.DLL

OpenTK Assembly Version: 1.0.0.0 Win32 Version: 1.0.278.44921 CodeBase: file:///N:/_Upload/open3mod_1_1_standalone/OpenTK.DLL

System.DirectoryServices Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.DirectoryServices/2.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll

System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5494 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

v97kmyjp Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.8686 (QFE.050727-8600) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

elgonzo commented 7 years ago

This is a mistake in bundling the standalone package.

In the settings configuration of open3mod, the "ExitOnTabClosing" setting has its GenerateDefaultValueInCode attribute set to false. However, the standalone package does not include a config file, so the program fails to obtain and provide a value for the "ExitOnTabClosing" setting - hence the NullReferenceException...

Until the standalone package is fixed, do the following to get it working:

  1. Get the file "App.config" from the github repository (link) and place it in the same directory as open3mod.exe.
  2. Rename "App.config" to "open3mod.config".
  3. Run open3mod.
  4. Profit!

Side note: This does not make open3mod a truly portable application, as it still tries to write settings to the users profile directory...