Access Denied trying to do quick editing

  • Thread starter Thread starter Ron Weldy
  • Start date Start date
R

Ron Weldy

I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net
files. On my workstation I have a share set up to the folder where the web
files reside. I am just doing quick and dirty asp editing (like I used to be
able to do with 2K/IIS5) where I use VS.NET, open an asp file, make changes,
save and refresh my browser.

Problem is that I get an Access is Denied error when I try to save the file
and then the file gets wiped on the server. If I reopen it, only half of it
is there. So obviously, it's getting locked and cached. This looks like a
problem from IIS 4 days
(http://support.microsoft.com/default.aspx?scid=kb;en-us;191742) but as I
mentioned I'm using IIS 6.0 now and VS.NET to boot (it's such a pain
changing and getting up to speed).

What should I do? How can I disable caching on my test server, or should I
be practicing a new method of working?

- Ron
 
This is really weird. I see all these claims of people saying that "when I
update content on IIS6 it either continues to serve stale content or get
access denied", and I totally have been unable to reproduce any of them.

I mean, I go and install WS03 and then IIS6, publish my ASP/ASPX file to
inetpub\wwwroot, make a few requests to it to see it and get it cached --
and when I open that ASP file up with notepad, make some changes, save it --
I *immediately* see the changes. Every time. No access denied, no stale
entries, no problems at all. I even check to make sure my static and dynamic
files are truly cached in memory/kernel-mode and then make the edits, and
they continue to immediately work for me (I see the cache miss/flush as
well). Same thing happens when I make the vdir go over a UNC share -- still
works. Pass-thru auth also works.

So, I really have no suggestions other than to ask for all the details of
your configuration and problem-reproduction steps (more details the better).
I've really gone through and tried out all the settings and see that they
work as advertised from the very start. No fuss.

So, I'm really anxious to get a good setup/example that predictably fails
and that I can reproduce it as well...

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
I have a test server runinng 2003/IIS 6 with a mixture of asp and asp.net
files. On my workstation I have a share set up to the folder where the web
files reside. I am just doing quick and dirty asp editing (like I used to be
able to do with 2K/IIS5) where I use VS.NET, open an asp file, make changes,
save and refresh my browser.

Problem is that I get an Access is Denied error when I try to save the file
and then the file gets wiped on the server. If I reopen it, only half of it
is there. So obviously, it's getting locked and cached. This looks like a
problem from IIS 4 days
(http://support.microsoft.com/default.aspx?scid=kb;en-us;191742) but as I
mentioned I'm using IIS 6.0 now and VS.NET to boot (it's such a pain
changing and getting up to speed).

What should I do? How can I disable caching on my test server, or should I
be practicing a new method of working?

- Ron
 
Hi David,

Thanks for the reply. I was starting to lose hope...

Just today I was editing an asp file and it worked fine the first few times
and bang! Access Denied. The funny thing is that I then save as to a
different location and can copy it into the folder and it works. Needless to
say, it's really a pain.

As far as environment, I have a WS03 server I use for remote development.
Now it does have active directory installed and it is a domain controller so
I am not sure if that could be part of the problem. I have been tempted to
rebuild the server without active directory as I cannot get ASP.NET
debugging to work on it as well. But I am more than willing to work with you
to figure out the cause of the problem. And I can reliably reproduce it.

