Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

OBSOLETE

This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.

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
ILparsingResult

Represents status of attempted parsing of IL file created from executing ildasm.exe on a binary

InteropApplicationData
OBSOLETE

This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.

Represents an executable to create an application manifest for

InteropAssemblyData
OBSOLETE

This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.

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
Attributes:
[<Obsolete("This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.")>]
OBSOLETE

This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.

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
Attributes:
[<Obsolete("This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.")>]
OBSOLETE

This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.

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.

copyAssemblyIdAttributeValue(...)
Signature: attributeName:string -> toManifest:XContainer -> fromManifest:XContainer -> unit
copyAssemblyIdName
Signature: XDocument -> XDocument -> unit
copyAssemblyIdVersion
Signature: XDocument -> XDocument -> unit
copyClrClasses toManifest fromManifest
Signature: toManifest:XContainer -> fromManifest:XContainer -> unit
copyElements(...)
Signature: (toManifest:XContainer * toElement:string) -> (fromManifest:XContainer * elementName:string) -> unit
embedManiFestAsync workingDir asyncData
Signature: workingDir:string -> asyncData:Async<string * string> -> Async<unit>

Embeds a manifest file in a binary using mt.exe

getAssemblyIdAttributeValue(...)
Signature: attributeName:string -> manifest:XContainer -> string
GetInteropAssemblyData(...)
Signature: workingDir:string -> assemblies:seq<string> -> InteropAssemblyData list
Attributes:
[<Obsolete("This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.")>]
OBSOLETE

This API is obsolete. There is no alternative in FAKE 5 yet. You can help by porting this module.

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)

ildasmPath
Signature: string

Path to `ildasm.exe .net fx dissasembly tool ref: https://msdn.microsoft.com/en-us/library/f7dy01k1(v=vs.110).aspx

manifestNamespace
Signature: string

XLM namespace of manifest files

mtToolPath
Signature: string

Path to mt.exe ref: https://msdn.microsoft.com/en-us/library/aa375649(v=vs.85).aspx

nsXn(s)
Signature: s:string -> XName

create XName from string with manifest namepace

setAssemblyIdAttributeValue(...)
Signature: attributeName:string -> attributeValue:'?9469 -> manifest:XContainer -> unit
Type parameters: '?9469
setAssemblyName manifest name
Signature: manifest:XContainer -> name:'?9472 -> unit
Type parameters: '?9472
setAssemblyVersion manifest version
Signature: manifest:XContainer -> version:'?9474 -> unit
Type parameters: '?9474
xn(s)
Signature: s:string -> XName

create XName from string without manifest namespace