We have a WCF service hosted in IIS that currently calls a VB6 DLL to do part of its job. This works fine, but we can't deploy the service to a 64-bit target environment without configuring IIS to run it in a 32-bit worker process.
I am currently investigating ways around that restriction. Porting the VB6 DLL to .NET is not possible for various reasons, so I created an ActiveX EXE wrapper around the DLL in VB6, so that the service can run in 64-bit and the VB6 parts in 32-bit.
When I tested the service I got this error:
Type: System.UnauthorizedAccessException
Message: Retrieving the COM class factory for component with CLSID {9AE7303B-D159-43F6-B1A5-52D297581820} failed due to the following error: 80070005.
After some Googling I found that this is due to either:
- Calling an MS Office component
- DCOM permissions not being configured
- NTFS file permissions not allowing read/exec access to the IIS worker process identity (
ASPNET
in my environment)
Of these:
- Definitely not applicable
- Also not applicable; I am not hosting the EXE in DCOM or COM+, just a simple COM out-of-process activation
- This looks likely; however, I checked the permissions, and NTFS reports that the
Users
group (whichASPNET
is a member of) does indeed have read/exec access to the file
I tried calling the EXE from a unit test fixture, which is executed in my admin-level account rather than the IIS worker process account, and it worked fine, so the error is definitely something to do with permissions. I'm not sure what to do next. Can anyone suggest things I can check?
My test environment is Windows XP / IIS 5.1
UPDATE:
The IIS virtual directory is configured for Anonymous+Windows access; the WCF service uses only Anonymous authentication, the Windows authentication is for the VS debugger. Task Manager reports that the aspnet_wp.exe
process is definitely running in the ASPNET
account.
I explicitly granted Read and Execute access to the ASPNET
and IUSR_<machine>
accounts on all the COM exes and dlls involved. This made no difference.
I explicitly granted Local Launch and Local Activation access to the ASPNET
and IUSR_<machine>
accounts on the relevant interfaces in the DCOM configuration. This made no difference either.
As I see it I have 3 options:
- Keep trying to get this working somehow.
- Go the whole hog and host the EXE in COM+.
- Give up. Tell users that the WCF service must be configured to run in a 32-bit app pool on 64-bit Windows.