Windows では、COM dll を登録しなくてもCOM オブジェクトを使用できます。
このメカニズムは、アプリケーションのマニフェストに「依存アセンブリ」を含めることです。
MyProgram.exe.manifest
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyIdentity type="win32" name="myapp.exe" version="1.2.3.4" /> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Contoso.Frobber" version="5.1.81.4" /> </dependentAssembly> </dependency> </assembly>
そして、あなたのフォルダには以下が含まれています:
MyProgram.exe
MyProgram.exe.manifest
RT_MANIFEST
(外部マニフェストを使用している場合。リソースに埋め込むこともできます)Contoso.Frobber.manifest
(COM DLL マニフェスト)confrob.dll
(使用する COM クラスを含む dll)
以下を含む COM dll のアセンブリ マニフェストを使用します。
Contoso.Frobber.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity type="win32" name="Contoso.Frobber" version="1.0.0.0" /> <file name = "confrob.dll"> <comClass progid="Frobber.Gizmo" clsid="{00028C00-0000-0000-0000-000000000046}" description="Gizmo Frobber by Contoso" threadingModel = "Apartment" /> <typelib tlbid="{00028C01-0000-0000-0000-000000000046}" version="1.0" helpdir=""/> </file> </assembly>
優秀な。COM オブジェクトを登録しなくても、(ネイティブまたは .NET) 実行可能ファイルから COM オブジェクトを使用できるようになりました。
COM オブジェクトを登録せずに、ASP.NET Web サイトから COM オブジェクトを使用したいと考えています。
可能?
ボーナスおしゃべり
Windows では、.NET アセンブリを Global Assembly Cache にインストールしなくても、exe で .NET ライブラリを呼び出すこともできます。