Problem with dll registration - Access denied

When trying to run regasm on a Win2008 server:

regasm "C:\Program Files\FooProg\Bar.dll" /tlb:"C:\Program Files\FooProg\Bar.tlb" 

I get the following error:

RegAsm: error RA0000: an error occurred while saving the exported library type: access denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

what does it mean

+6
regasm
source share
10 answers

The account under which you run regasm does not have write permissions to C: \ Program Files \ FooProg \ and why the rules cannot write .tlb. Run regasm under an administrator account.

+9
source share

This error is most likely to appear because you cannot delete the corresponding .tlb file. Two other suggestions:

  • Stop IIS and try again:
  • Stop IIS, delete the .tlb files from anywhere your dll file is located, and then try registering again.
  • Close all IE / IIS / DEV tools (they may keep some files read-only), and then try to register your DLL
+11
source share

The account used requires administrator rights.

+3
source share

This error is most likely to appear because you cannot delete the corresponding .tlb file. Two other suggestions: 1. Stop IIS and try registering again: 2. Stop IIS, delete .tlb files from anywhere your DLL file is located, and then try to register again.

+1
source share

In my case, both the .dll and .tlb files were ReadOnly, removing the ReadOnly check worked for me, I also closed the process that used it like (Visual Studio IDE).

+1
source share

You can also get this problem if you don't specify the full path in the /tlb argument.

He will try to write C:\windows\system32 . Even if you run Administrator, by default you do not have write permissions to this directory.

The solution is to provide the full path (to the directory that you have rights to) in the /tlb argument.

+1
source share

Most likely, you get an error due to a process with hooks in the .dll or .tlb file that you are trying to register or copy. Restart your computer and try again, or delete the .tlb file and rebuild it to make sure you can access it.

+1
source share

I had a random dllhost.exe process. The murder allowed me to delete the .tlb file and re-register. Other approaches (stopping IIS, stopping application pools, closing all IDEs) had no effect.

+1
source share

First I had to remove all the spaces in the path to my dll before regasm found the dll file.

But when I tried using quotes around the targets, they worked anyway.

0
source share

Win 7 (if they are already administrators). You can allow file permissions by right-clicking and gaining access to the properties, tab "Security", click "Edit", check the permissions allowed, for example. Full control.

0
source share

All Articles