0

I'm working on an older project that was built with .NET Framework not .NET Core. I have not previously worked too much C#. My understanding is that you can use vscode for it but getting it running has been difficult. When I run dotnot --list-sdks or --list-runtimes it only shows .NET Core. This link seems to indicate that shouldn't be the case. dotnet sdk check also only lists core SDKs.

How do I get the dotnet command to correctly show installed .NET Framework SDKs in C:\Windows\Microsoft.NET\Framework\v4.0.30319?

Getting this running appears to be a prerequisite for getting the build sequence in vscode to correctly run as right now even with global.json set correctly vscode only sees .net core and complains on build.

Guru Stron
  • 102,774
  • 10
  • 95
  • 132
Grant Curell
  • 1,321
  • 2
  • 16
  • 32
  • 1
    I'm afraid that won't work, the `dotnet` commands are only relevant to .net core, not Framework. Same for `global.json`, it only applies to core. Not sure what on that page leads you to think it is applicable to Framework? – jmoerdyk Mar 03 '23 at 00:25
  • You may already be aware of this... This [link](https://code.visualstudio.com/docs/languages/csharp) says VSCode has limited support for .NET Framework ... _"Due to this focus, many standard C# project types are not recognized by VS Code. An example of a non-supported project type is an ASP.NET MVC Application.... if you want to have a lightweight tool to edit a file - VS Code has you covered. If you want the best possible experience for those projects and development on Windows in general, **we recommend Visual Studio Community**."_ – quaabaam Mar 03 '23 at 00:25
  • @quaabaam I wasn't. I just jumped into the deep end today and honestly the whole thing has been a bit confusing starting with having to figure out Microsoft's not particularly intuitive distinction between .net framework and .net core. Reminds me heavily of the way PS7 exists, doesn't come on anything, they want you to move to it, but writing code for it means it works on literally nothing unless you have admins go out of their way to install it. Complaining complete - if you make your comment an answer I'll mark it. – Grant Curell Mar 03 '23 at 00:42
  • @jmoerdyk I got confused - somewhere along the way I thought I read that versions prior to 5 or something were framework and newer were core? Sounds like I got that wrong. – Grant Curell Mar 03 '23 at 00:42
  • No, That's where the versioning is completely confusing, Framework predates _any_ version of Core. – jmoerdyk Mar 03 '23 at 00:45

2 Answers2

2

The VSCode page says there is limited support for .NET Framework with VSCode, and they recommend Visual Studio Community.

"... many standard C# project types are not recognized by VS Code. An example of a non-supported project type is an ASP.NET MVC Application.... if you want to have a lightweight tool to edit a file - VS Code has you covered. If you want the best possible experience for those projects and development on Windows in general, we recommend Visual Studio Community."

quaabaam
  • 1,808
  • 1
  • 7
  • 15
2

This link seems to indicate that shouldn't be the case.

It actually indicates that this should be the case:

This article applies to: ✔️ .NET 6 and later versions

.NET Framework is an older iteration of the runtime (initially released in 2002, targeted Windows) which has release versions from 1.0 to 4.8.1 ATM (docs)

.NET 6 is current LTS of the new iteration of the runtime (huge rewrite was made, with goal to significantly improve it and make it cross-platform, initial release in 2016), which was called originally .NET Core (release versions from 1.0 till 3.1 were called .NET Core, 4th version was skipped to prevent at least some confusion and versions from .NET 5 are skipping the Core part in their names - docs)

Basically dotnet is CLI tool for newer iteration of runtime and should be used only for it.

So answer to:

How do I get the dotnet command to correctly show installed .NET Framework SDKs

Is - you don't.

Read more:

Guru Stron
  • 102,774
  • 10
  • 95
  • 132