Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net {“试图读取或写入受保护的内存。这通常表示其他内存已损坏。”_.net_Winforms_Unity Container - Fatal编程技术网

.net {“试图读取或写入受保护的内存。这通常表示其他内存已损坏。”

.net {“试图读取或写入受保护的内存。这通常表示其他内存已损坏。”,.net,winforms,unity-container,.net,Winforms,Unity Container,我围绕Unity构建了一个简单的应用程序框架。也就是说,表单和用户控件被描述为xml并动态构建。我有一个表单,其中包含一个组合框,当它关闭时会导致下面详细说明的错误。如果用ComboBox代替ListBox控件,则不会出现此问题 有人在谷歌上搜索了一些关于我没有安装补丁的报道 {”试图读取或写入受保护的数据 记忆。这通常是一个迹象 另一个内存已损坏。“} 堆栈跟踪: at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(Int

我围绕Unity构建了一个简单的应用程序框架。也就是说,表单和用户控件被描述为xml并动态构建。我有一个表单,其中包含一个组合框,当它关闭时会导致下面详细说明的错误。如果用ComboBox代替ListBox控件,则不会出现此问题

有人在谷歌上搜索了一些关于我没有安装补丁的报道

{”试图读取或写入受保护的数据 记忆。这通常是一个迹象 另一个内存已损坏。“}

堆栈跟踪:

   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   at System.Windows.Forms.Control.DefWndProc(Message& m)
   at System.Windows.Forms.Control.WmCommand(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at DPOSSQL.Program.Main() in C:\VSSData\DPOS SQL\DPOS SQL\Program.cs:line 46
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

当控件使用XP/Vista样式,然后在旧版本的Windows上运行时,我见过这种情况

我在系统上安装新字体时看到了这个错误。您最近是否安装了新字体或安装了新字体的程序


其他.net程序是否正常运行?如果没有,最好是重新安装.NET framework。

当我的.NET应用程序运行时,在Windows XP上尝试将系统显示切换为“超大字体”时,请点击此按钮

这可能与错误的字体或类似字体有关

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source: System.Windows.Forms
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)