Прочетете на английски

Споделяне чрез


ProjectCollection Constructors

Definition

Creates a project collection with no global properties or loggers. The project collection toolset is initialized from the configuration file and registry.

Overloads

ProjectCollection()

Instantiates a project collection with no global properties or loggers that reads toolset information from the configuration file and registry.

ProjectCollection(ToolsetDefinitionLocations)

Instantiates a project collection using toolsets from the specified locations, and no global properties or loggers. May throw InvalidToolsetDefinitionException.

ProjectCollection(IDictionary<String,String>)

Instantiates a project collection with specified global properties, no loggers, and that reads toolset information from the configuration file and registry. May throw InvalidToolsetDefinitionException.

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, ToolsetDefinitionLocations)

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations. May throw InvalidToolsetDefinitionException.

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean)

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations, node count, and setting of onlyLogCriticalEvents. Global properties and loggers may be null. Throws InvalidProjectFileException if any of the global properties are reserved. May throw InvalidToolsetDefinitionException.

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean, Boolean)

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations, node count, and setting of onlyLogCriticalEvents. Global properties and loggers may be null. Throws InvalidProjectFileException if any of the global properties are reserved. May throw InvalidToolsetDefinitionException.

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean, Boolean, Boolean, Boolean)

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations, node count, and setting of onlyLogCriticalEvents. Global properties and loggers may be null. Throws InvalidProjectFileException if any of the global properties are reserved. May throw InvalidToolsetDefinitionException.

ProjectCollection()

Source:
ProjectCollection.cs

Instantiates a project collection with no global properties or loggers that reads toolset information from the configuration file and registry.

C#
public ProjectCollection();
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public ProjectCollection();
Attributes

Applies to

MSBuild 17 и други версии
Продукт Версии
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

ProjectCollection(ToolsetDefinitionLocations)

Source:
ProjectCollection.cs

Instantiates a project collection using toolsets from the specified locations, and no global properties or loggers. May throw InvalidToolsetDefinitionException.

C#
public ProjectCollection(Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetLocations);
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public ProjectCollection(Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetLocations);

Parameters

toolsetLocations
ToolsetDefinitionLocations

The locations from which to load toolsets.

Attributes

Applies to

MSBuild 17 и други версии
Продукт Версии
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

ProjectCollection(IDictionary<String,String>)

Source:
ProjectCollection.cs

Instantiates a project collection with specified global properties, no loggers, and that reads toolset information from the configuration file and registry. May throw InvalidToolsetDefinitionException.

C#
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties);
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties);

Parameters

globalProperties
IDictionary<String,String>

The default global properties to use. May be null.

Attributes

Remarks

May throw InvalidToolsetDefinitionException.

Applies to

MSBuild 17 и други версии
Продукт Версии
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, ToolsetDefinitionLocations)

Source:
ProjectCollection.cs

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations. May throw InvalidToolsetDefinitionException.

C#
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties, System.Collections.Generic.IEnumerable<Microsoft.Build.Framework.ILogger> loggers, Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetDefinitionLocations);
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties, System.Collections.Generic.IEnumerable<Microsoft.Build.Framework.ILogger> loggers, Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetDefinitionLocations);

Parameters

globalProperties
IDictionary<String,String>

The default global properties to use. May be null.

loggers
IEnumerable<ILogger>

The loggers to register. May be null.

toolsetDefinitionLocations
ToolsetDefinitionLocations

The locations from which to load toolsets.

Attributes

Remarks

May throw InvalidToolsetDefinitionException.

Applies to

MSBuild 17 и други версии
Продукт Версии
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean)

Source:
ProjectCollection.cs

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations, node count, and setting of onlyLogCriticalEvents. Global properties and loggers may be null. Throws InvalidProjectFileException if any of the global properties are reserved. May throw InvalidToolsetDefinitionException.

C#
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties, System.Collections.Generic.IEnumerable<Microsoft.Build.Framework.ILogger> loggers, System.Collections.Generic.IEnumerable<Microsoft.Build.Logging.ForwardingLoggerRecord> remoteLoggers, Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetDefinitionLocations, int maxNodeCount, bool onlyLogCriticalEvents);

Parameters

globalProperties
IDictionary<String,String>

The default global properties to use. May be null.

loggers
IEnumerable<ILogger>

The loggers to register. May be null and specified to any build instead.

remoteLoggers
IEnumerable<ForwardingLoggerRecord>

Any remote loggers to register. May be null and specified to any build instead.

toolsetDefinitionLocations
ToolsetDefinitionLocations

The locations from which to load toolsets.

maxNodeCount
Int32

The maximum number of nodes to use for building.

onlyLogCriticalEvents
Boolean

If set to true, only critical events will be logged.

Remarks

Throws InvalidProjectFileException if any of the global properties are reserved.

Applies to

MSBuild 17 и други версии
Продукт Версии
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean, Boolean)

Source:
ProjectCollection.cs

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations, node count, and setting of onlyLogCriticalEvents. Global properties and loggers may be null. Throws InvalidProjectFileException if any of the global properties are reserved. May throw InvalidToolsetDefinitionException.

C#
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties, System.Collections.Generic.IEnumerable<Microsoft.Build.Framework.ILogger> loggers, System.Collections.Generic.IEnumerable<Microsoft.Build.Logging.ForwardingLoggerRecord> remoteLoggers, Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetDefinitionLocations, int maxNodeCount, bool onlyLogCriticalEvents, bool loadProjectsReadOnly);

Parameters

globalProperties
IDictionary<String,String>

The default global properties to use. May be null.

loggers
IEnumerable<ILogger>

The loggers to register. May be null and specified to any build instead.

remoteLoggers
IEnumerable<ForwardingLoggerRecord>

Any remote loggers to register. May be null and specified to any build instead.

toolsetDefinitionLocations
ToolsetDefinitionLocations

The locations from which to load toolsets.

maxNodeCount
Int32

The maximum number of nodes to use for building.

onlyLogCriticalEvents
Boolean

If set to true, only critical events will be logged.

loadProjectsReadOnly
Boolean

If set to true, load all projects as read-only.

Applies to

MSBuild 17 и други версии
Продукт Версии
MSBuild 16, 17
MSBuild (.NET Core) 16, 17

ProjectCollection(IDictionary<String,String>, IEnumerable<ILogger>, IEnumerable<ForwardingLoggerRecord>, ToolsetDefinitionLocations, Int32, Boolean, Boolean, Boolean, Boolean)

Source:
ProjectCollection.cs

Instantiates a project collection with specified global properties and loggers and using the specified toolset locations, node count, and setting of onlyLogCriticalEvents. Global properties and loggers may be null. Throws InvalidProjectFileException if any of the global properties are reserved. May throw InvalidToolsetDefinitionException.

C#
public ProjectCollection(System.Collections.Generic.IDictionary<string,string> globalProperties, System.Collections.Generic.IEnumerable<Microsoft.Build.Framework.ILogger> loggers, System.Collections.Generic.IEnumerable<Microsoft.Build.Logging.ForwardingLoggerRecord> remoteLoggers, Microsoft.Build.Evaluation.ToolsetDefinitionLocations toolsetDefinitionLocations, int maxNodeCount, bool onlyLogCriticalEvents, bool loadProjectsReadOnly, bool useAsynchronousLogging, bool reuseProjectRootElementCache);

Parameters

globalProperties
IDictionary<String,String>

The default global properties to use. May be null.

loggers
IEnumerable<ILogger>

The loggers to register. May be null and specified to any build instead.

remoteLoggers
IEnumerable<ForwardingLoggerRecord>

Any remote loggers to register. May be null and specified to any build instead.

toolsetDefinitionLocations
ToolsetDefinitionLocations

The locations from which to load toolsets.

maxNodeCount
Int32

The maximum number of nodes to use for building.

onlyLogCriticalEvents
Boolean

If set to true, only critical events will be logged.

loadProjectsReadOnly
Boolean

If set to true, load all projects as read-only.

useAsynchronousLogging
Boolean

If set to true, asynchronous logging will be used. Dispose() has to called to clear resources used by async logging.

reuseProjectRootElementCache
Boolean

If set to true, it will try to reuse Microsoft.Build.Evaluation.ProjectRootElementCacheBase singleton.

Applies to

MSBuild 17 и MSBuild (.NET Core) 17
Продукт Версии
MSBuild 17
MSBuild (.NET Core) 17