C# 没有可用源的未处理System.NotImplementedException?
我不确定是否有人遇到过这个问题 我正在VS 2012中开发一款C#Windows Phone 8应用程序 我最近收到System.NotImplementedException类型的未处理异常 尽管我的所有代码都在try/catch块中,并且没有抛出notimplementedexception的方法存根,但这是事实 在输出中: MyAppName.DLL中首次出现“System.NotImplementedException”类型的异常 MyAppName.DLL中发生“System.NotImplementedException”类型的异常,在托管/本机边界之前未处理该异常 如果我点击“继续”继续调试,我会在VS: System.Windows.ni.dll中发生类型为“System.NotImplementedException”的未处理异常 如果我在这里选择“Break”,打开的堆栈跟踪显示“无可用源代码;调用堆栈仅包含外部代码。此线程在调用堆栈上仅使用外部代码帧停止。等等。” 这是应用程序崩溃后突出显示的代码:C# 没有可用源的未处理System.NotImplementedException?,c#,visual-studio-2012,windows-phone-8,notimplementedexception,C#,Visual Studio 2012,Windows Phone 8,Notimplementedexception,我不确定是否有人遇到过这个问题 我正在VS 2012中开发一款C#Windows Phone 8应用程序 我最近收到System.NotImplementedException类型的未处理异常 尽管我的所有代码都在try/catch块中,并且没有抛出notimplementedexception的方法存根,但这是事实 在输出中: MyAppName.DLL中首次出现“System.NotImplementedException”类型的异常 MyAppName.DLL中发生“System.NotI
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
Debugger.Break();
}
}
编辑:这是堆栈:
Call stack with external code
System.Windows.ni.dll!MS.Internal.JoltHelper.OnUnhandledException(object sender, System.UnhandledExceptionEventArgs args)
mscorlib.ni.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ThrowAsync.AnonymousMethod_1(object state)
mscorlib.ni.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state)
mscorlib.ni.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.ni.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.ni.dll!System.Threading.QueueUserWorkItemCallback..System.Threading.|ThreadPoolWorkItem.ExecuteWorkItem()
mscorlib.ni.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()
mscorlib.ni.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Native to Managed Transition]
对于有类似问题的人,我找到了明显的原因 我为Surface移植了一些涉及Win8应用程序文件输入/输出的代码,其中一行忽略了更改
StorageFolder storageFolder = KnownFolders.DocumentsLibrary;
与其相应的
IsolatedStorageFile storageFolder = IsolatedStorageFile.GetUserStoreForApplication();
不知何故,这在try/catch块中没有被捕获,但当我修复它时,未捕获的notimplementedexception不再发生。您有任何引用的自定义库吗?SQLite/SQLiteAsync计数吗?嘿@Danny,对不起,我没有早点响应。很高兴你弄明白了。嘿,一个简单的问题。但是WP8中有一个创建存储文件夹的选项,对吗?当我试图创建一个文件夹时,我遇到了一个类似的异常。为什么要将存储文件夹更改为IsolatedStorageFile?