Skip to content
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

New developers don't have to rationalize legacy .NET vs. modern .NET in Visual Studio #5469

Closed
2 tasks
Tracked by #5465
cartermp opened this issue Oct 28, 2020 · 12 comments
Closed
2 tasks
Tracked by #5465
Labels
bulk-closed Epic Groups multiple user stories. Can be grouped under a theme. Priority:0 Work that we can't release without

Comments

@cartermp
Copy link
Contributor

cartermp commented Oct 28, 2020

Summary

New developers getting started with .NET in Visual Studio are faced with having to consider .NET Core and .NET Framework project types. Rationalizing the two is a complex topic that beginners shouldn't have to do.

Instead, new developers should always be guided down the path to modern .NET projects when using Visual Studio.

By default in VS Community, new project templates for .NET should only be modern .NET (.NET 5). By default, .NET Framework project creation will not be enabled. This would be an optional setting that is on by default for non-VS Community SKUs. Existing .NET Framework projects would still load and operate as before.

User Stories

User Stories under this Epic:

@cartermp cartermp added the Epic Groups multiple user stories. Can be grouped under a theme. label Oct 28, 2020
@cartermp cartermp changed the title New developers don't have to rationalize .NET Framework vs. .NET Core in Visual Studio New developers don't have to rationalize legacy .NET vs. modern .NET in Visual Studio Oct 29, 2020
@charlesroddie
Copy link

Installation is a related problem where deprioritizing netframework can help new VS users. For many workloads the VS installer not only installs netframework sdks, but installs multiple versions of it. Making it so that workloads don't include .net framework (ideally), or if they do only include the last version of it, will reduce install size and complexity.

@jmezach
Copy link

jmezach commented Jan 14, 2021

Based on the recent community stand-up I understand that this is scoped to VS Community edition. I would argue that all these choices are still confusing to experienced .NET developers. Having to understand .NET Framework, .NET Standard, .NET Core and .NET 5 and all the differences and similarities between is pretty hard. At least on my team I see many people struggling to understand these things and then having to choose the right project type for example.

@cartermp
Copy link
Contributor Author

@jmezach that's good feedback. At least tentatively I think we may consider applying this kind of work to all SKUs, but the reality is that for VS Enterprise (and Pro) there are a ton of existing developers who use .NET Framework every day. We don't want to take away a critical part of their workflow, which is why this is currently scoped to VS Community. But I anticipate we'll consider what it could look like for all SKUs.

@pjmlp
Copy link

pjmlp commented Jan 17, 2021

@cartermp This is .NET Feature SKU segmentation all over again, no wonder .NET Contracts failed adoption.

Plenty of small shops that fit VS Community license requirements do have .NET Framework projects, it isn't as if the whole .NET world just moved into .NET Core, regardless how Microsoft would wish for it. Heck even UWP and SharePoint have issues keeping up with it.

I am 100% for making beginners lives easier, just not take features away from the rest of us, put them on additional installer options, extra plugs-ins, whatever.

Now if File->New for non-.NET Core projects requires going out buying MSDN Professional licenses, then comparing with what .NET offers to beginners versus what other stacks are doing starts weighting the equation of technology adoption, beginners will quickly stop being beginners after a couple of months, then what? Go out and buy Professional, because some cool project they want to contribute their newly acquired skills is still on .NET Framework for whatever reason.

Unless the whole motivation is to turn Community back into the feature level of the old Express editions, and increase Professional sales.

@dasMulli
Copy link

This is going to make it much harder creating content (from blogs to guides and educational course content) and help (e.g. StackOverflow posts, GH question issues) that apply to all SKUs of Visual Studio.

I‘d rather suggest having „.NET Framework (legacy) development“ as additional workload in the VS installer thus being able to install it on demand when opening a project in VS - i wouldn‘t mind having an installation that doesn‘t install .NET Framework SDKs and targeting packs by default that i don‘t need when only doing .NET 5+ development.

Then the installer could default this workload for non-community SKUs but in the end the behavior of VS is somehow predictable by enabled workloads and not SKU - so even a foot note or instruction „make sure that the XYZ workload is enabled in the VS installer“ helps for all SKUs

@charlesroddie
Copy link

@pjmlp I think you misread the issue. There would be the ability to create these projects under vs community, which "would be an optional setting". Which is exactly what I believe you are advocating "put them under additional installer options...".

The approach that @dasMulli suggets is good.

I think at present netstandard still needs to be there under "modern .net", not just .net5.

@pjmlp
Copy link

pjmlp commented Jan 17, 2021

@charlesroddie That is not what I understood from this week's community call regarding .NET 6 roadmap, hence why decided to post my feedback.

Personally I am not affected, thanks to professional licenses from employers, but I have seen what this kind of SKU splits do to the eco-system adoption versus other language platforms.

So if this was a misunderstanding, sorry about the noise.

@cartermp
Copy link
Contributor Author

I‘d rather suggest having „.NET Framework (legacy) development“ as additional workload in the VS installer thus being able to install it on demand when opening a project in VS - i wouldn‘t mind having an installation that doesn‘t install .NET Framework SDKs and targeting packs by default that i don‘t need when only doing .NET 5+ development.

This is most likely how it would play out.

@dotMorten
Copy link

dotMorten commented Feb 26, 2021

