Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / September 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ptass - 28 Jul 2005 04:09 GMT
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.
Kevin Yu [MSFT] - 28 Jul 2005 11:09 GMT
Hi

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

Kevin Yu
Signature

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

Kevin Yu [MSFT] - 29 Jul 2005 07:47 GMT
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
Signature

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

ptass - 02 Aug 2005 00:59 GMT
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.

> Hi,
>
[quoted text clipped - 10 lines]
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
Kevin Yu [MSFT] - 02 Aug 2005 08:56 GMT
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.aspx?scid=fh;EN-US;OfferProPhone

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

Kevin Yu
Signature

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

ptass - 02 Aug 2005 23:49 GMT
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.

> Hi,
>
[quoted text clipped - 13 lines]
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
Kevin Yu [MSFT] - 03 Aug 2005 06:43 GMT
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
Signature

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

ptass - 03 Aug 2005 06:50 GMT
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.

> Hi,
>
[quoted text clipped - 6 lines]
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
Kevin Yu [MSFT] - 03 Aug 2005 07:03 GMT
You're welcome, please post to this thread after a day or two, and I will
follow it up.

Kevin Yu
Signature

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

Adrian Drumea - 15 Aug 2005 22:05 GMT
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?
ptass - 07 Sep 2005 01:50 GMT
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..ctor()
 at System.Configuration.ConfigurationSettings.EnsureConfigurationSystem()
 at System.Configuration.ConfigurationSettings.GetConfig(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.

> You're welcome, please post to this thread after a day or two, and I will
> follow it up.
[quoted text clipped - 3 lines]
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
Kevin Yu [MSFT] - 07 Sep 2005 06:45 GMT
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
Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.