intermittent authentication dialogs popping up

H

hellerim

My program runs as a Windows service (on WinXP SP3) monitoring several
devices connected via serial or network ports. It writes out an XML file
periodically which summarizes the current state of the connected devices.
This file then is served by IIS (5.0) to several MMI instances running in a
browser (MSIE 7). These applications request the XML data file also
periodically, about once per second. Evidently there is concurrency possible
between IIS and the the Windows service. The latter writes the state
information to a temporary file. Once finished doing this, it deletes the
existing XML file requested by the MMI clients and moves the temporary file
to its place. This is implemented so to keep the time window where
concurrency may occur as small as possible. Anyway, access collisions do
happen. On the client side I receive HTTP server status 200, 40X, and 500
which is fine and can be handled well by the MMI code. However it bothers me
that there are intermittent authentication dialogs popping up which is
inacceptable (not only to my customer). Since the client is authorized by
Windows this behavior does not make any sense. I suppose that one of the
concurrency scenarios is handled the wrong way by IIS in that an Unauthorized
Access Error is incorrectly stated, probably when the temporary file is being
moved to its target location and IIS tries to open it. May be that this
incorrect interpretation resides deep down inside the Win32 file handling
routines. As a workaround I implemented an ASPX file which is requested by
the MMI code instead of the XML file. Here, some C# code loops until the XML
file can be opened or the loop counter exceeds some threshold value; in
either case, data is written to the response stream. It works fine for me: No
authentication dialog was seen any more in the MMI.

I had no time to check this in other environments.

I suspect this is a bug report but don't know where to post it. Since I
found a similar phenomenon when trying to access a serial port in .NET while
it was being used by another process (an UnauthorizedAccessException is
thrown), I posted as similar question in the .NET General area.
 
H

hellerim

To be more precise:

I think somewhere down the road an ERROR_ACCESS_DENIED is reported instead
of ERROR_SHARING_VIOLATION (see Windows.h). I don't know which .NET exception
corresponds to ERROR_SHARING_VIOLATION.
 
E

Evertjan.

=?Utf-8?B?aGVsbGVyaW0=?= wrote on 29 jan 2009 in
microsoft.public.inetserver.asp.general:
I think somewhere down the road an ERROR_ACCESS_DENIED is reported
instead of ERROR_SHARING_VIOLATION (see Windows.h). I don't know which
.NET exception corresponds to ERROR_SHARING_VIOLATION.

This is a classic asp group.

Dotnet questions should be asked in
<microsoft.public.dotnet.framework.aspnet>
 
H

hellerim

Hi,

thanks for the hint, but I think if you look at my first post you'll notice
that I'm describing IIS behavior which was not caused by (ASP).NET (only
remedied which could have been done in ASP as well); my second post mentions
a .NET exception only because the problem parallels one I found in the .NET
framework and is possibly caused by the same piece of Microsoft software.

Actually, I did post a related question in a .NET newsgroup, hoping that
somebody at Microsoft would take care of it.
 
B

Bob Barrows

So shouldn't you have posted to the iis group?
Hi,

thanks for the hint, but I think if you look at my first post you'll
notice that I'm describing IIS behavior which was not caused by
(ASP).NET (only remedied which could have been done in ASP as well);
my second post mentions a .NET exception only because the problem
parallels one I found in the .NET framework and is possibly caused by
the same piece of Microsoft software.

Actually, I did post a related question in a .NET newsgroup, hoping
that somebody at Microsoft would take care of it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top