MSBuildLocator Class

Definition

MSBuildLocator allows the use of publicly visible MSBuild APIs in custom applications. See our documentation at aka.ms/msbuild/locator.

public ref class MSBuildLocator abstract sealed
public static class MSBuildLocator
type MSBuildLocator = class
Public Class MSBuildLocator
Inheritance
MSBuildLocator

Properties

CanRegister

Gets a value indicating whether an instance of MSBuild can be registered.

IsRegistered

Gets a value indicating whether an instance of MSBuild is currently registered.

Methods

QueryVisualStudioInstances()

Query for all Visual Studio instances.

QueryVisualStudioInstances(VisualStudioInstanceQueryOptions)

Query for Visual Studio instances matching the given options.

RegisterDefaults()

Discover instances of Visual Studio and register the first one. See RegisterInstance(VisualStudioInstance).

RegisterInstance(VisualStudioInstance)

Add assembly resolution for Microsoft.Build core dlls in the current AppDomain from the specified instance of Visual Studio. See QueryVisualStudioInstances() to discover Visual Studio instances or use RegisterDefaults().

RegisterMSBuildPath(String)

Add assembly resolution for Microsoft.Build core dlls in the current AppDomain from the specified path.

RegisterMSBuildPath(String[])

Add assembly resolution for Microsoft.Build core dlls in the current AppDomain from the specified path.

Unregister()

Remove assembly resolution previously registered via RegisterInstance(VisualStudioInstance), RegisterMSBuildPath(String), or RegisterDefaults().

Applies to