1

I am trying to build a .NET 4.8 Class Library that I can make COM-Visible as a support library from an Access application.

  • There are no prompts for the version of .NET Framework when I create the solution.
  • When I look at the Project Properties, the .NET Framework is set to 5.0.
  • Although I have the .NET Framework 4.8 installed, it does not appear in the combo-box for the Target framework. The only options are shown below.
  • I have also noticed that the Startup object combobox does not reflect the selected startup assembly.

Do I need to drop back to Visual Studio 2017 to create a .NET Framework 4.8 library?

Target framework options

Doug Kimzey
  • 1,019
  • 2
  • 17
  • 32
  • I think this is a new bug/malfeature. I encountered it recently as well. In my case I needed to create a .NET Standard library. I did it by manually editing the project file. – Kevin Krumwiede Jul 08 '21 at 17:40
  • I just noticed something: in my project that I manually changed to .NET Standard 2.0, the dropdown now shows *only* other .NET Standard versions and *not* .NET Core or Framework. Clearly a VS bug. – Kevin Krumwiede Jul 08 '21 at 17:47

2 Answers2

0

Which SDK is installed? If you only have the .net 5 SDK installed, it might suffice for making a .net core 3 app but it will not cover .net Framework.

Install the .net Framework SDK for the version you want to target. And/or install a targeting pack if you want to target .net 4.8 and 4.7.2 for example. (Maybe helpful: What's the difference between the .NET Framework SDK and the Targeting pack)

DasKrümelmonster
  • 5,816
  • 1
  • 24
  • 45
  • This occurs with SDKs installed. It's a regression in a recent VS update. – Kevin Krumwiede Jul 08 '21 at 17:45
  • I installed the the targeting pack for .NET 4.8. The project type is a .NET Framework Class Library and even did a repair on Visual Studio 2019. This changed nothing. I also found that the Startup Project combo box on the Application page of project properties is never populated either. It looks like code to add items for the Targeted framework and Startup object combo boxes only adds default entries. It looks like the only solution is to (1) unload the project solutions (2) edit the XML entry for Targeted Framework and (3) reload the project files (4) look for alternatives to VS2019. – Doug Kimzey Jul 08 '21 at 17:55
  • Oh in that case I guess editing the file is a good solution. You may also try VS 2019 preview or VS 2022 preview. Maybe it's working there. – DasKrümelmonster Jul 08 '21 at 18:04
  • I am using the latest VS2019. This used to work in VS2019 - I am guessing this is an issue in the latest VS2019. – Doug Kimzey Jul 08 '21 at 18:15
0

This happened to me because I had choosen the wrong kind of project. I had choosen a project library for C#, Windows Linux, macOS. By this the same thing, that one could only had .NET 5.0 and higher as Framework. I had to create a new library project with only C# and Windows. Than I could choose all installed .NET frameworks

ThorRose
  • 1
  • 2