473,405 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Error when starting Web Client in DEBUG

Running C# .NET 1.1

I'm experiencing a weird oddity.

We have a client app which access the webservice at
http://www.test.planningportal.gov.u.../messagerouter

If I start the client with no debugging it's fine.

But if I start the client with debuggin on, when it Invokes a method on
the webservice you get an exception saying "The underlying connection
was closed: An unexpected error occurred on a send."

I've searched online and all the results so far talk about how you need
to override the WebRequest method and stick a KeepAlive = false in
there.

protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);
request.KeepAlive = false;
return request;
}

I've tried this, even accounting for the fact that the webservice is
using SOAP. But still no joy.

I also found another variation on the concept shown below;

protected override WebRequest GetWebRequest(Uri uri)
{
WebRequest request = base.GetWebRequest(uri);

if (requestPropertyInfo == null)
{
System.Type sType = request.GetType();
requestPropertyInfo = sType.GetProperty("WebRequest");
}

if (requestPropertyInfo != null)
{
HttpWebRequest webRequest =
(HttpWebRequest)requestPropertyInfo.GetValue(reque st, null);
webRequest.KeepAlive = false;
}
return request;
}

But also this doesn't help. requestPropertyInfo ends up containing a
null and so the GetValue never gets called.

Does anyone have an idea?

Krs
Chris

Dec 8 '06 #1
1 4247
Figured out the solution to it myself.

When running in DEBUG, ASP.NET sticks a VsDebuggerCausalityData section
into the request.

This isn't always handled by the web service.

To turn off this section you need to add the following to your
applications CONFIG file.

<system.diagnostics>
<switches>
<!-- <add name="SwitchName" value="4"/ -->
<add name="Remote.Disable" value="1" />
</switches>
<trace autoflush="false" indentsize="4"/>
<!-- <assert assertuienabled="true" logfilename=".\TraceLog.txt"/>
-->
</system.diagnostics>
On Dec 8, 10:40 am, "bixbarton" <bixbar...@gmail.comwrote:
Running C# .NET 1.1

I'm experiencing a weird oddity.

We have a client app which access the webservice athttp://www.test.planningportal.gov.uk/soap/servlet/messagerouter

If I start the client with no debugging it's fine.

But if I start the client with debuggin on, when it Invokes a method on
the webservice you get an exception saying "The underlying connection
was closed: An unexpected error occurred on a send."

I've searched online and all the results so far talk about how you need
to override the WebRequest method and stick a KeepAlive = false in
there.

protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);
request.KeepAlive = false;
return request;
}

I've tried this, even accounting for the fact that the webservice is
using SOAP. But still no joy.

I also found another variation on the concept shown below;

protected override WebRequest GetWebRequest(Uri uri)
{
WebRequest request = base.GetWebRequest(uri);

if (requestPropertyInfo == null)
{
System.Type sType = request.GetType();
requestPropertyInfo = sType.GetProperty("WebRequest");
}

if (requestPropertyInfo != null)
{
HttpWebRequest webRequest =
(HttpWebRequest)requestPropertyInfo.GetValue(reque st, null);
webRequest.KeepAlive = false;
}
return request;
}

But also this doesn't help. requestPropertyInfo ends up containing a
null and so the GetValue never gets called.

Does anyone have an idea?

Krs
Chris
Dec 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gary Karasik | last post by:
Hi, One of my SBS 2K3 servers is giving the following errors when trying to run certain applications. Some Googling indicates that these are .Net Framework errors. I've tried reapplying .Net...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: frbn | last post by:
hi all, we currently experience an original problem on a production server with a postgresql 7.1.3 ( a bit old, I know :\ ) We just want to know if somebody experienced this problem: the...
2
by: ago | last post by:
I am trying to make the win32com HelloWorld server work with a VBA client but I get: Run-time error '-2147467259(80004005)': Automation error Unspecified error I googled for the error but...
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
0
by: palmem | last post by:
I am trying to write a simple FTP server in order to learn about sockets This is my first time trying sockets This code should take a connection on port 8110, dump it to a client "thread" (not...
1
by: Nathan Sokalski | last post by:
When I click after about 15 minutes on a page I wrote I recieve the following error: Server Error in '/' Application....
19
by: Kapps | last post by:
Hi, I'm having a problem with my program not being able to run on certain computers. They have the basics, such as the .Net Frameworks. Upon trying to run the program, it gives the error: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.