ProjectAnalyzer Class

Namespace
Buildalyzer
Base Types
  • object
graph TD Base0["object"]-->Type Type["ProjectAnalyzer"] class Type type-node

Syntax

public class ProjectAnalyzer

Properties

Name Value Summary
BuildLoggers IEnumerable<T>
EnvironmentFactory EnvironmentFactory
EnvironmentVariables IReadOnlyDictionary<TKey, TValue>
The environment variables for MSBuild to be used for every build from this analyzer.
GlobalProperties IReadOnlyDictionary<TKey, TValue>
The global properties for MSBuild to be used for every build from this analyzer.
IgnoreFaultyImports bool
Controls whether empty, invalid, and missing targets should be ignored during project load.
Logger ILogger<ProjectAnalyzer>
Manager AnalyzerManager
ProjectFile ProjectFile
ProjectGuid Guid
Gets a GUID for the project. This checks for a GUID from the solution (if originally provided). If this isn't available, it will generate a UUID GUID by hashing the project path relative to the solution path (so it's repeatable).
ProjectInSolution ProjectInSolution
SolutionDirectory string

Methods

Name Value Summary
AddBinaryLogger(string, BinaryLogger.ProjectImportsCollectionMode) void
AddBuildLogger(Build.Framework.ILogger) void
Adds an MSBuild logger to the build. Note that this may have a large penalty on build performance.
Build() AnalyzerResults
Builds the project without specifying a target framework. In a multi-targeted project this will return a AnalyzerResult for each target framework.
Build(BuildEnvironment) AnalyzerResults
Builds the project without specifying a target framework. In a multi-targeted project this will return a AnalyzerResult for each target framework.
Build(EnvironmentOptions) AnalyzerResults
Builds the project without specifying a target framework. In a multi-targeted project this will return a AnalyzerResult for each target framework.
Build(string) AnalyzerResults
Builds a specific target framework.
Build(string, BuildEnvironment) AnalyzerResults
Builds a specific target framework.
Build(string, EnvironmentOptions) AnalyzerResults
Builds a specific target framework.
Build(string[]) AnalyzerResults
Builds the requested target framework(s).
Build(string[], BuildEnvironment) AnalyzerResults
Builds the requested target framework(s).
Build(string[], EnvironmentOptions) AnalyzerResults
Builds the requested target framework(s).
RemoveBuildLogger(Build.Framework.ILogger) void
Removes an MSBuild logger from the build.
RemoveGlobalProperty(string) void
SetEnvironmentVariable(string, string) void
SetGlobalProperty(string, string) void

Extension Methods

Name Value Summary
AddToWorkspace(Workspace, bool) Project
Adds a project to an existing Roslyn workspace. Note that this will rebuild the project. Use an AnalyzerResult instead if you already have one available.
GetWorkspace(bool) AdhocWorkspace
Gets a Roslyn workspace for the analyzed project. Note that this will rebuild the project. Use an AnalyzerResult instead if you already have one available.