Nikon Capture NX 2 System.InvalidOperationException:对象当前正在其他地方使用

时间:2014-12-26 12:02:38

标签: .net windows windows-7 drawing

我拥有最新的Windows 7专业版。我一直在努力让我的Nikon Capture NX 2程序正常工作。发生了一些事情,无论我做什么,我得到相同的错误System.InvalidOperationException: Object is currently in use elsewhere.并且应用程序崩溃,这发生在鼠标悬停时,因为在打开应用程序后移动鼠标时错误弹出。堆栈跟踪揭示了导致问题的原因,也许在这个领域工作的人可以帮助我查明问题的根源?我已经尝试重新安装所有尼康软件,包括NEF Codec。我也尝试重新安装Microsoft.Net 4.5.x,但没有任何帮助,我总是得到这个错误。

我在下面包含完整的堆栈跟踪。

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: Object is currently in use elsewhere.
   at System.Drawing.Image.get_RawFormat()
   at System.Drawing.Graphics.IgnoreMetafileErrors(Image image, Int32& errorStatus)
   at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect)
   at nik.Windows.Forms.Form.Paint_closeButton(Boolean active)
   at nik.Windows.Forms.Form.OnWM_NcHittest(Message& msg)
   at nik.Windows.Forms.Form.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18444 built by: FX451RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Capture NX 2
    Assembly Version: 2.3.0.0
    Win32 Version: 2.4.7.3000
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/Capture%20NX%202.exe
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
NxController
    Assembly Version: 2.3.0.11420
    Win32 Version: 2.3.0.0
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/NxController.DLL
----------------------------------------
nik.GUIBase
    Assembly Version: 2.3.0.11326
    Win32 Version: 2.3.0.0
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/nik.GUIBase.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
nik.Base
    Assembly Version: 2.3.0.11308
    Win32 Version: 2.3.0.0
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/nik.Base.DLL
----------------------------------------
GUI_Common_Managed
    Assembly Version: 2.3.0.11419
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/GUI_Common_Managed.DLL
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
nik.GUIBase.Resources
    Assembly Version: 2.3.0.11325
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/nik.GUIBase.Resources.DLL
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
NxCursors
    Assembly Version: 2.3.0.11308
    Win32 Version: 2.3.0.0
    CodeBase: file:///C:/Program%20Files/Nikon/Capture%20NX%202/NxCursors.DLL
----------------------------------------

************** 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
enabled.

For example:

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

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.

1 个答案:

答案 0 :(得分:2)

快速搜索关键字&#34; system.drawing.image.get_rawformat invalidoperationexception&#34;揭示它可能是应用程序本身的一个线程问题。许多其他图像编辑软件因线程安全问题而崩溃。

您是否拥有该应用程序的源代码?如果是,请检查不同线程对图像的访问。如果您无法访问,则必须向尼康支持团队提出问题。给他们一个转储分析。

可行的方法是在具有单核的VM上运行应用程序。这可以减少并发访问的机会。但这不是保证。