473,748 Members | 8,773 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 8005
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
2429
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 restart the server
0
2641
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 "WebApplication1" is hosted on
4
2915
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" error when ...
3
20305
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 system cannot find the file specified" so the I think I'm connecting but being denied due to some type...
4
21742
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 service A executable, stop service A, replace the executable with the new copy, and start service B...
3
11244
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 the dlls, both the service and the form must be shut down (that's just how it's implemented -- didn't
41
11657
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
5338
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 again, you migh see that the fundamental question is, *assuming there is no other approach*: The...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9372
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.