469,607 Members | 1,995 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,607 developers. It's quick & easy.

win2k3 sp1 causes System.Net.WebClient.OpenRead to throw WebExcept

Hi

I've installed win2k3 sp1 on a machine where an openRead on any given file
was previously working. After installation, I get a webException as follows...

..message "An exception occurred during a webclient request"
.._Hresult = "-2146233079"
.._COMPlusExceptionCode ="-532459699"

Sorry I don't have the whole error, but this seems to be the only pertinent
info it contained.

If I remove the service pack, the problem goes away.

The request doesn't show up in the IIS logs, nor is it seen by a http proxy
such as fiddler.

Is this something to do with the changed com+ security with sp1 ? and if so,
how would I turn this off ?

If there is a better place to post this question, then please let me know
where.

Thanks in advance for any help.

Nov 22 '05 #1
11 6835
Hi

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #2
Hi,

I would like to confirm if the Windows 2003 is working on the server or
client? Do you mean that the Service Pack 1 was applied to the server side,
so OpenRead from the client stopped working?

If so, is that reproed if you change to another server also with SP1
applied? It would be helpful if you can provide me with the whole call
stack here. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #3
Hi Kevin

Sorry for the delay in getting back to you.

I have win2k3 on both server and client.
I have two servers where i see the problem. One with SP1 installed, and one
without.
The problem seems to be with the sp1 on the client. If the client has sp1
installed then the OpenRead produces the error. If you then uninstall sp1 on
the client, the problem goes away.

Hope this helps.

Thanks for helping with this issue.

"Kevin Yu [MSFT]" wrote:
Hi,

I would like to confirm if the Windows 2003 is working on the server or
client? Do you mean that the Service Pack 1 was applied to the server side,
so OpenRead from the client stopped working?

If so, is that reproed if you change to another server also with SP1
applied? It would be helpful if you can provide me with the whole call
stack here. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #4
Hi,

Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services. You can contact Microsoft Product Support directly to
discuss additional support options you may have available, by contacting us

http://support.microsoft.com/default...;OfferProPhone

If this is a product issue, they will assist you free of charge. Thanks for
your understanding.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #5
Hi again.

I think before i take this further, i'll create a little test app that does
nothing but an OpenRead on a file, and see if that app gets the same error
when run on a client PC with win2k3 and sp1.

If it works as expected, then the problem must be caused by some additional
'thing' that my real world app is doing that the simple test app isn't doing.

I'll post the results here anyway, just for the record.

"Kevin Yu [MSFT]" wrote:
Hi,

Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services. You can contact Microsoft Product Support directly to
discuss additional support options you may have available, by contacting us

http://support.microsoft.com/default...;OfferProPhone

If this is a product issue, they will assist you free of charge. Thanks for
your understanding.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #6
Hi,

Yes, I agree with you. Please feel free to let me know, if your test code
works as expected. Then we can try to analyze the other parts of the code.
Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #7
OK, will do.

It may take me a day or two to get to it. :-(

I'll post the results here.

Thanks again for you help.
"Kevin Yu [MSFT]" wrote:
Hi,

Yes, I agree with you. Please feel free to let me know, if your test code
works as expected. Then we can try to analyze the other parts of the code.
Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #8
You're welcome, please post to this thread after a day or two, and I will
follow it up.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #9
Hello,

I'm writing a small mining application in c#, and it happens to me too. I
have XP SP2, with all the updates. WebClient throws an
ArgumentOutOfRangeException: non-negative number required and then complains
about parameter count in System.IO.FileStream.Write. It happens while using
WebClient.DownloadFile.

Any thoughts?
Nov 22 '05 #10
OK, I think I've gotten to the bottom of this issue.

I building myself a little test application.

using System;
using System.Net;
using System.IO;
namespace OpenReadTestApp
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
System.Net.WebClient webClient = new System.Net.WebClient();
string fullName = "http://10.2.5.210/Components/Config.Default.Xml";
Console.WriteLine( "fetching stream for : "+fullName);
Stream s = webClient.OpenRead(fullName);
Console.WriteLine( "OK" );
Console.ReadLine();

}
catch( Exception e )
{
Console.WriteLine( e );
Console.ReadLine();
}
}
}
}
This works fine when run from on a win2k3 client ( launching the app via
href ) with win2k3 sp1 or not, which i wasn't expecting.

My app was still throwing the following error, which suggested a problem
around configuration settings.

System.Net.WebException: An Exception occurred during a WebClient request.
--> System.NullReferenceException : Object reference not set to an instance
of an object.
at System.Configuration.DefaultConfigurationSystem..c tor()
at System.Configuration.ConfigurationSettings.EnsureC onfigurationSystem()
at System.Configuration.ConfigurationSettings.GetConf ig(Sring sectionName)
at System.Net.WebRequest.get_PrefixList()
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Net.WebRequest.Create(Uri requestUri)
at System.Net.WebClient.Openead(String address)
--- End of inner exception stack trace ---
at System.Net.WebClient.OpenRead(String address)
at Softix.Platform.Utils.Config.OpenRelativeFileName( String fileName)

Turns out, due to some problem earlier in development, we'd stopped using
the app config file, and had hit some problem with win2k boxes,
whereby we were getting an error with some service pack combinations if the
app.config file wasn't present.

The workaround had been to add the following line early in the application
startup.
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "");

We'd subsequently started to use the app.config file, and without noticeable
problem, even though we'd left the above line in the code.

Seems a win2k3 client, with sp1, throws an error when doing an open read if
you have set the app_config_file to "", whether you have an app.config file
present or not.

Without sp1, the app carries on regardless, without any noticeable impact,
though i wonder if its actually reading the app.config file correctly.
Note, we are only using the app.config file to set the codebase so that IIS
doesn't do excessive probing for .exe and app.config file in various
locations, which is a whole different story. I'll have to do more testing to
ascertain if things are working properly for all circumstances, but i think
that they will be now.

Anyway, problem solved. If i remove
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", ""); the application works
correctly from any win2k3 client
whether it has sp1 or not.

Thanks for your time.

"Kevin Yu [MSFT]" wrote:
You're welcome, please post to this thread after a day or two, and I will
follow it up.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #11
It was nice to hear that you have had the problem resolved.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Seymen Ertas | last post: by
reply views Thread by Helen Abell | last post: by
reply views Thread by JohnBatte | last post: by
1 post views Thread by Tim Mulholland | last post: by
reply views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.