Re: GAC, Fusion.dll and Access Denied

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Junfeng Zhang[MSFT] (juzhang_at_online.microsoft.com)
Date: 03/18/05


Date: Fri, 18 Mar 2005 10:40:28 -0800

That is odd. FileMon should give you some information. Are you running
FileMon on the right machine?

Sample managed code to check if you are admin or not :

http://blogs.msdn.com/brada/archive/2004/10/01/236870.aspx

There is a bug in v1.0/v1.1 fusion GAC API that it *remembers* the
permission you have when install. If the first time installation failed due
to permission reason (like you are not admin), any subsequent installation
will fail (in the same process), regardless whether you have permission or
not. But I don't see how this bug will affect you.

-- 
Junfeng Zhang
http://blogs.msdn.com/junfeng
This posting is provided "AS IS" with no warranties, and confers no rights.
"dave.russellATalliance-leicesterDOTcoDOTuk" 
<dave.russell@alliance-leicester.co.uk> wrote in message 
news:1111073059.126534.87680@z14g2000cwz.googlegroups.com...
> We have a series of COM+ applications written in vb.net.  Each consists
> of a component which is contained in a strong-named DLL hosted in the
> GAC.
> I am trying to write a "simple" software distribution application which
> will allow us
> to maintain our development environments - having to manually configure
> GAC and COM+ on many remote machines everytime we change a DLL is a
> time-consuming error-prone chore.
>
> My application is an intranet asp.net application.
> What it needs to do is...
> 1) Copy a new DLL from a "release directory" to a remote server
> 2) Install that DLL into the GAC
> 3) (re)Configure the COM+ application which uses the DLL.
>
> It does (1) and (3) quite happily.
> I've tried numerous different ways of doing (2) with limited success.
>
> If I start another process which runs pstools/psexec from the
> webapplication's server to execute gacutil on the remote machine, it
> WORKS....But only if the webapplication
> is running on localhost.  if the webapp is running on a server it
> executes GACUTIL OK,
> but GACUTIL reports an "access denied" error.
>
> If I make the webapplication call a webservice on the remote server and
> include
> your GAC-API wrapper within that webservice, I *always* get "access is
> denied"
> as the exception thrown from the HRESULT of the GAC Install.  Even if I
> attach the admin credentials to the webservice method call and
> <impersonate> on the webservice itself.  Even if the calling webapp is
> running on localhost.
>
> I think I read somewhere that to install into the GAC the code has to
> be running with
> FullTrust and as an Administrator.  I think both of these must be true
> (How do I tell
> in code?) as I have given "Local Intranet" zone FULLTRUST and the
> webservice's current identity is an administrator.
>
> As the exception is thrown by the wrapper, I can't see what's causing
> it in Fusion.dll.
> Fusion log viewer doesn't shed any light - I don't see any failures.
> FileMon doesn't shed any light - I don't see any failures.
> I've tried asserting permissions in case it's
> something-up-the-callstack that the
> "access is denied" is failing on, but I've no idea what to assert,
> because I can't
> see the real exception.
>
> Please advise what else I can do to fix this.
> 


Relevant Pages

  • Re: Installing COM add-in
    ... It looks as though you need admin priv to register the DLL ... > You don't need admin rights to install, just user rights to install new ...
    (microsoft.public.outlook.program_vba)
  • .Net & COM interop deployment
    ... The second is the writing application which is a c# dll with a COM ... called from Excel the AppBase seems to get set to the Excel install ... to install them in the GAC for them to be found. ...
    (microsoft.public.dotnet.framework.interop)
  • CLR was running a version of my dll that didnt exist!?!?
    ... OK, we have a .NET dll hosted in COM+ running as a queued, pooled ... component - I say this as an explanation of why my assemlies are in the GAC ... (the only way to run a COM+ server app). ... and the com+ app is gone) we then install foo.dll version 1.0.1 into the ...
    (microsoft.public.dotnet.framework.clr)
  • RE: VBE interop version weirdness
    ... It was weird that your customer have two dll in the GAC. ... install 2 versions of Office on the same machine, so I think it could not ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: .NET versioning
    ... >>> The GAC recognises only the .NET version, ... > If this isn't dll hell then it's awfully close. ... >>> So you have two assemblies installed into the GAC and two uninstall ... >> No install processes, you copy the files. ...
    (microsoft.public.dotnet.framework)