If you want to email me directly (that's my real address up here) I will
gladly send you anything you want as far as how my configuration is set up.
It could be tedious doing this on the newsgroup. I also live in Bothell, so
if you're on campus I'm close.

- Ron
 
Hi David,

You know, I'm not sure if this maybe part of it or not but... my server
configuration is a little out of the ordinary in that the server OS is not
installed on drive C:. For some reason, when I installed WS03 on this box,
it decided to install itself on Drive E:. In fact, I don't even have a C:
drive on the box at all. I am not sure if this has anything to do with the
problem but it wouldn't surprise me.
 
Okay, so check this out. I started using VS 6.0 and I have not had any
problems. It must be VS.NET that has the bug! Try using VS.NET and see what
happens. I just use file -> open with no project. I'm using build hmmm...
okay I just went to help about and I got a blank window that says 'Key
Expired'. What the? I have a fully registered and activated version! Hmmm...
that window came up twice. Must be some plug-in or something. Anyway the dev
environment is 7.1.3088.
 
You can validate by using a tool like Process Explorer
(www.sysinternals.com) to see what process has an open handle on the file
you get "Access Denied" on (open ProcExp, Ctrl-F, enter the filename,
search, and see the process that appears).

I'll try out Visual Studio 2003 and see what happens. Is the VS.Net
installed on the same machine as IIS or different?

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Okay, so check this out. I started using VS 6.0 and I have not had any
problems. It must be VS.NET that has the bug! Try using VS.NET and see what
happens. I just use file -> open with no project. I'm using build hmmm...
okay I just went to help about and I got a blank window that says 'Key
Expired'. What the? I have a fully registered and activated version! Hmmm...
that window came up twice. Must be some plug-in or something. Anyway the dev
environment is 7.1.3088.
 
Cool. I'll give that a shot. So could it be possible that VS.NET has two
open handles to the file? Wierd. What's really strange is that it will write
back some of the file and then truncate the end. If you are not careful and
do a save as, you lose! Then you wonder why your asp page is whacked out.
Luckily I had a backup on the production server the first few times it
happened until I figured out what was going on.

Not a pleasant bug.

VS.NET is installed on my dev machine, not on the server where IIS is
installed. I am opening files that are on a drive mapped to the server. I'm
not using UNC. Keep in mind that it may work okay at first but after 3 or 4
iterations of change - save - refresh page... it then hits.
 
Ok, let me make sure I understand your filesystem setup.

1. Server has the ASPX files on a local drive
2. IIS is configured to map URL to the local ASPX files via a local
directory
3. The Server has some UNC shares (including the C$ / D$ shares )
4. You NET USE to the Server's UNC share(s) and map it to a local drive
letter
5. VS.Net is on a separate machine from the server and accesses the ASPX
files via this local drive letter

i.e.
Your server OS is on C: and you have this file:
C:\inetpub\wwwroot\MyApp\MyApp.aspx
IIS has /MyApp vdir mapped to C:\inetpub\wwwroot\MyApp
On a separate machine, you run NET USE Z: \\server\wwwroot$ using an account
that has access
With VS.Net, you open Z:\MyApp\MyApp.aspx and can make requests to
http://server/MyApp/MyApp.aspx

The details are important because different technology are in play depending
on what you say.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Cool. I'll give that a shot. So could it be possible that VS.NET has two
open handles to the file? Wierd. What's really strange is that it will write
back some of the file and then truncate the end. If you are not careful and
do a save as, you lose! Then you wonder why your asp page is whacked out.
Luckily I had a backup on the production server the first few times it
happened until I figured out what was going on.

Not a pleasant bug.

VS.NET is installed on my dev machine, not on the server where IIS is
installed. I am opening files that are on a drive mapped to the server. I'm
not using UNC. Keep in mind that it may work okay at first but after 3 or 4
iterations of change - save - refresh page... it then hits.
 
Some slight differences, but I don't think this is anything different than
what you describe...

1. I'm currently editing ASP files, not aspx... although I think the same
thing happens with aspx files.
2. My server is set up with the OS on drive C: and a seperate data drive D:
but the rest is the same.
3. I have a set up a folder on D: where my web files are,
D:\webdata\mywebfiles
4. There is another level below that has the files for the site,
D:\webdata\mywebfiles\client1\web and this is the folder that IIS points to
for the site. I have not set mywebfiles as my wwwroot$.
5. I have shared the mywebfiles folder so you see it on my network as
\\Server\mywebfiles
6. On my workstation I map using windows explorer's ->tools - map network
drive menu option
7. In VSNet, you open Z:\Client1\web\MyApp.asp and can make requests to
http://server/MyApp.asp
 
Hi David,

I downloaded Process Explorer and replicated the Access Denied error.
Looking in process explorer I can see that VS.NET (devenv.exe) has a handle
to the file:
\Device\LanmanRedirector\;Q:000000000001cf40\otterden\stariq\web site
files\stariq\members
and looking at the properties it says that there are 3 references and one
handle. I really don't know how to use this tool very well so any hints you
may have will be helpful. As this is a really annoying problem, I would like
to make some headway on it. Should I be posting on the VS.NET group as well?

Here is another interesting tidbit. It does not matter if I have looked at
the file in internet explorer or not. Simply opening the file and making a
change and then trying to save it causes an access denied error. So having
done that, I simply created a text file on the share on my server using
vs.net. I put it in a directory unrelated to any web site. It create and
saved it, that was fine. Then added another line of text and hit the save
icon. Boom! Access Denied.

Then I went and created a text file and saved it using unc naming
conventions. Had no problems creating it and making changes and saving it.

This is VS.NET issue. It cannot save files to mapped drives.
 
Hmm, I cannot reproduce what you are saying with VS.Net 2003 at all. I used
a mapped drive letter to access a remote server's files, and it saved just
fine. I made several changes, clicked the save icon or ctrl-s, and
everything went ok. I tried UNC filename, it was ok as well.

I wonder if anti-virus software is involved here, where it has the file open
that prevents quick modification.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Hi David,

I downloaded Process Explorer and replicated the Access Denied error.
Looking in process explorer I can see that VS.NET (devenv.exe) has a handle
to the file:
\Device\LanmanRedirector\;Q:000000000001cf40\otterden\stariq\web site
files\stariq\members
and looking at the properties it says that there are 3 references and one
handle. I really don't know how to use this tool very well so any hints you
may have will be helpful. As this is a really annoying problem, I would like
to make some headway on it. Should I be posting on the VS.NET group as well?

Here is another interesting tidbit. It does not matter if I have looked at
the file in internet explorer or not. Simply opening the file and making a
change and then trying to save it causes an access denied error. So having
done that, I simply created a text file on the share on my server using
vs.net. I put it in a directory unrelated to any web site. It create and
saved it, that was fine. Then added another line of text and hit the save
icon. Boom! Access Denied.

Then I went and created a text file and saved it using unc naming
conventions. Had no problems creating it and making changes and saving it.

This is VS.NET issue. It cannot save files to mapped drives.
 
Good call. That is exactly it. I disabled anti-virus and it works.

I use McAfee Virusscan professional. Obviously, I don't want to disable my
virus scan so I suppose I will have to contact their tech support and report
this. What a pain in the rear.

Thanks for all your help.

- Ron
 
Back
Top