I am referring to a sample ASP.NET core MVC solution. I want to know how do I have both .NetCoreApp 1.0 and .NETFramework 4.5.2 dependencies structure included to the solution as shown in the below image? Where do I add/organise the structure in that way?
1 Answer
It is best described here with the key difference being the TargetFramework to TargetFrameworks in your csproj file. You can edit it by right clicking on it or via the file system. See below for TargetFramework (ie targeting one framework):
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
See below for targeting multiple frameworks:
<PropertyGroup>
<TargetFrameworks>netstandard1.4;net40;net45</TargetFrameworks>
</PropertyGroup>
When targeting multiple frameworks your visual studio project structure will adjust to be like in the image you have.
You will also find the error process is a bit different when working in the IDE where it will take the perspective of one of the framework targets as a default in the IDE. When you build it may generate errors despite not showing you the error in the code editor (because the code editor might show framework but you may get netstandard compile errors etc). If you are concious of that, then its not an issue, but it did stump me at first.
