名称“ $ exception”在当前上下文中不存在 [英] The name '$exception' does not exist in the current context

查看:767
本文介绍了名称“ $ exception”在当前上下文中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我正在调试工作中的应用程序。我继续在我的一个catch块中设置一个断点,以便更详细地检查异常。

Today I was debugging an application in my work. I proceeded to set a breakpoint in one of my catch blocks in order to inspect an exception with more detail.

查看详细信息模态窗口正常打开,但是没有向我显示异常的详细信息,而是引发了一个奇怪的错误,一个我从未得到的错误,也不知道这意味着什么:

The View Detail modal window opens normally, but instead of showing me the details of the exception, it is throwing a strange error, one I never got, nor I know what it means:

错误提示:


名称 $ exception在当前上下文中不存在

The name '$exception' does not exist in the current context

这令人沮丧,因为我在catch块范围内,所以我应该能够看到我的异常。

This is frustating because I am within the catch block scope, so I should be able to see my exception.

重新启动应用程序之后,我设法对其进行调试。这是(到目前为止)我唯一一次遇到此错误。

After restarting my application, I managed to debug it just fine. This was the only time (so far) I got this error.

有人知道它的含义吗,我该如何解决(而不必重新启动应用程序)?

Does anyone know what it means and how can I fix it (without having to restart application)?

注意:我正在使用 Visual Studio 2012 Premium 。版本 11.0.61030.00更新4

NOTE: I am using Visual Studio 2012 Premium. Version 11.0.61030.00 Update 4

推荐答案

尝试明确告诉编译器如何导入dll。例如:

Try explicitly to tell the compiler how to import the dll. Ex:

using System;
using System.Runtime.InteropServices;

namespace BitmapProcessingCs
{
    public static class NativeMethods
    {
        [DllImport("BitmapProcessingCpp.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern void GenerateBitmap(IntPtr src, int dimension);
    }
}

这篇关于名称“ $ exception”在当前上下文中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