How do I force myProject Choose .NetStandard assembly instead of TargetFramework
See original GitHub issueToday , There are Asp.Net (System.Web.HttpContext
) and Asp.Net Core (Microsoft.AspNetCore.Http.HttpContext
) in .net Framework , and there are a few packages use .net Framwork with System.Web.HttpContext
and .net Core (.net standard) with Microsoft.AspNetCore.Http.HttpContext
for sharing source , so when I use Asp.Net Core on .Net Framework , I just can not use that package because that package fouce me to use System.Web.HttpContext
, but there is an available assembly in that package, How do I choose that ?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:29
- Comments:27 (5 by maintainers)
Top Results From Across the Web
NuGet: Force project to chose more specific target ...
NET Standard 1.3 build of my project, instead of the 1.6 build, which fails to restore due to the placeholder items in the...
Read more >Forcing a Specific Target Platform With PackageReference
The short version is to right-click on packages.config and select Migrate Packages.config to PackageReference... . If you just started a new ...
Read more >Targeted .NET Frameworks - Visual Studio (Windows)
In Solution Explorer, open the right-click context menu for the project that you want to change, and then choose Properties. · In the...
Read more >Converting a big project to NET Standard without big bang
The very first step is converting all project files to new project format, leave all project to target full framework, then you can...
Read more >Multi-targetting .Net Framework and .Net Core in a single project
1. Change TargetFramework to TargetFrameworks. Open your csproj file, either by right-clicking on it in Visual Studio, or in another Editor. The ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
suggest to add 2 attributes on
<PackageReference />
TargFramework
choose which dll file to referenceSource
restore from specifiedsouce
ofNuget.Config
I Have the same problem here, I Have a net472 app that requires to be full framework, and I consume a nuget (netStandard2.0), this nuget have a reference for another nuget that provides both net45 and netstandard2.0. Now I’m stuck at using the net45 version cause I can’t control how the targetframework will be choosed. This would not be a problem using packages.config because I could just add a reference to this dependency and choose the targetframework for netstandard2.0 but now using PackageReference this is not possible.
This is definitely PackageReference bug or removed feature (that should have being disclaimed).