3 people like it.

Build a Visual Studio solution

Builds a Visual Studio solution.

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
#r @"Microsoft.Build"
#r @"Microsoft.Build.Engine"
#r @"Microsoft.Build.Framework"
let buildSolution slnFile (configuration, platform) = 
    let parms = new Microsoft.Build.Execution.BuildParameters(new Microsoft.Build.Evaluation.ProjectCollection())
    let props = new System.Collections.Generic.Dictionary<string, string>()
    props.Add("Configuration", "Debug")
    props.Add("Platform", "x86")
    let req = new Microsoft.Build.Execution.BuildRequestData(slnFile, props, null, [| "Build" |], null)
    Microsoft.Build.Execution.BuildManager.DefaultBuildManager.Build(parms, req);
val buildSolution : slnFile:string -> configuration:'a * platform:'b -> Build.Execution.BuildResult

Full name: Script.buildSolution
val slnFile : string
val configuration : 'a
val platform : 'b
val parms : Build.Execution.BuildParameters
namespace Microsoft
namespace Microsoft.Build
namespace Microsoft.Build.Execution
Multiple items
type BuildParameters =
  new : unit -> BuildParameters + 1 overload
  member BuildThreadPriority : ThreadPriority with get, set
  member Clone : unit -> BuildParameters
  member Culture : CultureInfo with get, set
  member DefaultToolsVersion : string with get, set
  member DetailedSummary : bool with get, set
  member EnableNodeReuse : bool with get, set
  member EnvironmentProperties : IDictionary<string, string>
  member ForwardingLoggers : IEnumerable<ForwardingLoggerRecord> with get, set
  member GetToolset : toolsVersion:string -> Toolset
  ...

Full name: Microsoft.Build.Execution.BuildParameters

--------------------
Build.Execution.BuildParameters() : unit
Build.Execution.BuildParameters(projectCollection: Build.Evaluation.ProjectCollection) : unit
namespace Microsoft.Build.Evaluation
Multiple items
type ProjectCollection =
  new : unit -> ProjectCollection + 4 overloads
  member AddToolset : toolset:Toolset -> unit
  member ContainsToolset : toolsVersion:string -> bool
  member Count : int
  member DefaultToolsVersion : string with get, set
  member DisableMarkDirty : bool with get, set
  member Dispose : unit -> unit
  member GetGlobalProperty : name:string -> ProjectPropertyInstance
  member GetLoadedProjects : fullPath:string -> ICollection<Project>
  member GetToolset : toolsVersion:string -> Toolset
  ...

Full name: Microsoft.Build.Evaluation.ProjectCollection

--------------------
Build.Evaluation.ProjectCollection() : unit
Build.Evaluation.ProjectCollection(toolsetLocations: Build.Evaluation.ToolsetDefinitionLocations) : unit
Build.Evaluation.ProjectCollection(globalProperties: System.Collections.Generic.IDictionary<string,string>) : unit
Build.Evaluation.ProjectCollection(globalProperties: System.Collections.Generic.IDictionary<string,string>, loggers: System.Collections.Generic.IEnumerable<Build.Framework.ILogger>, toolsetDefinitionLocations: Build.Evaluation.ToolsetDefinitionLocations) : unit
Build.Evaluation.ProjectCollection(globalProperties: System.Collections.Generic.IDictionary<string,string>, loggers: System.Collections.Generic.IEnumerable<Build.Framework.ILogger>, remoteLoggers: System.Collections.Generic.IEnumerable<Build.Logging.ForwardingLoggerRecord>, toolsetDefinitionLocations: Build.Evaluation.ToolsetDefinitionLocations, maxNodeCount: int, onlyLogCriticalEvents: bool) : unit
val props : System.Collections.Generic.Dictionary<string,string>
namespace System
namespace System.Collections
namespace System.Collections.Generic
Multiple items
type Dictionary<'TKey,'TValue> =
  new : unit -> Dictionary<'TKey, 'TValue> + 5 overloads
  member Add : key:'TKey * value:'TValue -> unit
  member Clear : unit -> unit
  member Comparer : IEqualityComparer<'TKey>
  member ContainsKey : key:'TKey -> bool
  member ContainsValue : value:'TValue -> bool
  member Count : int
  member GetEnumerator : unit -> Enumerator<'TKey, 'TValue>
  member GetObjectData : info:SerializationInfo * context:StreamingContext -> unit
  member Item : 'TKey -> 'TValue with get, set
  ...
  nested type Enumerator
  nested type KeyCollection
  nested type ValueCollection

Full name: System.Collections.Generic.Dictionary<_,_>

--------------------
System.Collections.Generic.Dictionary() : unit
System.Collections.Generic.Dictionary(capacity: int) : unit
System.Collections.Generic.Dictionary(comparer: System.Collections.Generic.IEqualityComparer<'TKey>) : unit
System.Collections.Generic.Dictionary(dictionary: System.Collections.Generic.IDictionary<'TKey,'TValue>) : unit
System.Collections.Generic.Dictionary(capacity: int, comparer: System.Collections.Generic.IEqualityComparer<'TKey>) : unit
System.Collections.Generic.Dictionary(dictionary: System.Collections.Generic.IDictionary<'TKey,'TValue>, comparer: System.Collections.Generic.IEqualityComparer<'TKey>) : unit
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = System.String

Full name: Microsoft.FSharp.Core.string
System.Collections.Generic.Dictionary.Add(key: string, value: string) : unit
val req : Build.Execution.BuildRequestData
Multiple items
type BuildRequestData =
  new : projectInstance:ProjectInstance * targetsToBuild:string[] -> BuildRequestData + 4 overloads
  member ExplicitlySpecifiedToolsVersion : string with get, set
  member Flags : BuildRequestDataFlags with get, set
  member GlobalProperties : ICollection<ProjectPropertyInstance>
  member HostServices : HostServices with get, set
  member ProjectFullPath : string with get, set
  member ProjectInstance : ProjectInstance with get, set
  member TargetNames : ICollection<string> with get, set

Full name: Microsoft.Build.Execution.BuildRequestData

--------------------
Build.Execution.BuildRequestData(projectInstance: Build.Execution.ProjectInstance, targetsToBuild: string []) : unit
Build.Execution.BuildRequestData(projectInstance: Build.Execution.ProjectInstance, targetsToBuild: string [], hostServices: Build.Execution.HostServices) : unit
Build.Execution.BuildRequestData(projectInstance: Build.Execution.ProjectInstance, targetsToBuild: string [], hostServices: Build.Execution.HostServices, flags: Build.Execution.BuildRequestDataFlags) : unit
Build.Execution.BuildRequestData(projectFullPath: string, globalProperties: System.Collections.Generic.IDictionary<string,string>, toolsVersion: string, targetsToBuild: string [], hostServices: Build.Execution.HostServices) : unit
Build.Execution.BuildRequestData(projectFullPath: string, globalProperties: System.Collections.Generic.IDictionary<string,string>, toolsVersion: string, targetsToBuild: string [], hostServices: Build.Execution.HostServices, flags: Build.Execution.BuildRequestDataFlags) : unit
Multiple items
type BuildManager =
  new : unit -> BuildManager + 1 overload
  member BeginBuild : parameters:BuildParameters -> unit
  member Build : parameters:BuildParameters * requestData:BuildRequestData -> BuildResult
  member BuildRequest : requestData:BuildRequestData -> BuildResult
  member CancelAllSubmissions : unit -> unit
  member EndBuild : unit -> unit
  member GetProjectInstanceForBuild : project:Project -> ProjectInstance
  member PendBuildRequest : requestData:BuildRequestData -> BuildSubmission
  member ResetCaches : unit -> unit
  static member DefaultBuildManager : BuildManager

Full name: Microsoft.Build.Execution.BuildManager

--------------------
Build.Execution.BuildManager() : unit
Build.Execution.BuildManager(hostName: string) : unit
property Build.Execution.BuildManager.DefaultBuildManager: Build.Execution.BuildManager
Build.Execution.BuildManager.Build(parameters: Build.Execution.BuildParameters, requestData: Build.Execution.BuildRequestData) : Build.Execution.BuildResult

More information

Link:http://fssnip.net/gR
Posted:11 years ago
Author:Wallace Kelly
Tags: visual studio , msbuild