473,324 Members | 2,417 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,324 software developers and data experts.

service access denied to DLLs

I figured out what was causing the "Access is Denied" error when
calling functions from referenced DLLs in my service. I've tried to
be very detailed, so bear with me.

It turns out that libraries I made myself were not having this
problem, but it only happened with a zip library I downloaded and
copied into my program's directory. When using classes from this
library, my service threw an "Access Is Denied" FileLoadException,
which I've quoted below.

(Note that I was only able to trap the exception to a log file because
the zip library is accessed from one of my own libraries, otherwise,
the service would fail on startup with an SCM error dialog saying "the
service did not return any error code".)

The access is denied error occurred when I set up the service to run
as the Local System account, even though this account had full NT
permissions to the DLL. When I ran the service as Administrator, the
problem went away. But running the service as Administrator is not a
feasible option for deployment.

I then ran the Assembly Binding Log Viewer (fuslogvw.exe) and turned
on logging. After running the service, the load failure was logged as
an ASP.Net exception with the result of "Access is Denied". The log
messages said "Unable to extract last modified time from
c:\inetpub\wwwroot\jobs\ICSharpCode.SharpZipLib.DL L." (See the second
message below.) So I opened the DLL in Textpad as UTF-8, changed a
byte, changed it back, and then saved the file. After this, the
service could access the DLL without any problems running as Local System.

I can understand why .Net would want to check the last modified time,
but why did it fail to extract it? Before I modified it, the DLL did
have a valid last modified time stamp (as verified by checking the
file properties). Why did .Net fail to extract the time stamp when
running as LocalSystem, but not when running as Administrator?
Finally, why is the load failure categorized as an "ASP.Net" failure
in the Assembly Binding Log and not a "Default" failure? My immediate
issue is solved, but this behaviour may suggest a problem in the way
..Net assembly binder reads the last modified time stamp in Windows 2000.

Regards,
Shailesh

------------------------------------------FROM SERVICE LOG FILE:

