vb.net 尝试运行通过反射调用的方法抛出的项目未捕获异常时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17146438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 13:56:16  来源:igfitidea点击:

Error while trying to run project uncaught exception thrown by method called through reflection

.netvb.netvisual-studio-2010

提问by SanjayJ

I have installed Visual studio 2010Ultimate verion but while running below simple windows form programme getting error....

我已经安装了Visual studio 2010Ultimate 版本,但是在简单的 Windows 窗体程序下运行时出现错误....

    MsgBox("Hello !")

    "error while trying to run project uncaught exception thrown by method called 
     through reflection"

anything wrong with installation ??

安装有什么问题吗??

Its Visula studio Exception not my programme exception...

它的 Visula 工作室异常不是我的程序异常......

I tried below but no luck..

我在下面尝试过但没有运气..

devenv /resetsettings

enter image description here

enter image description here

采纳答案by TheGroobster

Well if it is a problem with the installation then I would recommend reinstalling. :(

好吧,如果是安装问题,那么我建议重新安装。:(

Maybe try checking for updates and/or restarting your PC. If you still can't run your projects then I would recommend re-installing.

也许尝试检查更新和/或重新启动您的 PC。如果您仍然无法运行您的项目,那么我建议您重新安装。

回答by GalDude33

  1. Go to the project right click and select properties.
  2. Select 'Debug' tab on the left.
  3. Go to ‘Enable Debuggers' on the bottom
  4. Check ‘Enable Native code debugging' (or 'Enable unmanaged code debugging', depends on version) check box
  5. Run the project
  1. 转到项目右键单击并选择属性。
  2. 选择左侧的“调试”选项卡。
  3. 转到底部的“启用调试器”
  4. 选中“启用本机代码调试”(或“启用非托管代码调试”,取决于版本)复选框
  5. 运行项目

回答by Peratchi Selvam

Steps to your problem

Steps to your problem

I have uploaded the steps to your problem.

我已经上传了解决您问题的步骤。

As you see the image, check the native code debugging option and that's all.

如您所见,请检查本机代码调试选项,仅此而已。

Hope it helps.

希望能帮助到你。

I'm using Visual Studio 2017

我正在使用 Visual Studio 2017

回答by Jeremy Thompson

This is an annoying problem.

这是一个烦人的问题。

If you Enable native code Debuggingthen you cannot Edit-and-Continue:

如果启用本机代码调试,则无法编辑并继续:

Changes are not allowed when unmanaged debugging is enabled.

启用非托管调试时不允许更改。

I finally solved it by unticking Enable native code Debuggingand unticking Enable IntelliTrace

我最终通过取消勾选启用本机代码调试并取消勾选启用 IntelliTrace来解决它

enter image description here

enter image description here



Another time I got this error was when I upgraded a Solution from VS2010 to VS2017.

另一次出现此错误是在将解决方案从 VS2010 升级到 VS2017 时。

The problem was the Setup Project hadn't been set to the GUI (it was set to a Control Class Library):

问题是安装项目没有被设置为 GUI(它被设置为控制类库):

The solution is to right click the Project > Set as StartUp Project:

解决方案是右键单击项目>设置为启动项目:

enter image description here

enter image description here

回答by Sigex

I just had to restart vs. As right clicking the solution was giving the same error.

我只需要重新启动 vs. 因为右键单击解决方案给出了同样的错误。