Main Site Documentation

.Net target issue when installing NuGet packages


#1

Hi,

I get the message “Could not install package ‘Microsoft.NETCore.Platforms 1.0.0’. You are trying to install this package into a project that targets ‘.NETFramework,Version=v4.5.2’” when trying to install GHIElectronics.UWP.LowLevelDrivers.0.1.0 from NuGet.

When I created the project it was targeting v.4.6.1 yet the error references v4.5.2.

Any guidance appreciated.

Phil


#2

What type of project are you creating? That package is meant to be used with a UWP app on Windows IoT Core.


#3

Hi John, thanks for the reply. I’m just trying to work through a few tutorials - I got the same message on several of the GHI packages and some of the non-GHI package too.

GHIElectronics.TinyCLR.Core install without a problem as did MySQL.Data, but most others throw the error above.

Phil


#4

The GHIElectronics.UWP.* packages are all meant to be used with Windows IoT Core. They can’t be used with any other project type. You should only be using them if you are using one of the Raspberry Pi hats we previously made.

The GHIElectronics.TinyCLR.* packages are all meant to be used with TinyCLR. They can only be used in project types under C# > TinyCLR or Visual Basic > TinyCLR in Visual Studio. While NuGet will allow you to add other packages to those projects, like MySQL.Data, they will not work correctly. You can only use packages that specifically know about TinyCLR and reference GHIElectronics.TinyCLR.Core.


#5

Ok, thanks John.