NuGet for regfree COM

Jan 23, 2012 at 12:14 PM


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="">
    <owners />
      <reference file="DSCCameraCom.X.manifest" />
    <title>ForestGuard Camera Library</title>
    <description>The package contains infrastructure binaries</description>
    <copyright>DSC LLC</copyright>
    <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" />

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


Jan 23, 2012 at 5: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 6: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=""/>
<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=""/>


Mar 7, 2012 at 10:44 PM

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