Skip to content

.NET Runtime 8.0.19 on Windows: library path of / in deps.json searches at root instead of relative to probe paths (additionalProbingPaths) #118846

@GregoFromQinoth

Description

@GregoFromQinoth

Description

I use Visual Studio 2022 Community on Windows OS to create some console & Winforms apps. I usually prepare "release packages" for the users of my apps - .zip files that the users can just extract and run the app without any additional installation aside of .NET Runtime. I often use additionalProbingPaths in runtimeconfig.json to have a dependencies subfolder in the app's main folder to store app's dependencies there.
When I have updated Visual Studio to 17.14.12, .NET SDK 8.0.19 has been installed on my computer and since then, my apps crash because they fail to recognize dependencies subfolder as one to look into despite it being mentioned in additionalProbingPaths:

Image

Here is an example of a very simple Hello World app that crashes in such situation (it references Automapper simply for the sake of showing the issue).

TestDependencies.zip

I have confirmed that the issue doesn't occur on a laptop with Windows OS and .NET Runtime 8.0.11. Installing .NET Runtime 8.0.19 on the laptop introduces the issue.
This issue blocks me from testing my "release packages" on a computer with Visual Studio 2022 Community since it forces me to have .NET Runtime 8.0.19 installed.

Reproduction Steps

  1. Install .NET Runtime 8.0.19.
  2. Download TestDependencies.zip attached above.
  3. Extract it - it will create TestDependencies folder with the TestDependencies.exe app inside.
  4. Open console in TestDependencies folder.
  5. Launch TestDependencies.exe in the console.

Expected behavior

"Hello, World!" should appear in the console.

Actual behavior

The app throws an exception as in the picture attached above

Regression?

It did work with .NET Runtime 8.0.11.

Known Workarounds

  • Put all the dependencies in the main folder of the app? Unconvenient, especially when you have 30+ dependencies you don't want your non-technical app users to deal with.
  • Uninstall Visual Studio 2022 Community each time you want to launch such an app? Even less convenient.
  • Pay for Visual Studio 2022 Professional to choose older build version? No way...

Configuration

  • .NET Runtime 8.0.19
  • Windows 11 Home 24H2 26120.5751, x64

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions