Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions tests/FSharp.Test.Utilities/ILVerifierModule.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ module ILVerifierModule =
Commands.executeProcess dotnetExe arguments workingDirectory

let private verifyPEFileCore peverifierArgs (dllFilePath: string) =
let nuget_packages =
match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with
| null ->
let profile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
$"""{profile}/.nuget/packages"""
| path -> path
let peverifyFullArgs = [ yield "exec"; yield $"""{nuget_packages}/dotnet-ilverify/9.0.0/tools/net9.0/any/ILVerify.dll"""; yield "--verbose"; yield dllFilePath; yield! peverifierArgs ]
// Resolve ilverify through the local tool manifest (.config/dotnet-tools.json) rather than a
// hard-coded NuGet cache path. `dotnet tool run` locates the tool wherever it was restored, so
// verification does not depend on the NuGet cache layout, tool version, or target framework.
let peverifyFullArgs = [ yield "tool"; yield "run"; yield "ilverify"; yield "--"; yield "--verbose"; yield dllFilePath; yield! peverifierArgs ]
let workingDirectory = Path.GetDirectoryName dllFilePath
let exitCode, outputText, errorText =
let peverifierCommandPath = Path.ChangeExtension(dllFilePath, ".peverifierCommandPath.cmd")
Expand Down
Loading