Starting My Maintenance Service at 11/6/2003 5:02:52 PM with private
key file ''.
Error unzipping.
System.IO.FileLoadException: Access is denied: 'ICSharpCode.SharpZipLib'.
File name: "ICSharpCode.SharpZipLib"
at MyNamespace.ZipHelper.UnzipSingleFile(String strInputFile,
String strOutputFile)
at MyMaintenanceService.OnStart(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwroot\jobs\
LOG: Initial PrivatePath = NULL
Calling assembly : ziphelper, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\ machine.config.
LOG: Post-policy reference: ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.SharpZipLib.DLL.
------------------------------------------FROM FUSLOGVW.EXE:

*** Assembly Binder Log Entry (11/6/2003 @ 5:02:52 PM) ***

The operation failed.
Bind result: hr = 0x80070005. Access is denied.

Assembly manager loaded from:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\fusion. dll
Running under executable c:\inetpub\wwwroot\jobs\myjob.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwroot\jobs\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : ziphelper, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===

LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\ machine.config.
LOG: Post-policy reference: ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.SharpZipLib.DLL.
LOG: Assembly download was successful. Attempting setup of file:
c:\inetpub\wwwroot\jobs\ICSharpCode.SharpZipLib.DL L
ERR: Unable to extract last modified time from
c:\inetpub\wwwroot\jobs\ICSharpCode.SharpZipLib.DL L.
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing
terminated.

Nov 20 '05 #1
3 7955
Hi Shailesh,

Did you use the Ngen tool with ICSharpCode.SharpZipLib.DLL to create a
native image?
Native Image Generator (Ngen.exe)
http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfnativeimagegeneratorngenexe.asp

If so I think you may use the assembly name as the argument of Ngen.
I think you may try to workaround the problem by using any of the three
workaround.
1. You could use the full assembly name.
2. You could change into the directory where the assembly lives and then
pass in the partial assembly name.
3. You could just use filenames instead of assembly names. For instance,
you could provide the full or partial path to ngen, or just change to the
directory where ICSharpCode.SharpZipLib.DLL lives before you compile it.

For detailed information you may try to refer the link above.
Did I misunderstand you meaning?
If you have any concern on this issue,please post here.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Date: Fri, 07 Nov 2003 02:50:05 -0500
From: Shailesh Humbad <hu******@hotmail.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: service access denied to DLLs
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <er**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: cpe-024-210-100-160.twmi.rr.com 24.210.100.160
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:154563
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

I figured out what was causing the "Access is Denied" error when
calling functions from referenced DLLs in my service. I've tried to
be very detailed, so bear with me.

It turns out that libraries I made myself were not having this
problem, but it only happened with a zip library I downloaded and
copied into my program's directory. When using classes from this
library, my service threw an "Access Is Denied" FileLoadException,
which I've quoted below.

(Note that I was only able to trap the exception to a log file because
the zip library is accessed from one of my own libraries, otherwise,
the service would fail on startup with an SCM error dialog saying "the
service did not return any error code".)

The access is denied error occurred when I set up the service to run
as the Local System account, even though this account had full NT
permissions to the DLL. When I ran the service as Administrator, the
problem went away. But running the service as Administrator is not a
feasible option for deployment.

I then ran the Assembly Binding Log Viewer (fuslogvw.exe) and turned
on logging. After running the service, the load failure was logged as
an ASP.Net exception with the result of "Access is Denied". The log
messages said "Unable to extract last modified time from
c:\inetpub\wwwroot\jobs\ICSharpCode.SharpZipLib.D LL." (See the second
message below.) So I opened the DLL in Textpad as UTF-8, changed a
byte, changed it back, and then saved the file. After this, the
service could access the DLL without any problems running as Local System.

I can understand why .Net would want to check the last modified time,
but why did it fail to extract it? Before I modified it, the DLL did
have a valid last modified time stamp (as verified by checking the
file properties). Why did .Net fail to extract the time stamp when
running as LocalSystem, but not when running as Administrator?
Finally, why is the load failure categorized as an "ASP.Net" failure
in the Assembly Binding Log and not a "Default" failure? My immediate
issue is solved, but this behaviour may suggest a problem in the way
.Net assembly binder reads the last modified time stamp in Windows 2000.

Regards,
Shailesh

------------------------------------------FROM SERVICE LOG FILE:

Starting My Maintenance Service at 11/6/2003 5:02:52 PM with private
key file ''.
Error unzipping.
System.IO.FileLoadException: Access is denied: 'ICSharpCode.SharpZipLib'.
File name: "ICSharpCode.SharpZipLib"
at MyNamespace.ZipHelper.UnzipSingleFile(String strInputFile,
String strOutputFile)
at MyMaintenanceService.OnStart(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwroot\jobs\
LOG: Initial PrivatePath = NULL
Calling assembly : ziphelper, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config \machine.config.
LOG: Post-policy reference: ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.SharpZipLib.DLL.
------------------------------------------FROM FUSLOGVW.EXE:

*** Assembly Binder Log Entry (11/6/2003 @ 5:02:52 PM) ***

The operation failed.
Bind result: hr = 0x80070005. Access is denied.

Assembly manager loaded from:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\fusion .dll
Running under executable c:\inetpub\wwwroot\jobs\myjob.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwroot\jobs\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : ziphelper, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===

LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config \machine.config.
LOG: Post-policy reference: ICSharpCode.SharpZipLib, Version=0.5.0.0,
Culture=neutral, PublicKeyToken=1b03e6acf1164f73
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.SharpZipLib.DLL.
LOG: Assembly download was successful. Attempting setup of file:
c:\inetpub\wwwroot\jobs\ICSharpCode.SharpZipLib.D LL
ERR: Unable to extract last modified time from
c:\inetpub\wwwroot\jobs\ICSharpCode.SharpZipLib.D LL.
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing
terminated.


Nov 20 '05 #2
Shailesh Humbad <hu******@hotmail.com> wrote in message news:<er**************@TK2MSFTNGP10.phx.gbl>...
I figured out what was causing the "Access is Denied" error when ...


Hello Shailesh,

we're experiencing the same issue with some of our ASP.NET
applications as well as with a remoting app : the ACLs are ok, yet
access is denied. Modifying a byte in the dll solves the issue
temporarily. BTW, the problem occurs on our own DLLs.
We suspect our McAfee NetShield to cause the problem since everything
had been running fine for over a year until the last update to
NetShield last Friday. We've also had similar issues before where
outbound files were scanned. Disabling outbound scans solved that
problem.

Do you have antivirus on your server too? I'll see whether our
SysAdmin agrees in running a FileMon trace on one app, maybe I'll know
more then.
Do you still experience the problem?

Best Regards

Hans
Nov 20 '05 #3
HVE
On 28 Nov 2003 03:46:23 -0800, Hans wrote:
Shailesh Humbad <hu******@hotmail.com> wrote in message news:<er**************@TK2MSFTNGP10.phx.gbl>...
I figured out what was causing the "Access is Denied" error when ...


Hello Shailesh,

we're experiencing the same issue with some of our ASP.NET
applications as well as with a remoting app : the ACLs are ok, yet
access is denied. Modifying a byte in the dll solves the issue
temporarily. BTW, the problem occurs on our own DLLs.
We suspect our McAfee NetShield to cause the problem since everything
had been running fine for over a year until the last update to
NetShield last Friday. We've also had similar issues before where
outbound files were scanned. Disabling outbound scans solved that
problem.

Do you have antivirus on your server too? I'll see whether our
SysAdmin agrees in running a FileMon trace on one app, maybe I'll know
more then.
Do you still experience the problem?

Best Regards

Hans


Hi Shailesh,

I've found a way to reproduce the problem :

Starting from a working system, I set the Archive flag off for the DLL for
which access was denied before.
I try to re-run the application : Access Denied.
I reset the Archive flag and re-run the application : Access Denied
I modify the dll phyiscally and re-run the application : working again.

This might indicate that either the antivirus or the backup program (which
resets the Archive flag after a backup) cause the problem.

Best Regards

Hans
Nov 20 '05 #4

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

Similar topics

2
by: Murray Jack | last post by:
under windows 2003 I have a windows 2003 server with a "classic asp" application on it with some com Dlls doing the business logic my problem is when i add these DLLS to component services,...
0
by: George | last post by:
Hello, I'm running an ASPX application "WebApplication1" which consumes a web service (service1.asmx) hosted on a machine with IP (128.1.7.x) . The web service is located in the intranet. The...
4
by: Bruce | last post by:
I am developing an ASP.NET web service application. It works fine on my WinXP Prof development machine. But when I send it to a Windows Server 2003 system I get the following error (attached...
1
by: HVE | last post by:
Hi, there seem be be quite a lot of people with similar problems. We think we've found some more useful information that might lead to a solution. Any ideas are welcome Hans > Shailesh...
3
by: Grant Schenck | last post by:
I have a simple remoting sample using IPCChannel. If I run the server code as a console app my client can connect just fine. However, if I the same server code runs in a service, the client gets...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
3
by: SugarDaddy | last post by:
Here's my problem. I have an NT service (really a .NET service) running as local system. I have a .NET form running on the user account. The form and the service communicate via an IPC Channel...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
2
by: =?Utf-8?B?bXVyYWRqYW1lcw==?= | last post by:
Yes, sorry I tried to make it clear in the original question that I want to get the user token of the service - ie. the account the service is running under. I know services don't have user tokens...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.