1

I'm trying to work with Visual Studio 2017. And maybe someone worked also with? I could not find much help for now.

So, I created a project as .NET Core Class Library.

In Visual Studio 2015 there were those project.json files containing the information with the target-frameworks. I could do s.th like:

"frameworks": {
    "netstandard1.5": { ...
      },
    "netstandard1.6": { ...
      },
    "netcoreapp1.0": { ...
      },
    "net45": { ...
      },
    "net451": { ...
      }
} and so on

now I created that project and there is that old *.csproj xml-file.

  • Isn't it possible to use the json-file again?

The xml uses:

<PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
  • Is it possible to add here more frameworks? Like Net45 and Net451,...?

    • If yes: How can I add the other (and old) dependencies? Like System.Data?

    • If no: How can I publish a project in Nuget with different frameworks? Copy/Paste project and change everything doesn't make much sense, I think.

Matthias Burger
  • 5,549
  • 7
  • 49
  • 94
  • this is also discussed in http://stackoverflow.com/questions/42670048/how-to-target-multiple-frameworks-in-vs2017-final?rq=1 (is a part of the question) – Matthias Burger Mar 23 '17 at 09:54

1 Answers1

3

Isn't it possible to use the json-file again?

As far as I know, we could not use the project.json file in Visual Studio 2017. Because .Net Core is going to be based on msbuild, which means that it's going to use *.csproj instead of project.json.

Is it possible to add here more frameworks? Like Net45 and Net451,...?

Yes, Multi framework targetting is supported by the .net core in Visual Studhio 2017. We could add the net451,net461 in the TargetFramework:

  <PropertyGroup>
    <TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
  <PropertyGroup>

If yes: How can I add the other (and old) dependencies? Like System.Data?

When you add the net461 TargetFramework, nuget will restore the packages automatically. After the recovery is complete, you will see the system.data.dll is added to the References:

enter image description here

Hope this can help you.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135