访问冲突异常C# [英] Access violation exception c#
问题描述
这是抛出异常的我的代码,今天它才随机开始,这里是照片:
This is my code that throws an exception, it just randomly started today here is the photo :
这是整个页面代码和错误异常:
Here is the whole page code and the error exception :
public frmWFDocumentDetail()
{
InitializeComponent();
NavigationInTransition navigateInTransition = new NavigationInTransition();
navigateInTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn };
navigateInTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn };
NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
navigateOutTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut };
navigateOutTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut };
TransitionService.SetNavigationInTransition(this, navigateInTransition);
TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
DataContext = App.ViewModel_WFDocumentDetailItems;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//**this is how you pass parameters through to a new page**//
string processID = "-1";
string processName = "";
NavigationContext.QueryString.TryGetValue("processID", out processID);
NavigationContext.QueryString.TryGetValue("processName", out processName);
App.ViewModel_WFDocumentHeaderItems.LoadData("johnny", processID);
App.ViewModel_WFDocumentDetailItems.LoadData("johnny");
}
以及访问冲突:
System.AccessViolationException:尝试读取或写入受保护的内存。这通常表明其他内存
已损坏。
我已经阅读了其中的一些内容有人说这是nvidia网络经理,有人说我必须设置一些设置(例如抑制JIT优化),如果不更改值,则忽略gpu内存...但是什么都行不通?
I have read up on it, some people say it is nvidia network manager, and some people say I must set some setting like Suppress JIT optimization , and ignore gpu memory if value isn't changed... but nothing works? Can anyone please please send me in the right direction?
根据要求,完整堆栈
推荐答案
我使用了taylorjohnl给我的设置 Debug-> Options and Settings-> Debugging-> General-> Enable Just My Code,然后错误转到了xaml这是一个语法错误,并且已解决它和应用程序又可以工作了:)所以对我而言,违规错误基本上是一个参考错误,希望这也可以对其他人有所帮助,也可以在Silverlight中使用表达式blend来在用户界面中调试xaml
i used the setting taylorjohnl gave me "Debug -> Options and Settings -> Debugging -> General -> Enable Just My Code",and then the error went right to the piece of xaml that was a syntax error, and boom fixed it and app works again :) so violation error for me was basically a reference error, hope this can help other people as well, also use expression blend in silverlight to debug xaml in the UI
这篇关于访问冲突异常C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!