or-tools: Google.OrTools netstandard packages failing to install correctly in net472
I have some .NET Framework targeted unit tests which I am updating from net45x
to net472
.
Others of my projects making the adjustment to netstandard2.0
work fine, but the Google.OrTools
package is failing to add as a reference to my project following install.
Additionally, all of the run-times are being added as package references, when I think I should only be seeing the Windows package.
Consequently, any references to OrTools
bits in the test assemblies are broken. Google.Protobuf
package reference seems to be working okay, but I half expected that it would be fine.
For reference, kindly see my OrTools wrappers. Currently published versions are pre-netstandard2.0
updates. I’ve got those updates in the works.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (15 by maintainers)
I have successfully been using the latest NuGet package within a .NET 4.7.2 project. The “trick” is to follow the advice by Scott Hanselmann here https://www.hanselman.com/blog/ReferencingNETStandardAssembliesFromBothNETCoreAndNETFramework.aspx
You need to add the node
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
within the first<PropertyGroup>
of your csproj file.Hmm, I am receiving
FileNotFoundException
andBadImageFormatException
exceptions.I am building for
AnyCPU
, but I wonder should I build forx64
?