reference .Net framework 4.5.2 from .Net Core 2.0 project

后端 未结 2 1108
栀梦
栀梦 2021-01-19 23:27

I have spent a few hours trying to figure out why .Net Core 2.0 wouldn\'t load .Net framework 4.5.2 nuget packages.

Now I think it\'s time to ask...

What hap

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 00:16

    Related answer: https://stackoverflow.com/a/54116368/10891544

    To target multiple frameworks from a .net core project, open up your .csproj file and replace the TargetFramework tag with a new TargetFrameworks tag:

    net461;netcoreapp2.0

    This should allow you to use .NET Framework packages from a .NET Core project. However, you will lose the ability to run your code cross-platform.

提交回复
热议问题