问题描述
我有一个使用C#Web服务的Win32混合模式MFC应用程序。所有应用程序都是用.Net 1.1(Visual Studio 2003)编写的,虽然我在同一台PC上安装了框架2.0和Visual Studio 2005.
我目前使用的代码是我们之前版本的结果,它是工作正常,直到前一段时间。但是自从我重新开始处理该代码以来,只要执行Web Service方法,应用程序就会挂起。所有的Web服务方法都在一个单独的线程中执行,我注意到如果我只是运行线程体(没有威胁),它工作正常(但我不能这样做)。此外,如果应用程序从调试器外部运行,一切正常,这清楚地表明这是一个调试器问题。
如果我按下调试工具栏按钮中的暂停按钮并转到调用堆栈窗口,这就是我所看到的:
------------------------------- ----------- system.web.services.dll!System.Web.Services.UnsafeNativeMethods.RegisterNotifySource(System.Web.Services.Interop.INotifyConnection2 connection = {System .__ ComObject},System.Web.Services.Interop.INotifySource2 source = {System.Web.Services.Protocols.RemoteDebugger})+ 0x1e bytes
system.web.services.dll!System.Web.Services.Protocols .RemoteDebugger.get_NotifySink()+ 0x2d bytes
system.web.services.dll!System.Web.Services.Protocols.RemoteDebugger.NotifyClientCallOut(System.Net.WebRequest request = {System.Net.HttpWebRequest})+ 0x3d bytes
system.web.services.dll!System.Web.Services.Protocols.WebClient Protocol.GetWebRequest(System.Uri uri = {System.Uri})+ 0xdd bytes
system.web.services.dll!System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(System.Uri uri = {System.Uri })+ 0x22字节
system.web.services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(System.Uri uri = {System.Uri})+ 0x1b bytes
system.web.services .dll!System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(string methodName =" AskChallenge",System.Object [] parameters = {Length = 0})+ 0x75 bytes
> Medigraf.exe!SQLService.Service1.AskChallenge()第429行+ 0x1d字节C ++
Medigraf.exe!CSQLServiceProxy :: _ ThreadConnect(void * lparam = 0x068a2918)第717行+ 0x20字节C ++
--- ---------------------------------------
Call堆栈中的第一行让我相信调试器正在尝试调试Web服务(位于远程PC中)。我没有兴趣调试Web服务,至少不是来自调试器的同一个实例。
有人可以帮我这个吗?我不知道接下来要做什么来解决它。
Pena
Hi,
I have a Win32 Mixed mode MFC application which uses C# web services. All applications are written in .Net 1.1 (Visual Studio 2003) although I have framework 2.0 and Visual Studio 2005 installed on the same PC.
The code I'm currently using is result of our previous version and it was working fine until some time ago. But ever since I restarted working on that code, the application simply hangs up whenever a Web Service method is executed. All web service methods are executed in a separate thread and I've noticed that if I simply run the thread body (without the threat), it works fine (but I cannot do that). Moreover, everything works fine if the application is run from outside the debugger, which makes it clear that this is a debugger issue.
If I press the pause button in the debug toolbar button and goto to the call stack window, this is what I see:
------------------------------------------ system.web.services.dll!System.Web.Services.UnsafeNativeMethods.RegisterNotifySource(System.Web.Services.Interop.INotifyConnection2 connection = {System.__ComObject}, System.Web.Services.Interop.INotifySource2 source = {System.Web.Services.Protocols.RemoteDebugger}) + 0x1e bytes
system.web.services.dll!System.Web.Services.Protocols.RemoteDebugger.get_NotifySink() + 0x2d bytes
system.web.services.dll!System.Web.Services.Protocols.RemoteDebugger.NotifyClientCallOut(System.Net.WebRequest request = {System.Net.HttpWebRequest}) + 0x3d bytes
system.web.services.dll!System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(System.Uri uri = {System.Uri}) + 0xdd bytes
system.web.services.dll!System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(System.Uri uri = {System.Uri}) + 0x22 bytes
system.web.services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(System.Uri uri = {System.Uri}) + 0x1b bytes
system.web.services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(string methodName = "AskChallenge", System.Object[] parameters = {Length=0}) + 0x75 bytes
> Medigraf.exe!SQLService.Service1.AskChallenge() Line 429 + 0x1d bytes C++
Medigraf.exe!CSQLServiceProxy::_ThreadConnect(void* lparam = 0x068a2918) Line 717 + 0x20 bytes C++
------------------------------------------
The first lines in the Call stack lead me to believe that the debugger is trying to debug the web service (which is in a remote PC). I have no interest on debugging the web service, at least not from the same instance of the debugger.
Can somebody please help me with this? I have no idea of what to do next to fix it.
Pena
推荐答案
这篇关于在调试器中执行webmethod时应用程序挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!