473,547 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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" FileLoadExcepti on,
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\wwwr oot\jobs\ICShar pCode.SharpZipL ib.DLL." (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.FileL oadException: Access is denied: 'ICSharpCode.Sh arpZipLib'.
File name: "ICSharpCode.Sh arpZipLib"
at MyNamespace.Zip Helper.UnzipSin gleFile(String strInputFile,
String strOutputFile)
at MyMaintenanceSe rvice.OnStart(S tring[] args)

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutral , PublicKeyToken= 1b03e6acf1164f7 3
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwr oot\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\Micros oft.NET\Framewo rk\v1.1.4322\co nfig\machine.co nfig.
LOG: Post-policy reference: ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutral , PublicKeyToken= 1b03e6acf1164f7 3
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.Sha rpZipLib.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\Micros oft.NET\Framewo rk\v1.1.4322\fu sion.dll
Running under executable c:\inetpub\wwwr oot\jobs\myjob. exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutral , PublicKeyToken= 1b03e6acf1164f7 3
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwr oot\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\Micros oft.NET\Framewo rk\v1.1.4322\co nfig\machine.co nfig.
LOG: Post-policy reference: ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutral , PublicKeyToken= 1b03e6acf1164f7 3
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.Sha rpZipLib.DLL.
LOG: Assembly download was successful. Attempting setup of file:
c:\inetpub\wwwr oot\jobs\ICShar pCode.SharpZipL ib.DLL
ERR: Unable to extract last modified time from
c:\inetpub\wwwr oot\jobs\ICShar pCode.SharpZipL ib.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing
terminated.

Nov 20 '05 #1
3 7980
Hi Shailesh,

Did you use the Ngen tool with ICSharpCode.Sha rpZipLib.DLL to create a
native image?
Native Image Generator (Ngen.exe)
http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfnativeimag egeneratorngene xe.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.Sha rpZipLib.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******@hotma il.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.publi c.dotnet.langua ges.vb
NNTP-Posting-Host: cpe-024-210-100-160.twmi.rr.com 24.210.100.160
Lines: 1
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:154563
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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" FileLoadExcepti on,
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\www root\jobs\ICSha rpCode.SharpZip Lib.DLL." (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.File LoadException: Access is denied: 'ICSharpCode.Sh arpZipLib'.
File name: "ICSharpCode.Sh arpZipLib"
at MyNamespace.Zip Helper.UnzipSin gleFile(String strInputFile,
String strOutputFile)
at MyMaintenanceSe rvice.OnStart(S tring[] args)

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutra l, PublicKeyToken= 1b03e6acf1164f7 3
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwr oot\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\Micro soft.NET\Framew ork\v1.1.4322\c onfig\machine.c onfig.
LOG: Post-policy reference: ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutra l, PublicKeyToken= 1b03e6acf1164f7 3
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.Sha rpZipLib.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\Micro soft.NET\Framew ork\v1.1.4322\f usion.dll
Running under executable c:\inetpub\wwwr oot\jobs\myjob. exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutra l, PublicKeyToken= 1b03e6acf1164f7 3
(Fully-specified)
LOG: Appbase = c:\inetpub\wwwr oot\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\Micro soft.NET\Framew ork\v1.1.4322\c onfig\machine.c onfig.
LOG: Post-policy reference: ICSharpCode.Sha rpZipLib, Version=0.5.0.0 ,
Culture=neutra l, PublicKeyToken= 1b03e6acf1164f7 3
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/jobs/ICSharpCode.Sha rpZipLib.DLL.
LOG: Assembly download was successful. Attempting setup of file:
c:\inetpub\www root\jobs\ICSha rpCode.SharpZip Lib.DLL
ERR: Unable to extract last modified time from
c:\inetpub\www root\jobs\ICSha rpCode.SharpZip Lib.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing
terminated.


Nov 20 '05 #2
Shailesh Humbad <hu******@hotma il.com> wrote in message news:<er******* *******@TK2MSFT NGP10.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******@hotma il.com> wrote in message news:<er******* *******@TK2MSFT NGP10.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
2420
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, all my buttons on my web server start returning the error access is denied. it keeps this problem if you remove the dlls from component services and...
0
2622
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 web methods can be invoked successfully if "WebApplication1" is located in machines with the same subnet (128.1.7.x). However, it fails if...
4
2903
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 below). I suppose I have some kind of permissions issue on the server? What recommendations can anyone propose? Thanks, -- Bruce
1
243
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 Humbad <humbads1@hotmail.com> wrote in message news:<er597OQpDHA.2500@TK2MSFTNGP10.phx.gbl>... >> I figured out what was causing the "Access is Denied"...
3
20289
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 a RemotingException of "Failed to connect to an IPC Port: Access is denied". The Access is denied changes if my service isn't running to "The...
4
21690
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 webserver to see if service A needs to be updated. What service B does if it sees their is an update for service A is to download a new copy of the...
3
11230
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 so the form can control the service and do various things. Both applications share the same set of dlls. When performing an update of some of...
41
11604
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 exits immediately with a start/stop/nothing to do error. What could be wrong?
2
5327
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 - I suspect users do have tokens, hence "user token", otherwise we might call them "service tokens" or somesuch :-) If you read the question...
0
7703
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6032
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3493
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1923
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.