Referenced library missing from dll manifest RRS feed

  • Question

  • I am working in VS2010 on a .NET 2.0 class library (lets call it class library A) that is part of a solution containing many .NET 2.0 class libraries (B,C..).

    Class library A has a reference to B.

    An application uses class library A by loading the assembly of A, and adding things from its manifest into the current application domain.

    It does this by overriding the AssemblyResolve event (which fires when the assembly cannot be found) and loading the library for B by reading it from the manifest's stream of A.

    This works for all of the other class libraries that are referenced like this.

    For some reason, class library B (although referenced in the manifest of A) is not embedded in the manifest of A

    I have a class lib C that includes a reference to class lib B and successfully loads as described above.

    Both class lib A and class lib C have the following:
    .assembly extern FluorineFx
      .ver 1:0:0:15

    In the manifest for C there is a .mresource for lib B, which is missing in lib A's manifest:
    .mresource public ClassLibB.FluorineFx.dll
      // Offset: 0x00000000 Length: 0x000EC000


    Wednesday, August 21, 2013 6:31 PM


  • References listed in VS aren't the same as the runtime dependencies.  The references you specify in VS only tell the compiler what assemblies to use for resolving types.  During compilation the compiler tracks what assemblies are actually used based upon the types referenced.  If no types from an assembly are used then that assembly will not be considered a dependency of the compiled assembly and you won't find any metadata information for it.  The only way to force the dependency is to reference at least 1 type in the assembly.

    Michael Taylor

    Wednesday, August 21, 2013 7:12 PM