Skip to content

Commit d7a984c

Browse files
committed
Remove CodeBase per target framework
1 parent 69db9b1 commit d7a984c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

dotnet/src/webdriver/Internal/FileUtilities.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,18 @@ public static string GetCurrentDirectory()
187187
}
188188

189189
string currentDirectory = location!;
190-
191-
190+
#if !NET8_0_OR_GREATER
192191
// If we're shadow copying, get the directory from the codebase instead
193192
if (AppDomain.CurrentDomain.ShadowCopyFiles)
194193
{
195-
#pragma warning disable SYSLIB0012 // Type or member is obsolete
196194
var codeBase = executingAssembly.CodeBase;
197-
#pragma warning restore SYSLIB0012 // Type or member is obsolete
198195

199196
if (codeBase is not null)
200197
{
201198
currentDirectory = Path.GetDirectoryName(codeBase)!;
202199
}
203200
}
201+
#endif
204202

205203
return currentDirectory;
206204
}

0 commit comments

Comments
 (0)