Configuring .NET-based components to activate without registration

I am trying to create a free .NET-based COM library, but without success.

  • In Visual Studio 2008, I added a new C # class library.
  • I have included the options "make assembly COM-visible" and "register for COM interop".
  • I added a public interface and a class with some features.
  • I added a manifest dependency with my C ++ client application: #pragma comment (linker, "/ manifestdependency ...

But when I launch my application, I get "the application did not start because the application configuration is incorrect."

I used the Microsoft mt tool to extract the manifest files of both the C ++ client application and the C # COM DLL, and the information is the same in both cases (the dependent assembly in the C ++ manifest file contains the same name and version as assemblyIdentity in the file manifest COM).

I also tried the approach described at http://msdn.microsoft.com/en-us/library/eew13bza.aspx , but with similar results.

COM- "Framework and References" ++. ( , " ", " " .. , "assemblyIdentity" ), Visual Studio DLL .

, " " .

- , ?

Update:

  • ++ DLL .NET COM DLL ( assemblyIdentity), . , .NET COM DLL.
  • DLL mt -managedassemblyname:..., mt -outputresource:..., , Windows .
+5
2

, , .NET COM-: -)

  • : mt -managedassemblyname:"myDll.dll" -out:"myDll.manifest"
  • (. http://msdn.microsoft.com/en-us/library/eew13bza.aspx). , assemblyIdentity, clrClass (, , runtime, mvid dependency).
  • mt -outputresource:"myDll.dll" -manifest "myDll.manifest". DLL. , , -, ()! managedassemblyname, "" . inputresource, .

Windows Vista. Windows XP, , sxstrace, .

+4

, , COM. script .

Visual Studio, .NET-. GUID AutoDispatch.

using System;
using Interop=System.Runtime.InteropServices;

namespace Whatever
{
    [Interop.Guid("xxxxxxxx-9120-4283-b972-changethis05")]
    [Interop.ComVisible(true)]
    [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)]
    public partial class MyClass :
    ...
}

, ( ).

regasm /codebase , , .NET.

javascript .

- , ProgId OleView.exe.

, , .


; . , System.Random, COM- .NET, ++. System.Random ProgId - - "hello, World" ++-to-.NET-via-COM. , , ++ .

-2

All Articles