Re: Cannot create COM instance at runtime

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


On Nov 28, 5:25 pm, "Mike D" <fuwn...@xxxxxxxxx> wrote:
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

.



Relevant Pages

  • Re: How to evaluate required permissions?
    ... > applications that won't run on medium or low trust. ... The zones are just like IE zones - local zone, internet zone, etc. ... permissions and create your own, or you can give apps with a specific ... can say "give full trust to all apps ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Multiple Domains
    ... delegated the necessary permissions to the account. ... I used an admin account and received 2 out of 218 users. ... Then we can eliminate domain (where the query originates), ... application to get a two way trust. ...
    (microsoft.public.windows.server.active_directory)
  • RE: Security exception related to network
    ... Administrative Tools -> .Net FrameWorks Configuration and made it set to full ... trust "intranet zone". ... This group has default a full trust Permission ... The exception message that it gives me is: ...
    (microsoft.public.dotnet.security)
  • Re: Cannot assign Mac permissions in trusting domain
    ... You don't mention what version of MacOS you are using or whether or not ... the trust relationship is the ... > This morning the permissions for the faculty are no longer there. ... > permissions the ownership is set to <Account Unknown>. ...
    (microsoft.public.macintosh.general)
  • Re: Cannot assign Mac permissions in trusting domain
    ... You don't mention what version of MacOS you are using or whether or not ... the trust relationship is the ... > This morning the permissions for the faculty are no longer there. ... > permissions the ownership is set to <Account Unknown>. ...
    (microsoft.public.win2000.macintosh)