NuGet for regfree COM

Jan 23, 2012 at 11:14 AM

Hello,

I have a COM server which is supposed to be used as reg free COM.

This means i have a manifest file describing the reg free COM. A project being referencing the manifest can be compiled and ran without the COM being registered.

I'd like to create a nuget package with this COM server. This means that during the package installation nuget must add the manifest file to the project references. So i created a package which contains the manifest as a lib file. I thought this guarantees adding the files as a project reference. However this doesn't happen. I even explicitly added the manifest as a reference file.

Here comes the nuspec file:

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <version>1.0.0</version>
    <authors>Filimonov</authors>
    <owners />
    <references>
      <reference file="DSCCameraCom.X.manifest" />
    </references>
    <id>ForestGuard.CamLib.Debug</id>
    <title>ForestGuard Camera Library</title>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>The package contains infrastructure binaries</description>
    <copyright>DSC LLC</copyright>
  </metadata>
  <files>
    <file src="bin\Debug\avcodec-53.dll" target="content\avcodec-53.dll" />
    <file src="bin\Debug\avdevice-53.dll" target="content\avdevice-53.dll" />
    <file src="bin\Debug\avfilter-2.dll" target="content\avfilter-2.dll" />
    <file src="bin\Debug\avformat-53.dll" target="content\avformat-53.dll" />
    <file src="bin\Debug\avutil-51.dll" target="content\avutil-51.dll" />
    <file src="bin\Debug\postproc-51.dll" target="content\postproc-51.dll" />
    <file src="bin\Debug\swresample-0.dll" target="content\swresample-0.dll" />
    <file src="bin\Debug\swscale-2.dll" target="content\swscale-2.dll" />
    <file src="bin\Debug\DSCCameraCom.pdb" target="lib\DSCCameraCom.pdb" />
    <file src="bin\Debug\DSCCameraCom.dll" target="lib\DSCCameraCom.dll" />
    <file src="bin\Debug\DSCCameraCom.X.manifest" target="lib\DSCCameraCom.X.manifest" />
  </files>
</package>

Have i done something wrong? Is there any way to add the manifest to project references during the package installation?

 

Jan 23, 2012 at 4:19 PM

You are not doing anything wrong. It's just not supported. Currently we only add .dll, .exe and .winmd files to project references.

What is the format of the .manifest file? Is it a text file or an unmanaged assembly? And does your package target C++ project or .net projects?

Jan 24, 2012 at 5:59 AM

The target is .net projects.

The manifest is a usual manifest file for reg free COM. The content is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="DSCCameraCom.X" version="1.0.0.1"/>
<file name="DSCCameraCom.dll">
<comClass clsid="{9D0D268E-9CCF-4672-907B-A711508B5B0C}" threadingModel = "Apartment" tlbid="{844ADD82-8454-4874-B0CC-D36D84FC99A3}"/>
<typelib tlbid="{844ADD82-8454-4874-B0CC-D36D84FC99A3}" version="1.0" helpdir=""/>
</file>
<comInterfaceExternalProxyStub
name="IDSCCamera"
iid="{C6044566-FBDC-4994-9A13-99CDEF7C5120}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
baseInterface="{00020400-0000-0000-C000-000000000046}"
tlbid="{844ADD82-8454-4874-B0CC-D36D84FC99A3}"
/>
</assembly>

 

Mar 7, 2012 at 9:44 PM

I'd like to make a NuGet for a reg-free COM object too. Is there a known way of doing this?