-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Reconsider implicitly using the latest patch version of the targeted version of .NET Core in the SDK #983
Comments
My suggestion would be that instead of using <TargetFramework>netcoreapp1.1.1</TargetFramework> Then if we wanted to target 1.1.1 by default, we could just do that in the default template, and it's a lot more obvious to simply retarget to 1.1 than to have to set the |
Alternatively if the patch version is going to implicit to the latest whether the user is ready for it or not should the dotnet execution of the application be more lenient and look for the closet matching runtime and not just fail if the exact version isn't found? |
Pinging on this. I see more work going on for the implicit versioning but I don't understand how this is sustainable. Unless every .NET Core hosting environment, whether on premise or in a Cloud provider, can instantly update as soon as a new patch version is release this will continue to cause deployment pain. Are there plans to make the implicit versioning to latest patch version for netcoreapp frameworks and latest major/patch version for netstandard libraries more discover-able? |
@normj I think the work you're probably seeing for implicit versioning is what we're doing for preview versions of the .NET Core Shared Framework. Would you expect hosting environments to provide a preview version of the shared framework? The reason for the work we're doing for the preview versions of the shared framework is so that you don't have to hard code something like As for the non-preview policy of rolling forward to the latest patch version in the SDK, I don't have any update yet. |
FWIW, I hope to not overload the TFM to include patch versions. I think apps running on a shared framework should only declare the major.minor and have a more advanced knob if they for some reason depend on a patch version. For apps that pull the runtime app local, they should probably get the latest that came with the SDK they are using. @eerhardt is going to provide more input but it is definitely a scenario we need to cover. Devs should be able to get the latest SDK and still, by default, be able to publish apps and run against a major.minor. |
I think the high-level strategy I am landing on here is:
From an implementation perspective, what this means to me is:
This means is we will use the latest NuGet package to build the app in all cases. But shared fx apps can run on any runtime that supports the specified TFM (netcoreapp1.1 in this case). A place where this gets tricky is "How do we give the dev all the right knobs, but still keep it simple?" I could see having 2 separate .csproj properties:
Or we could continue using the 1 property we have today: |
Having a different version in the runtimeconfig.json for shared framework apps than for the NuGet package or for the runtimeconfig.json for a self-contained app worries me a bit. However, it does seem like it might be the best trade-off. As far as having the right knobs, I really hope that a developer having to think about which version of the Microsoft.NETCore.App package should be referenced would be an extremely rare occurrence. I'm also not really happy with the way the |
There is no version in the runtimeconfig.json for self-contained apps. The presence of a name and version in this file is what tells the host if the app is self-contained or not.
This doesn't solve the same problem you list for |
Yes, but my thought is that it probably breaks with a better error experience where you can understand what's happening and fix it. |
Here's an idea: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework targetRuntime="2.0.3" minRuntime="2.0.0">netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project> There are a few ideas here:
|
I like the coupling with the
|
On On There is a question of what should happen if |
Correct on Good point about the string and its relationship to
In the end, |
That makes sense. Agree on the pre-release scenario. Here are some rules:
Effect:
Any reason that this is 2.0+? Certainly, for the 2.0 tools. Any reason why this wouldn't work when targeting 1.x runtimes? |
I think for For 1.x runtimes, I believe there was other logic. I'll say the requirement less strictly. We can't break 1.X apps when they install and start using the 2.0 SDK. |
@Petermarcu I revised the text above (no need to repeat it). Can you check? |
I don't fully understand what you mean by Maybe we should write out the scenarios and what happens? I'm honestly having a hard time parsing it out of the words. Not sure if expanding it is better but it at least forces me to think through the matrix: All scenarios are described in the context of a published application. The default is running on a shared .NET Core 2.0 runtime. Self-contained means that you have decided to publish the runtime with your application. Let's assume the SDK that is being used is the .NET Core 2.0.3 SDK. I'll give it a stab but I will probably not be exhaustive. Neither
|
I meant this case: What happens in that case, if 2.0.3 is installed? All your cases look good. |
If that version doesn't exist, error. If it does, it would be just like my 2.0.4 example I think. |
Correct. That's all I was trying to say initially, referring to your question. We agree. This now needs to get converted to a design doc given the scope of the issue. We should also handle minor version roll-forward (in the case that your version is missing) in that doc. I'd like to post the final result at dotnet/designs (doesn't exist yet). Should we use an approach kinda like this: dotnet/csharplang#386 ? |
Sounds like we're on the same page. I personally think iterating on a design on github is a really unproductive experience. Wish there was a better way to collaborate and iterate on a design. Some type of shared workspace or document. Once everyone is close to the same page on the whole thing, putting it in a more static form like github md makes sense. I'd love to hear how @gafter and @MadsTorgersen to tight iteration on the design docs as they come to a conclusion. |
I think iterating on GitHub issues is the unproductive experience. I'd like to think working on a shared document is better. A PR on a shared branch with room for comments seems like it might work well. I'm hoping that there is something that works well beyond a closed conference room w/a whiteboard. |
I agree with that. Just wish there was something better than what we can do with GitHub. |
Is there an issue / proposal yet for metadata on MSBuild properties? I'd more like to see properties that express the user's intent rather than to add 2 more version properties.
|
This is good feedback. Let's make sure its incorporated into the design discussion wherever @richlander decides to put it. |
@richlander @Petermarcu I just want to highlight that "coupling" additional information to the |
Just adding my vote for @Petermarcu design rules. I'm assuming in the case of Is there ever a time I'm confused about the supported versions. Is the proposal that this runtime determination will only affect netcoreapp2.0 apps? So developers with netcoreapp1.0 will be left in the difficult position they are in now where every patch breaks deployments till their deployment environment is updated with the patch. |
@dsplaisted and I met on this today. I'm in the process of writing up our conclusions. |
FYI: The proposal is close to done. Just wanted folks to know that this is still in the works. |
The proposal has just been posted. I would greatly appreciate your feedback. See https://github.com/dotnet/designs/issues/3. /cc @normj |
I've updated the original issue with the updated plan of record based on https://github.com/dotnet/designs/issues/3 |
as of VS2017 15.2 everyone needs to edit their csproj file with |
…tained apps but not shared framework apps or libraries Fixes dotnet#983
…tained apps but not shared framework apps or libraries Fixes dotnet#983
Fixed by #1222 |
Moving to Package Icon
|
From @eerhardt:
See more comments/discussion on #860.
UPDATE: The current plan of record is now:
More details and discussion can be found here: https://github.com/dotnet/designs/issues/3
When targeting .NET Core 1.x, the 2.0 SDK should continue to roll forward to at least the latest patch that the 1.x SDK rolls forward to, in order to have consistent behavior between the two SDKs.
This means that there's not any concrete work needed to support the new policy until a patch version of 2.0 ships.
The text was updated successfully, but these errors were encountered: