You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/general/dotnet-run-file.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,6 +248,16 @@ The directives are processed as follows:
248
248
(because `ProjectReference` items don't support directory paths).
249
249
An error is reported if zero or more than one projects are found in the directory, just like `dotnet reference add` would do.
250
250
251
+
Directive values support MSBuild variables (like `$(..)`) normally as they are translated literally and left to MSBuild engine to process.
252
+
However, in `#:project` directives, variables might not be preserved during [grow up](#grow-up),
253
+
because there is additional processing of those directives that makes it technically challenging to preserve variables in all cases
254
+
(project directive values need to be resolved to be relative to the target directory
255
+
and also to point to a project file rather than a directory).
256
+
Note that it is not expected that variables inside the path change their meaning during the conversion,
257
+
so for example `#:project ../$(LibName)` is translated to `<ProjectReference Include="../../$(LibName)/Lib.csproj" />` (i.e., the variable is preserved).
258
+
However, variables at the start can change, so for example `#:project $(ProjectDir)../Lib` is translated to `<ProjectReference Include="../../Lib/Lib.csproj" />` (i.e., the variable is expanded).
259
+
In other directives, all variables are preserved during conversion.
260
+
251
261
Because these directives are limited by the C# language to only appear before the first "C# token" and any `#if`,
252
262
dotnet CLI can look for them via a regex or Roslyn lexer without any knowledge of defined conditional symbols
253
263
and can do that efficiently by stopping the search when it sees the first "C# token".
Sets the \f[V]RuntimeIdentifier\f[R] to a platform portable \f[V]RuntimeIdentifier\f[R] based on the one of your machine.
332
-
This happens implicitly with properties that require a \f[V]RuntimeIdentifier\f[R], such as \f[V]SelfContained\f[R], \f[V]PublishAot\f[R], \f[V]PublishSelfContained\f[R], \f[V]PublishSingleFile\f[R], and \f[V]PublishReadyToRun\f[R].
333
-
If the property is set to false, that implicit resolution will no longer occur.
315
+
Sets the verbosity level of the command.
316
+
Allowed values are \f[V]q[uiet]\f[R], \f[V]m[inimal]\f[R], \f[V]n[ormal]\f[R], \f[V]d[etailed]\f[R], and \f[V]diag[nostic]\f[R].
317
+
For more information, see <xref:Microsoft.Build.Framework.LoggerVerbosity>.
\f[B]Thisarticleappliesto:\f[R]\[u2714]\[uFE0F] .NET Core 3.1 SDK and later versions
24
+
\f[B]Thisarticleappliesto:\f[R]\[u2714]\[uFE0F] .NET 6 SDK and later versions
25
25
.PP
26
26
In this article, you\[cq]ll learn about the environment variables used by .NET.
27
27
Some environment variables are used by the .NET runtime, while others are only used by the .NET SDK and .NET CLI.
@@ -178,40 +178,6 @@ To opt-out, set the value to either \f[V]false\f[R] or \f[V]0\f[R].
178
178
.PP
179
179
Starting in .NET 5, this setting to use <xref:System.Net.Http.HttpClientHandler> is no longer available.
180
180
.RE
181
-
.SS\f[V]DOTNET_Jit*\f[R] and \f[V]DOTNET_GC*\f[R]
182
-
.PP
183
-
There are two stressing-related features for the JIT and JIT-generated GC information: JIT Stress and GC Hole Stress.
184
-
These features provide a way during development to discover edge cases and more \[lq]real world\[rq] scenarios without having to develop complex applications.
185
-
The following environment variables are available:
186
-
.IP\[bu]2
187
-
\f[V]DOTNET_JitStress\f[R]
188
-
.IP\[bu]2
189
-
\f[V]DOTNET_JitStressModeNamesOnly\f[R]
190
-
.IP\[bu]2
191
-
\f[V]DOTNET_GCStress\f[R]
192
-
.SS JIT stress
193
-
.PP
194
-
Enabling JIT Stress can be done in several ways.
195
-
Set \f[V]DOTNET_JitStress\f[R] to a non-zero integer value to generate varying levels of JIT optimizations based on a hash of the method\[cq]s name.
196
-
To apply all optimizations set \f[V]DOTNET_JitStress=2\f[R], for example.
197
-
Another way to enable JIT Stress is by setting \f[V]DOTNET_JitStressModeNamesOnly=1\f[R] and then requesting the stress modes, space-delimited, in the \f[V]DOTNET_JitStressModeNames\f[R] variable.
Enabling GC Hole Stress causes GCs to always occur in specific locations and that helps to track down GC holes.
209
-
GC Hole Stress can be enabled using the \f[V]DOTNET_GCStress\f[R] environment variable.
210
-
.PP
211
-
For more information, see Investigating JIT and GC Hole stress (https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/jit/investigate-stress.md).
212
-
.SS JIT memory barriers
213
-
.PP
214
-
The code generator for Arm64 allows all \f[V]MemoryBarriers\f[R] instructions to be removed by setting \f[V]DOTNET_JitNoMemoryBarriers\f[R] to \f[V]1\f[R].
215
181
.SS\f[V]DOTNET_RUNNING_IN_CONTAINER\f[R] and \f[V]DOTNET_RUNNING_IN_CONTAINERS\f[R]
216
182
.PP
217
183
The official .NET images (Windows and Linux) set the well-known environment variables:
@@ -457,11 +423,6 @@ If set to \f[V]1\f[R] (enabled), enables rolling forward to a pre-release versio
457
423
By default (\f[V]0\f[R] - disabled), when a release version of .NET runtime is requested, roll-forward will only consider installed release versions.
458
424
.PP
459
425
For more information, see the \f[V]--roll-forward\f[R] option for the \f[V]dotnet\f[R] command.
0 commit comments