-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
--fx-version argument to dotnet exec should apply assembly conflict resolution #3166
Comments
This is by design. We would need to add another flag (e.g. |
An alternative of creating a new flag is to use the latest Semantic Versioning version ranges and wildcards Although this could be a breaking change for some cases, doing this in a major release (3.0) may be acceptable. A version reference such as "1.0.0" would imply >= 1.0.0 (inclusive), so to get only that single version would require "[1.0.0]" If we go down this path, however, it would be inconsistent with other areas that we provide version numbers (runtimeconfig.json, deps.json, etc). |
Another alternative is to support a combination of The default value of However applyPatches only exists as a runtimeconfig.json setting, not a command-line argument. Thus to be complete we would want an Thus the full feature for this alternative:
Example: |
@steveharter I'm not really suggesting a "minimum version" flag for the runtime, or any changes to the roll-forward behavior, etc. The issue here is that specifying a runtime version stops an app being able to ship an updated version of a DLL that's part of the runtime. If I specify I don't know how much the |
The framework version value in the runtimeconfig.json is a "minimum version" by default. It can be greater depending on patch and minor roll forward. The original reason for |
There still seems to be confusion here. Daniel isn't proposing any change to "use this version and only this version", but saying that the conflict resolution must pick the appropriate assembly for an app running on that version. The conflict resolution shouldn't depend on how an app ended up running on a given framework, the newest assembly between app and current framework should win regardless. We had a similar conversation about this for patch roll forward. Where did that land? |
I'll have to investigate, but AFAIK the code to resolve per-file versions runs after all of the frameworks and versions are resolved. So I would expect it to work the same regardless how we determined which framework to use. That is to say, I would expect this to already be fixed. |
@vitek-karas can you check if this has been addressed? |
This should work just fine. I tried to repro this using the repro project above:
AFAIK this is the correct behavior. From an implementation point of view:
It's possible that the |
Thanks. |
Steps to reproduce
dotnet exec --fx-version 2.1.0-rtm-26510-03 path\to\app.dll
.Expected behavior
System.Memory.dll is loaded from the framework folder
Actual behavior
System.Memory.dll is loaded from the publish folder
Justification
If the app were run normally but there was not an available .NET Core 2.0 runtime, it would roll forward to .NET Core 2.1, and the assembly conflict resolution would choose the higher version from the framework folder.
Having the
--fx-version
argument respect the conflict resolution policy would enable testing an app rolled forward to a newer runtime without having to delete the runtime it targets from a machine. It would also make it a lot easier for us to have automated test coverage of the roll-forward behavior.Repro project
@steveharter @weshaggard
The text was updated successfully, but these errors were encountered: