-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Update all sample code to supported .NET Versions - with automation #22271
Comments
/cc @richlander for visibility |
I think most samples should actually specify two versions:
I think this distinction is important as the "minimum version" tells people where they can expect this to work. There's also the small problem of changes between versions, where the sample may need to change in small way to support the latest version, in which case the "minimum version" gets weird (the feature worked in 2.0, but this sample won't because of some other thing). How to do this technically - I would think that defining an MSBuild property in the root for the "current version" and make all the projects use it. Then when we need to change the "current version" something runs the build with the new value and flags all projects which fail to build as to-be-updated-manually. Additional helpers:
|
Good points @vitek-karas I am concerned about maintaining buildable samples from the version first introduced. Strategically, that can prevent us from updating sample code to show our latest recommendations based on our latest feature investments. One goal of our sample code is to introduce developers (even those experienced with .NET) to the latest features. From a practical standpoint, I'm concerned that some of our samples are first written using public preview versions. I don't think it's useful for readers to know which public preview introduced which feature once the GA release has shipped. For all the samples that are discussed in any of our articles, we do (in text) describe pre-requisites, and include the first version where a feature is available. Even there, we do switch from preview to GA versions once it ships. |
I do agree that it the versions should be GA versions (if at all possible). Not sure if this is for other areas but in the samples I've been involved in - we see lot of people finding the sample directly - or sort of unintentionally ignore the docs which refer to it - so having some level of duplication of info in the samples repo feels desirable. I also understand that this feels like something which will effectively require constant human attention. But maybe it's not such a bad thing to revisit each sample once in cca 1-2 years... |
I think the samples should be oriented around the latest version, both to enable people to easily test and run those apps on the latest version, and to demonstrate new features. Maintaining older versions is challenging, for a few reasons:
|
Our sample projects in all repos (docs, docs-desktop, samples, dotnet-api-docs) where current when they were first created. We didn't (and don't) have a systematic process to update all those projects as older versions move out of support.
Our samples cover many scenarios, some of which rely on code built with older versions. We have a number of scenarios we should support:
It may be that only the first check above can be automated by a tool. If the other scenarios can be identified and reported, we'll learn more about them.
The text was updated successfully, but these errors were encountered: