Could not install package 'Dapper 2.0.4'
Could not install package 'Dapper 2.0.4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
What version of NuGet tooling or Visual Studio are you using? If it's not reconciling netstandard2.0 as viable for net472, that indicates an old version of NuGet tooling...so let's start there :)
2.* changed the TFM to NetStandard, but we acknowledge that we're probably going to have to re-add net461 (and then an explicit net472 too, to undo the net461 oddness). We'll probably have a new build out in a few days (timed with netcore 3 rtm)
On Sat, 21 Sep 2019, 13:53 Nick Craver, [email protected] wrote:
What version of NuGet tooling or Visual Studio are you using? If it's not reconciling netstandard2.0 as viable for net472, that indicates an old version of NuGet tooling...so let's start there :)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/StackExchange/Dapper/issues/1332?email_source=notifications&email_token=AAAEHMC43PNWTMZEXPG2ZRTQKYKNXA5CNFSM4IY4UK32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7IRIDI#issuecomment-533795853, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAEHMHUMAOADBXZESXN4CDQKYKNXANCNFSM4IY4UK3Q .
.Net 3.0 was released 3 days ago, hope that new version will be released soon
Having a dependency on netstandard2.0 seems like a good fit for net462 (I know, I also did this some time ago, based on the promise of netstandard2.0 ~ net462, which is only mostly true), but the problem is that it brings in a netstandard dependency for the entire project, which ends up with assemblies being loaded from the netstandard reference despite the project wishing to rather use a nuget package.
For example, the netstandard2.0 dependency makes msbuild select Reference:System.Xml.XPath.XDocument over the installed nuget package, meaning it selects version 4.1.0.0 over the nuget-installed 4.0.2.0, and suggests that I assembly-rebind to resolve the issue. The problem comes in that now I have to ensure that my CI server has netstandard installed, and my production server also has netstandard installed. If I just do assembly rebinds to point at the facades brought in from netstandard, then if those facades are not available at my CI server, the rebinds will fail to resolve when the project is deployed to my prod server.
This issue becomes compounded in that it will require upgrades on my CI and prod servers every time I upgrade dotnet core on my machine, or I'll have to attempt to ignore the warnings at my own peril.
The new-style .csproj layout makes it trivial to multi-target, by simply specifying, eg: <TargetFrameworks>netstandard2.0;net462;net461</TargetFrameworks>. It takes a couple of seconds to do and saves all the headaches for the end consumer. Please resolve as soon as possible.
Yes, I understand all the details here all too well. We'll try to get a new build out soon.
To clarify for others: it's not that trivial since you need to sort your dependencies, figure out what's minimal, address what things you need to #if def, etc. For example, leaving any package references on which exist in full framework is extra baggage a user doesn't need, etc. And to have any confidence, you need to test all TFMs, which can mean changing build agents images, more installers, fixing test artifacts, and so on.
But we really get the pain here. We've spent countless hours discussing this with various Microsoft teams. That's why we're reverting it - the ecosystem isn't ready to move to netstandard-only just yet.
A build of 2.0.25 is up on the Dapper MyGet feed (and also the Stack Overflow MyGet feed). It's not on NuGet because we haven't dogfooded it on Stack Overflow yet. We'll try our best to do that tomorrow, then it'll be pushed to NuGet.
See 2.0.30
To clarify for others: it's not that trivial since you need to sort your dependencies, figure out what's minimal, address what things you need to
#ifdef, etc. For example, leaving any package references on which exist in full framework is extra baggage a user doesn't need, etc. And to have any confidence, you need to test all TFMs, which can mean changing build agents images, more installers, fixing test artifacts, and so on.
Whilst I get the need to test all targets, the package dependency part should be resolved with dotnet pack on a modern .csproj. But thanks for getting on this -- it's appreciated.
I've literally spent days tracking down build warnings about "required" assembly rebindings (as mentioned above), so my apologies for coming across as frustrated -- I simply was.