-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
additionalProbingPaths uses the current directory instead of directory where .runtimeconfig.json is #72571
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsIt looks like relative paths in As a result, when the application started from a different directory, it fails. I checked the source code and look like it is the case. But I'm not an expert and I would like to double-check that it is correct. If I'm correct then how app supposed to be used in general when the current path could be different from the directory where an executable file is? I found it when I was writing CLR host but it is also reproducible on the usual app. I created a console app and in the different solutions, I created a regular class library project. Then I referenced compiled assembly of the class library from the console app. Then I copied all relevant files to a new directory and added I can provide source code if needed, to save you time. Thank you,
|
Your description is correct. The feature was originally introduced for local "development only" scenarios - SDK would write the property into Also, the feature doesn't work the way most people expect it to (the path it points to is not a simple directory with assemblies, it has to follow the NuGet cache folder structure). Ideally we would change this, but that would be too breaking to do. It's not likely we will be able to change directory behavior as it is a breaking change and the benefits are arguable - yes, it makes it possible to use this to put parts of the app into a different location, but the problem with the weird directory structure remains. We're starting to think about something similar as a general improvement here: #71282 |
Thank you @vitek-karas for checking this. I was wondering why they didn't work in my CLR host. Now I understand that. |
@vladimir-cheverdyuk-altium I would be interested in what kind of changes you made to |
Just to be clear, this code executes in in our native app that loads .NET runtime. I created this block in
then host initialization code reads that block from |
Got it - thanks. |
It looks like relative paths in
additionalProbingPaths
are resolved using the current directory and not a directory where.runtimeconfig.json
is.As a result, when the application started from a different directory, it fails. I checked the source code and look like it is the case. But I'm not an expert and I would like to double-check that it is correct. If I'm correct then how app supposed to be used in general when the current path could be different from the directory where an executable file is?
I found it when I was writing CLR host but it is also reproducible on the usual app. I created a console app and in the different solutions, I created a regular class library project. Then I referenced compiled assembly of the class library from the console app. Then I copied all relevant files to a new directory and added
additionalProbingPaths
. When I start the application from the same directory, it works fine. When I start it from a different directory (for example from absolute path), it fails.I can provide source code if needed, to save you time.
Thank you,
Vlad
The text was updated successfully, but these errors were encountered: