- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
不知道有没有人遇到过这个问题。
我正在 VS 2012 中开发 C# Windows Phone 8 应用。
我最近遇到了 System.NotImplementedException 类型的未处理异常。
尽管我的所有代码都包含在 try/catch block 中,并且没有抛出 notimplementedexception 的方法 stub 。
在输出中是:
MyAppName.DLL 中发生类型为“System.NotImplementedException”的第一次机会异常
MyAppName.DLL 中发生“System.NotImplementedException”类型的异常,并且未在托管/ native 边界之前处理
如果我点击“继续”继续调试,我会在 VS 中收到一条错误消息弹出对话框:
System.Windows.ni.dll 中发生类型为“System.NotImplementedException”的未处理异常
如果我在这里选择“中断”,打开的堆栈跟踪显示“没有可用的源;调用堆栈仅包含外部代码。此线程停止时调用堆栈上只有外部代码帧。 等等等等。”
这是应用程序崩溃后突出显示的代码:
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 block 中捕获,但是当我修复它时,未捕获的 notimplementedexception 不再发生。
关于c# - 没有可用源的未处理的 System.NotImplementedException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14488867/
我发现有 2 个 NotImplementedException: sun.reflect.generics.reflectiveObjects.NotImplementedException org
我正在尝试将窗口位置保存为用户设置,以便在我的应用程序启动时恢复它。我使用这种类型的设计器添加了一个设置: using System.Configuration; namespace MyApp.Fr
我正在将以下代码添加到我的 WP7 应用程序中 App.xaml.cs 的构造函数中。 Resources["PhoneBackgroundBrush"] = new ImageBrush {
来自答案here我实现了我的类 NotImplementedException //exceptions.h namespace base { class NotImplementedExce
从逻辑上讲,所讨论的方法应该是抽象的,但它们位于继承自的父窗体上,如果将它们声明为抽象的,Visual Studio 将适用。 好的,我让尸体抛出一个NotImplementedException。
我有一个 A 类,一个继承的 B 类,以及另一个继承自 B 的 C 类。 在我的类 A 中,我只想定义一些方法而不是实现它,如果我将它声明为抽象的,我必须在我的继承类中实现它,而我不想要它。例如,我想
下面的代码不断抛出异常 throw new NotImplementedException() 并且我不确定如何修复它。我正在 try catch 下面存储过程返回的日期时间。 public void
我很确定以前版本的 Visual Studio Code Analysis 警告过 NotImplementedException 的使用,即包含此的任何成员 throw new NotImpleme
NET Framework 中的 C# 有一个方便的 NotImplementedException ,我可以从我打算稍后编写的代码部分中抛出。 Julia 中是否有类似的断言? 最佳答案 只需使用
锁定。这个问题及其答案是locked因为这个问题是题外话,但具有历史意义。它目前不接受新的答案或互动。 这真的,真的让我感到不安,所以我希望有人能给我一个合理的理由来解释为什么事情是这样。 未实现异常
如果我在 Reflector 中检查 FieldInfo.SetValueDirect它看起来如下: C#、.NET 4.0: [CLSCompliant(false)] public virtual
我正在研究使用 mocking 进行单元测试,我将添加到现有代码中。为此,我使用 HippoMocks .这涉及另一个类在我的模拟上调用一些方法(都是虚拟的)。我想避免过度指定所有这些,但是每当其他类
我已经试过了,但它似乎不起作用: Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException
我正在尝试实现 Facebook authentication sample ,当代码到达; WebAuthenticationResult webAuthenticationResult = aw
不知道有没有人遇到过这个问题。 我正在 VS 2012 中开发 C# Windows Phone 8 应用。 我最近遇到了 System.NotImplementedException 类型的未处理异
当我尝试使用 ant 构建我的项目时收到以下警告。我的 build.xml 是从 Eclipse 自动生成的: warning: NotImplementedException is internal
android平台有没有类似NotImplementedException的东西? 谢谢! 最佳答案 我认为你应该使用 UnsupportedOperationException . 关于androi
我有一个 Moq DbSet 直到最近一直在工作,但是自从上次更新依赖项以来,它一直在 IQueryable.Provider 上抛出 NotImplementedException 代码使用如下:
有什么方法可以序列化以下类的对象并以某种方式忽略抛出的异常吗? public class HardToSerialize { public string IAmNotTheProblem { ge
我正在使用 ASP.NET 3.5。我制作了一个表单,当用户单击一个按钮时,它应该加载另一个包含信息的页面。我没有加载而是收到此错误页面: The method or operation is not
我是一名优秀的程序员,十分优秀!