The .NET Blogposts are recommending that for all new work, you should be using .NET Core/5, and not .NET Framework. I'd prefer the project templates clearly conveyed that recommendation.

Removing them completely might be too harsh, but what I would favor (we removed them from our own project template installer as well). Calling it legacy, or only having a single project template and have the wizard guide you towards .NET 5 instead of Framework (but with the framework option listed as legacy) could also work. It's definitely annoying to have both, and I've quite often clicked the wrong one.

Or perhaps just add it to the same project dialog. 4.8 will sound older than 5.0.
image

Would also be nice with a dropdown above that says OS (x-plat, Windows, etc). If you don't pick Windows you won't get .NET Framework option. If you do pick Windows, you'll get 5.0-windows, 5.0-windows10.0.xxxxx.0 as well as .NET Framework at the bottom.

@pjmlp
Copy link

pjmlp commented Feb 26, 2021

Just don't forget those that do new projects with old libraries, not everyone is able to do everything from scratch, and as much as Microsoft would like it to happen, there are still plenty of corporate libraries without a .NET Core version.

. NET Core turned out into our version of Python 3, and will take just as long to move everyone forward.

Corporate developers also have beginners on their trenches.

@dotMorten
Copy link

I modified the WPF Project template to the below and could successfully use it for both .NET 3.1, 5.0 and .NET Framework.
Main trick was adding some entries to Framework and update the condition for UseWindowsDesktopSdk

image

{
  "$schema": "http://json.schemastore.org/template",
  "author": "Microsoft",
  "classifications": ["Common", "WPF"],
  "name": "WPF Application",
  "generatorVersions": "[1.0.0.0-*)",
  "description": "A project for creating a .NET Core WPF Application",
  "groupIdentity": "Microsoft.Common.WPF",
  "precedence": "3000",
  "identity": "Microsoft.Common.WPF",
  "shortName": "wpf",
  "tags": {
    "language": "C#",
    "type": "project"
  },
  "sourceName": "Company.WpfApplication1",
  "preferNameDirectory": true,
  "symbols": {
    "TargetFrameworkOverride": {
      "type": "parameter",
      "description": "Overrides the target framework",
      "replaces": "TargetFrameworkOverride",
      "datatype": "string",
      "defaultValue": ""
    },
    "Framework": {
      "type": "parameter",
      "description": "The target framework for the project.",
      "datatype": "choice",
      "choices": [
        {
          "choice": "netcoreapp3.0",
          "description": "Target netcoreapp3.0"
        },
        {
          "choice": "netcoreapp3.1",
          "description": "Target netcoreapp3.1"
        },
        {
          "choice": "net5.0",
          "description": "Target net5.0"
        },
        {
          "choice": "net461",
          "description": "Target .NET Framework 4.6.1"
        },
        {
          "choice": "net48",
          "description": "Target .NET Framework 4.8.0"
        }          
      ],
      "replaces": "FrameworkParameter",
      "defaultValue": "net5.0"
    },
    "UseWindowsDesktopSdk": {
      "type": "computed",
      "value": "(Framework == \"netcoreapp3.1\" || Framework == \"netcoreapp3.0\" || Framework == \"net461\" || Framework == \"net48\")"
    },
    "langVersion": {
      "type": "parameter",
      "datatype": "text",
      "description": "Sets langVersion in the created project file",
      "defaultValue": "",
      "replaces": "$(ProjectLanguageVersion)"
    },
    "HostIdentifier": {
      "type": "bind",
      "binding": "HostIdentifier"
    },
    "skipRestore": {
      "type": "parameter",
      "datatype": "bool",
      "description": "If specified, skips the automatic restore of the project on create.",
      "defaultValue": "false"
    }
  },
  "primaryOutputs": [
    { "path": "Company.WpfApplication1.csproj" },
    {
      "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
      "path": "MainWindow.xaml.cs"
    },
    { 
      "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
      "path": "MainWindow.xaml"
    }
  ],
  "sources": [
    {
      "modifiers": [
        {
          "condition": "(UseWindowsDesktopSdk)",
          "exclude": [
            "Company.WpfApplication1.csproj"
          ],
          "rename": {
            "Company.WpfApplication3x1.csproj": "Company.WpfApplication1.csproj"
          }
        },
        {
          "condition": "(!UseWindowsDesktopSdk)",
          "exclude": [
            "Company.WpfApplication3x1.csproj"
          ]
        }
      ]
    }
  ],
  "defaultName": "WpfApp1",
  "postActions": [
    {
      "condition": "(!skipRestore)",
      "description": "Restore NuGet packages required by this project.",
      "manualInstructions": [
        { "text": "Run 'dotnet restore'" }
      ],
      "actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
      "continueOnError": true
    },
    {
      "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
      "description": "Opens MainWindow.xaml in the editor",
      "manualInstructions": [ ],
      "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
      "args": {
        "files": "1;2"
      },
      "continueOnError": true
    }
  ]
}

@mairaw
Copy link
Contributor

mairaw commented May 26, 2023

Bulk closing .NET 6 epics and user stories. If you think this issue was closed in error, please reopen the issue and update it accordingly.

@mairaw mairaw closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bulk-closed Epic Groups multiple user stories. Can be grouped under a theme. Priority:0 Work that we can't release without
Projects
None yet
Development

No branches or pull requests

8 participants