diff --git a/documentation/wiki/MSBuild-Environment-Variables.md b/documentation/wiki/MSBuild-Environment-Variables.md index 01c8b7fb66c..39daa716718 100644 --- a/documentation/wiki/MSBuild-Environment-Variables.md +++ b/documentation/wiki/MSBuild-Environment-Variables.md @@ -1,12 +1,33 @@ -# MSBuild environment variables +# MSBuild environment variables list -- [MsBuildSkipEagerWildCardEvaluationRegexes](#msbuildskipeagerwildcardevaluationregexes) +This document describes the environment variables that are respected in MSBuild, its purpose and usage. +Some of the env variables listed here are unsupported, meaning there is no guarantee that variable or a specific combination of multiple variables will be respected in upcoming release, so please use at your own risk. -### MsBuildSkipEagerWildCardEvaluationRegexes +* `MSBuildDebugEngine=1` & `MSBUILDDEBUGPATH=` + * Set this to cause any MSBuild invocation launched within this environment to emit binary logs and additional debugging information to ``. Useful when debugging build or evaluation issues when you can't directly influence the MSBuild invocation, such as in Visual Studio. More details on [capturing binary logs](./Providing-Binary-Logs.md) +* `MSBUILDTARGETOUTPUTLOGGING=1` + * Set this to enable [printing all target outputs to the log](https://learn.microsoft.com/archive/blogs/msbuild/displaying-target-output-items-using-the-console-logger). +* `MSBUILDLOGTASKINPUTS=1` + * Log task inputs (not needed if there are any diagnostic loggers already). + * `MSBUILDEMITSOLUTION=1` + * Save the generated .proj file for the .sln that is used to build the solution. The generated files are emitted into a binary log by default and their presence on disk can break subsequent builds. +* `MSBUILDENABLEALLPROPERTYFUNCTIONS=1` + * Enable [additional property functions](https://devblogs.microsoft.com/visualstudio/msbuild-property-functions/). If you need this level of detail you are generally served better with a binary log than the text log. +* `MSBUILDLOGVERBOSERARSEARCHRESULTS=1` + * In ResolveAssemblyReference task, log verbose search results. +* `MSBUILDLOGCODETASKFACTORYOUTPUT=1` + * Dump generated code for task to a .txt file in the TEMP directory +* `MSBUILDDISABLENODEREUSE=1` + * Set this to not leave MSBuild processes behind (see `/nr:false`, but the environment variable is useful to also set this for Visual Studio for example). +* `MSBUILDLOGASYNC=1` + * Enable asynchronous logging. +* `MSBUILDDEBUGONSTART=1` + * Launches debugger on build start. Works on Windows operating systems only. + * Setting the value of 2 allows for manually attaching a debugger to a process ID. This works on Windows and non-Windows operating systems. +* `MSBUILDDEBUGSCHEDULER=1` & `MSBUILDDEBUGPATH=` + * Dumps scheduler state at specified directory (`MSBUILDDEBUGSCHEDULER` is implied by `MSBuildDebugEngine`). -If specified, overrides the default behavior of glob expansion. - -During glob expansion, if the path with wildcards that is being processed matches one of the regular expressions provided in the [environment variable](#msbuildskipeagerwildcardevaluationregexes), the path is not processed (expanded). - -The value of the envvironment variable is a list of regular expressions, separated by semilcon (;). \ No newline at end of file +* `MsBuildSkipEagerWildCardEvaluationRegexes` + * If specified, overrides the default behavior of glob expansion. During glob expansion, if the path with wildcards that is being processed matches one of the regular expressions provided in the [environment variable](#msbuildskipeagerwildcardevaluationregexes), the path is not processed (expanded). + * The value of the environment variable is a list of regular expressions, separated by semicolon (;). \ No newline at end of file diff --git a/documentation/wiki/MSBuild-Tips-&-Tricks.md b/documentation/wiki/MSBuild-Tips-&-Tricks.md index 94b9ec2f91b..17b137ae33d 100644 --- a/documentation/wiki/MSBuild-Tips-&-Tricks.md +++ b/documentation/wiki/MSBuild-Tips-&-Tricks.md @@ -6,37 +6,22 @@ See the [MSBuild Command-Line Reference](https://learn.microsoft.com/visualstudi * `MSBuild.exe -nr:false` * Disable node reuse (`/nodeReuse:false`). Don't leave MSBuild.exe processes hanging around (and possibly locking files) after the build completes. See more details in MSBuild command line help (/?). See also `MSBUILDDISABLENODEREUSE=1` below. Note that using this when building repeatedly will cause slower builds. * `MSBuild.exe -bl` - * Records all build events to a structured binary log file. The [MSBuildStructuredLog](https://github.com/KirillOsenkov/MSBuildStructuredLog) tool can be used to analyze this file. + * Records all build events to a structured [binary log file](./Providing-Binary-Logs.md). The [MSBuildStructuredLog](https://github.com/KirillOsenkov/MSBuildStructuredLog) tool can be used to analyze this file. * `MSBuild.exe -noconlog` * Used to suppress the usage of the console logger, which is otherwise always attached. * `MSBuild.exe -flp:v=diag` * Passes parameters to the file logger. If you want to attach multiple file loggers, you do so by specifying additional parameters in the switches /flp1, /flp2, /flp3, and so on. + +# Building MSBuild + +The documentation on building MSBuild: +- [Full Framework MSBuild](./Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md) +- [.Net Core MSBuild](./Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md) + # Environment Variables - * `MSBuildDebugEngine=1` & `MSBUILDDEBUGPATH=` - * Set this to cause any MSBuild invocation launched within this environment to emit binary logs and additional debugging information to ``. Useful when debugging build or evaluation issues when you can't directly influence the MSBuild invocation, such as in Visual Studio. - * `MSBUILDTARGETOUTPUTLOGGING=1` - * Set this to enable [printing all target outputs to the log](https://learn.microsoft.com/archive/blogs/msbuild/displaying-target-output-items-using-the-console-logger). - * `MSBUILDLOGTASKINPUTS=1` - * Log task inputs (not needed if there are any diagnostic loggers already). - * `MSBUILDEMITSOLUTION=1` - * Save the generated .proj file for the .sln that is used to build the solution. - * `MSBUILDENABLEALLPROPERTYFUNCTIONS=1` - * Enable [additional property functions](https://devblogs.microsoft.com/visualstudio/msbuild-property-functions/). - * `MSBUILDLOGVERBOSERARSEARCHRESULTS=1` - * In ResolveAssemblyReference task, log verbose search results. - * `MSBUILDLOGCODETASKFACTORYOUTPUT=1` - * Dump generated code for task to a .txt file in the TEMP directory - * `MSBUILDDISABLENODEREUSE=1` - * Set this to not leave MSBuild processes behind (see `/nr:false` above, but the environment variable is useful to also set this for Visual Studio for example). - * `MSBUILDLOGASYNC=1` - * Enable asynchronous logging. - * `MSBUILDDEBUGONSTART=1` - * Launch debugger on build start. - * Setting the value of 2 allows for manually attaching a debugger to a process ID. - * `MSBUILDDEBUGSCHEDULER=1` & `MSBUILDDEBUGPATH=` - * Dumps scheduler state at specified directory (`MSBUILDDEBUGSCHEDULER` is implied by `MSBuildDebugEngine`). +The list of environment variables could be found [here](./MSBuild-Environment-Variables.md) # TreatAsLocalProperty If MSBuild.exe is passed properties on the command line, such as `/p:Platform=AnyCPU` then this value overrides whatever assignments you have to that property inside property groups. For instance, `x86` will be ignored. To make sure your local assignment to properties overrides whatever they pass on the command line, add the following at the top of your MSBuild project file: