Note: This API documentation is for FAKE version 4. The migration API documentation can be found here. The API documentation for the new fake 5 modules can be found here

SxsHelper

Module that enables creating and embedding Side-by-Side interop manifests for registration free deployment of Com-.net interop projects

Nested types and modules

TypeDescription
InteropApplicationData

Represents an executable to create an application manifest for

InteropAssemblyData

Represents a .NET assembly that may be used in COM interop projects

Functions and values

Function or valueDescription
AddEmbeddedApplicationManifest(...)
Signature: workingDir:string -> applications:seq<InteropApplicationData> -> unit

Creates and adds application interop side-by-side manifests to provided executables

Parameters

  • workingdir - somewhere to put any temporary files
  • applications - Metadata about executables to create manifests for.
AddEmbeddedAssemblyManifest(...)
Signature: workingDir:string -> assemblies:seq<string> -> unit

Created and embeds assembly Side-by-side interop manifests for provided assemblies

Parameters

  • workingDir - somewhere to put any temp files created
  • assemblies - .net assemblies to create manifests for

Process

This function will use mt.exe (ref: https://msdn.microsoft.com/en-us/library/aa375649(v=vs.85).aspx) to create a manifest for each assembly. This created manifest is unfortunately not a valid interop Side-by-Side manifest, but it has the important clrClass elements, + version and nameinfo that would be the most difficult to create through other means. The important info is then put into a valid base manifest and embedded into the assembly as a resource.

GetInteropAssemblyData(...)
Signature: workingDir:string -> assemblies:seq<string> -> InteropAssemblyData list

Gets name, path',versionand interopGuid` for those of the provided assemblies that have all of the required information.

Parameters

  • workingDir - Somewhere to put temporary files
  • assemblies - assemblies to get data from

Purpose

In order to create application interop side-by-side manifests we need to know some metadata about the assemblies that may be referenced from COM executables. For the manifest we need the assembly version and assembly name. And in addition to that the interop guid is collected so we can determine if the assembly is referenced by vb6 projects

Process

This function is a hack. To avoid using reflection and loading all potential assemblies into the appdomain (with all the possible problems that may cause). I wanted to get this metadata by other means. I ended up using the windows sdk dissasembler ildasm.exe (ref: https://msdn.microsoft.com/en-us/library/f7dy01k1(v=vs.110).aspx) to create the smallest dissasembly I could (Really only need the manifest part), and the parse the IL file to get the metadata (If anyone knows a cleaner / better way, pls improve on the code)