I need to create a cross-framework project (.NET 5 + full .NET framework 4.7.2). Can you please let me know how to do this? As I know .NET Standard library is already included in .NET Core.
Asked
Active
Viewed 246 times
2 Answers
1
Assuming this is a library project, you could either use a netstandard target (in the project csproj):
<TargetFramework>netstandard2.0</TargetFramework>
or multi-target:
<TargetFrameworks>net472;net5.0</TargetFrameworks>
The latter has the advantage of allowing you to use newer features when available, by using things like:
#if NET5_0_OR_GREATER
// up-level version
#else
// down-level version
#endif

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
0
Write all the code you want to share as .NET Standard library. Then use this library in projects that target specific framework. .NET Standard isn't "included" in .Net Core, it's rather a target that allows you to share code between core and framework

Jakoss
- 4,647
- 2
- 26
- 40