@@ -82,7 +82,7 @@ public async Task DoesNotInstrumentDotnetBuild()
82
82
83
83
using var agent = EnvironmentHelper . GetMockAgent ( useTelemetry : true ) ;
84
84
85
- var logDir = await RunDotnet ( "new console -n instrumentation_test -o . --no-restore" ) ;
85
+ var logDir = await RunDotnet ( "new console -n instrumentation_test -o . --no-restore -f net8.0 " ) ;
86
86
AssertNotInstrumented ( agent , logDir ) ;
87
87
88
88
logDir = await RunDotnet ( "restore" ) ;
@@ -110,14 +110,11 @@ public async Task DoesNotInstrumentExcludedNames(string excludedProcess)
110
110
var workingDir = Path . Combine ( Path . GetTempPath ( ) , Path . GetFileNameWithoutExtension ( Path . GetRandomFileName ( ) ) ) ;
111
111
Directory . CreateDirectory ( workingDir ) ;
112
112
113
- // Hack to ensure that the .NET 8.0 SDK is used instead of .NET 10 as it complains about not finding the runtime
114
- EnsureNet8Sdk ( workingDir ) ;
115
-
116
113
Output . WriteLine ( "Using workingDirectory: " + workingDir ) ;
117
114
118
115
using var agent = EnvironmentHelper . GetMockAgent ( useTelemetry : true ) ;
119
116
120
- var logDir = await RunDotnet ( $ "new console -n { excludedProcess } -o . --no-restore") ;
117
+ var logDir = await RunDotnet ( $ "new console -n { excludedProcess } -o . --no-restore -f net8.0 ") ;
121
118
AssertNotInstrumented ( agent , logDir ) ;
122
119
123
120
var programCs = GetProgramCSThatMakesSpans ( ) ;
@@ -151,14 +148,11 @@ public async Task DoesInstrumentAllowedProcesses(string allowedProcess)
151
148
var workingDir = Path . Combine ( Path . GetTempPath ( ) , Path . GetFileNameWithoutExtension ( Path . GetRandomFileName ( ) ) ) ;
152
149
Directory . CreateDirectory ( workingDir ) ;
153
150
154
- // Hack to ensure that the .NET 8.0 SDK is used instead of .NET 10 as it complains about not finding the runtime
155
- EnsureNet8Sdk ( workingDir ) ;
156
-
157
151
Output . WriteLine ( "Using workingDirectory: " + workingDir ) ;
158
152
159
153
using var agent = EnvironmentHelper . GetMockAgent ( useTelemetry : true ) ;
160
154
161
- var logDir = await RunDotnet ( $ "new console -n { allowedProcess } -o . --no-restore") ;
155
+ var logDir = await RunDotnet ( $ "new console -n { allowedProcess } -o . --no-restore -f net8.0 ") ;
162
156
AssertNotInstrumented ( agent , logDir ) ;
163
157
var programCs = GetProgramCSThatMakesSpans ( ) ;
164
158
@@ -188,14 +182,11 @@ public async Task InstrumentsDotNetTest()
188
182
var workingDir = Path . Combine ( Path . GetTempPath ( ) , Path . GetFileNameWithoutExtension ( Path . GetRandomFileName ( ) ) ) ;
189
183
Directory . CreateDirectory ( workingDir ) ;
190
184
191
- // Hack to ensure that the .NET 8.0 SDK is used instead of .NET 10 as it complains about not finding the runtime
192
- EnsureNet8Sdk ( workingDir ) ;
193
-
194
185
Output . WriteLine ( "Using workingDirectory: " + workingDir ) ;
195
186
196
187
using var agent = EnvironmentHelper . GetMockAgent ( useTelemetry : true ) ;
197
188
198
- var logDir = await RunDotnet ( "new xunit -n instrumentation_test -o . --no-restore" ) ;
189
+ var logDir = await RunDotnet ( "new xunit -n instrumentation_test -o . --no-restore -f net8.0 " ) ;
199
190
AssertNotInstrumented ( agent , logDir ) ;
200
191
201
192
// this _should_ be instrumented so we expect managed data.
@@ -849,17 +840,6 @@ private void AddFilesAsReportable(string logDir, AssertionScope scope, string[]
849
840
} ) ;
850
841
}
851
842
852
- private void EnsureNet8Sdk ( string workingDirectory )
853
- {
854
- var globalJson = @"{
855
- ""sdk"": {
856
- ""version"": ""8.0.0"",
857
- ""rollForward"": ""latestMinor""
858
- }
859
- }" ;
860
- File . WriteAllText ( Path . Combine ( workingDirectory , "global.json" ) , globalJson ) ;
861
- }
862
-
863
843
private bool IsAllLoggingDisabledForBailout ( )
864
844
{
865
845
var isSsi = EnvironmentHelper . CustomEnvironmentVariables . TryGetValue ( "DD_INJECTION_ENABLED" , out var injectionEnabled )
0 commit comments