简体   繁体   English

C#给出匿名错误

[英]C# gives anonymous error

while i am calling a method which is declared in another project. 而我正在调用另一个项目中声明的方法。 calling project and called project are presented in same solution. 调用项目和被调用项目在同一解决方案中提出。

I am getting a error window that says: 我收到一个错误窗口,显示:

Window Tile : Test.vshost.exe 视窗磁贴:Test.vshost.exe

Test.vshost.exe has encountered a problem and needs to close. Test.vshost.exe遇到问题,需要关闭。 we are sorry for the inconvenience. 我们对造成的不便很抱歉。

(I will make disappear the error window by clicking "Dont Send" button) (我将通过单击“不发送”按钮使错误窗口消失)

what is the reason for such this error. 发生此错误的原因是什么?

Note: I have included the refereed project in reference. 注意:我已将参考项目包括在参考中。

I used call a methode as follows 我用如下方法调用方法

ReconcileDBService.InsertRecordInT_AUDIT_Incident(keyCase);

Above methode declared as follows 上面的方法声明如下

public static void InsertRecordInT_AUDIT_Incident(string keyCase)

We can't really help you based on the data you provide... 根据您提供的数据,我们真的无法为您提供帮助...

Is your program using Win32 or COM interop ? 您的程序使用Win32还是COM互操作?

Try to add breakpoints and debug messages to pinpoint the problem. 尝试添加断点并调试消息以查明问题。 Once you know the exact location where the problem occurs, it will be easier to understand it. 一旦知道了问题发生的确切位置,就会更容易理解。

Turn off the "Visual Studio hosting process" and start your session again. 关闭“ Visual Studio托管过程”,然后重新开始会话。 Maybe you get some better or more information about an exception that is raised by your programm. 也许您可以获得有关程序引发的异常的更多或更多信息。

You can do this under the Project-Properties-->Debug-->Enable the Visual Studio hosting process (uncheck) 您可以在Project-Properties-> Debug-> Enable Visual Studio hosting process(uncheck)下执行此操作

Also you could check the build order of your projects. 您也可以检查项目的构建顺序。 It may be that the "Visual Studio hosting process" uses a diffrent assembly version than your programm expects. 可能是“ Visual Studio托管过程”使用的程序集版本与程序预期的有所不同。

Press Ctrl-Alt-E (Debug->Exceptions) and in the 'Break when an exception is:' selection, select everything. 按下Ctrl-Alt-E(Debug-> Exceptions),然后在“发生例外时中断:”选项中,选择所有内容。

Start a debug session with the application. 启动与应用程序的调试会话。

The debugger should now stop at the crash and you should be able to look what you are sending to the other project, and maybe solve your problem. 调试器现在应该在崩溃时停止,您应该能够查看要发送到另一个项目的内容,并且也许可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM