harveysburger / pinnaclewrapper

A C# Wrapper for the PinnacleSports API
25 stars 56 forks source link

Current .Net SDK does not support targetting .NetCore 2.2 #10

Open Eliakos opened 4 years ago

Eliakos commented 4 years ago

Hello,

The complete message is in this screenshot https://cl.ly/8011c529082b, beginning by "Current .Net SDK does not support targetting .NetCore 2.2".

Anyone having an idea how to configure the things?

Thanks in advance

harveysburger commented 4 years ago

Hey, not sure if you have the right sdk installed, the library itself is targeting .netstandard, it should work if called from any .net framework 4.7.2 project OR a .netcore 2.2 project.

The sampleconsole happens to be a .netcore 2.2 project so will only run if you have that installed.

Here is two suggestions, either copy paste all relevant code to a new .netframework 4.7.2 project, OR install the .netcore2.2SDK from here, just pick windows or Linux, pick the sdk to build stuff not the one that gives you only the runtime

https://dotnet.microsoft.com/download

harveysburger commented 4 years ago

The library is also available as a nuget btw so if you start a new 4.7.2 project you can get the nuget, though it s nicer I guess to see the code and such

There is no documentation other than the few examples in the sample console project and 5he markdown readme, the library follows pretty closely the Api documentation from ps3838 and pinnacle.

In any case first step is make sure your can build the thing and run it, the sample console should run as is as long as you have correct sdk installed (as long as you provide a valid ps3838 user)

Let me know how that goes

Eliakos commented 4 years ago

Hi,

I already installed the runtime 2.2 from here https://dotnet.microsoft.com/download/visual-studio-sdks and as you can see here https://cl.ly/379322ab9e1c i already have recent standard .Net installed.

For Nuget, i see version 2.1.0, author anderj017, Nuno Freitas, harveysburger, is it the good one?

Eliakos commented 4 years ago

Apparently, maximum .Net core accepted is 2.1 https://cl.ly/f1dfbcec6084 How do we tell visual studio or the project to use .netcore 2.1 instead of 2.2 as apparently it's the problem?

Eliakos commented 4 years ago

Ok, I followed this article https://dotnetcoretutorials.com/2018/05/01/how-to-target-net-core-2-1/ which drove me here https://dotnet.microsoft.com/download/archives and then i were able to build

Eliakos commented 4 years ago

About the sample app, it's aSampleConsoleApp bringing Program.cs but when we try to execute, we get this => https://cl.ly/5e1ed17bf4f9. Isn't the sample supposed to be an executable project (here a console app if i well understood)?

EDIT : Ok, i had to unload pinnacle wrapper project to give the focus tothe sample app and then it worked. I adapted the appSettings.json values to fit ps3838.com. We'll see if it works all the way

harveysburger commented 4 years ago

In .net core console app dont produce an exe by default. After you compile the project you need to use some command line to basically package the app to target a specific OS, so if you target Windows the publish process will create an exe for you, but you could target other OS

Run the bat file on the sample console project to get the exe on Windows : publish_SampleConsoleApp_exe.bat

If you aren't familiar much with .netcore and don't care for building something cross platform it s probably best to just copy paste the sample code to a new 4.7.2 project, you don't need netcore for the library itself

And yes version 2.1 of the nuget is latest

Btw on your earlier post you mentioned you installed the runtime 2.2, for proper Visual Studio support you need to install the Visual Studio 2017 or 2019 SDK, not just the runtime.

Eliakos commented 4 years ago

Thank you Harvey, Yes i realised about the sdk later on and the problem was resolved. That being said, i had to use release 2.1 as mentioned above.

And yes, you're right, i was thinking the same thing about using nuget instead.