all groups > dotnet interop > november 2005 >
You're in the

dotnet interop

group:

'Access is denied' accessing VB6 dll through RCW


'Access is denied' accessing VB6 dll through RCW AussieBob
11/28/2005 8:07:49 PM
dotnet interop:
Hi,

I'm having trouble using a RCW for a dll I created, I receive the
"Access is Denied" error message from my ASP.NET application. In my
MCP 70-315 book I read that the directory containing the COM dll needs
to have write permissions for the User. -- I haven't seen this advice
anywhere on the 'net though, but I'm sure it's true...

I created a test COM dll in VB6 and a test ASP.NET application,
creating the RCW correctly. When I use impersonation the web app works
correctly, calling the COM object. When I turn impersonation off, I
get the access denied error. I assume this is because my normal
windows account has read/write access to the COM dll directory.

I thought that if impersonation is not used, ASPNET user is used (as
this is the user I have to use in SQL Server to get the real app
working). However, when I set ASPNET user to have write access to the
directory (I've tried setting write privelidges on both the directory
containing the RCW and the directory containing the COM dll) I still
get errors. I've also done this for the SYSTEM user.

I've terminated the aspnet_wp.exe process to make sure nothing was
lingering...

I'm running .NET Framework 1.1 on IIS 5.1 and have Directory Security
for the application set to "Anoymous Access", "Allow IIS to control
password", and "Intergrated Windows Authentication".

Any help to resolve this issue (I've been stumbling around trying to
figure out what is wrong for a solid day now) would be greatly
appreciated

:AussieBob
Re: 'Access is denied' accessing VB6 dll through RCW Dmytro Lapshyn [MVP]
11/29/2005 12:00:00 AM
Hi,

Try to turn the security audit on in the Local Security Policy console, and
then tune auditing of all access failures for the folder in which the COM
DLL resides. Thus, if it is a file system permissions issue, you'll get a
report in the Security event log.

But it theoretically might be a registry issue (because the information on
COM objects in the system is stored right there). Try to configure the same
level of audit for HKEY_CLASSES_ROOT (and all subkeys) with regedt32.exe.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


[quoted text, click to view]
Re: 'Access is denied' accessing VB6 dll through RCW AussieBob
12/1/2005 4:33:30 PM
I've fixed the problem, thanks Dmytro.

I went into Component Services (use dcomcnfg.exe in Win2K) and then to
DCOM config for My Computer. I then went to the COM object I was
trying to access and selected Properties, then the Security tab. In
the Access Permissions section I chose Customize, and added ASPNET
user.

:AussieBob
AddThis Social Bookmark Button