We're developing with a third party ActiveX component in VB.NET 2005.
I am able to create instances from the component using both early and
late binding if I run from within visual studio. However, when I build
the project and run the executable on the same machine I get an
exception.
Early binding gives the following exception during the New statement:
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
Late binding gives the following exception during the CreateObject
call:
System.Exception: Cannot create ActiveX component.
Since I can create an instance using either method during debug mode,
it seems almost certain that this is a permission or security problem.
I've signed the assembly, signed the ClickOnce manifests, and enabled
the full trust application ClickOnce security setting. I've even tried
setting what I believe is the corresponding DCOM config properties to
full access for Everyone in the Component Services MMC.
Just to be clear, this really is the entire code:
Module Module1
Sub Main()
Dim app As New Application
End Sub
End Module
Module Module2
Sub Main()
Dim app As Object = CreateObject(APP_TYPE_NAME)
End Sub
End Module
Any help would be greatly appreciated,
Mike D
Mike D - 29 Nov 2006 16:02 GMT
I believe my problem may be related to CAS somehow. I've tried giving
both the interop type library and the assembly exe full trust minimum
permissions through the Increase Assembly Trust wizard on the .NET
Framework 2.0 Configuration runtime security page. The result however
is the same exception. I assume that it would be pointless to try to
give full trust to the com object dll, since the runtime security seems
to only apply to .NET managed code.
I have verified that I was wrong in my earlier assumption that I was
modifying the correct DCOM config. The API we're using is just COM.
Again, the issue is that my code works just fine when run in the IDE,
but it crashes on creating a COM instance when the build is run.
Thanks,
Mike D
> We're developing with a third party ActiveX component in VB.NET 2005.
> I am able to create instances from the component using both early and
[quoted text clipped - 33 lines]
> Any help would be greatly appreciated,
> Mike D