Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem registering a dll - Access Denied

When trying to run regasm in 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 type library: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

what does this mean

like image 969
Vidar Avatar asked Dec 04 '09 15:12

Vidar


People also ask

How do I manually register a DLL?

Click Start > All Programs > Accessories and right-click on "Command Prompt" and select "Run as Administrator" OR in the Search box, type CMD and when cmd.exe appears in your results, right-click on cmd.exe and select "Run as administrator" At the command prompt, enter: REGSVR32 "PATH TO THE DLL FILE"

How do I register a DLL without admin rights?

Just use RegisterDLL "C:\Path\To\File. DLL" to automatically add the required entries. These scripts require no references, and no admin access. They should generally run fast and allow for setting on application startup, and cleaning on application shutdown, if conflicts might be an issue.

How do I register a DLL file in Windows 10 64 bit?

To register a . dll file in a Windows 10 64 bit, you may check with the steps listed below and see if it works: Go to the Search window and type cmd, right click on Command Prompt and choose Run as an administrator option. Type the following command in the command window and hit Enter - regsvr32 <dllname>

What is DLL register Server?

When a DLL is registered, the DllRegisterServer method entry point in your DLL is invoked. Similarly, DllUnregisterServer is invoked when a DLL is unregistered. As described in this MSDN article: Instructs an in-process server to create its registry entries for all classes supported in this server module.


2 Answers

That error mostlikely comes up because you can't delete a corresponding .tlb file. Two other suggestions:

  1. Stop IIS and attempt to register again:
  2. Stop IIS, remove .tlb files from wherever your DLL file is and then attempt to register again.
  3. Close all IE/IIS/DEV tools (they might be keeping some files in read-only state) and then attempt to register your DLL
like image 165
Dominik Ras Avatar answered Sep 18 '22 17:09

Dominik Ras


The account under which you run regasm doesn't have rights to write to C:\Program Files\FooProg\ and that's why regasm fails to write the .tlb. Run regasm under an account with administrator priviledges.

like image 40
sharptooth Avatar answered Sep 19 '22 17:09

sharptooth