I'm trying to add the OpenTK v2.0.0 package to my project.
If I create a project of type "Class Library (.NET Framework)" and I add OpenTK v2.0.0 using the "Manage Package for Solution", everything works well.
If I create a project of type "Class Library (.NET Standard)" and I add OpenTK v2.0.0 using the "Manage Package for Solution", I get the following error:
Package restore failed. Rolling back package changes for 'ClassLibrary1'.
I get an error also if I download OpenTK library and I try to add using "Add Reference". With the first project type it works, with the second when I try to refer to a class (e.g declaring a Vector2d variable) I get the following error:
CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly...
I'm not really understanding why. Is there substantial difference between the 2 project type, and why the second type does not get the reference and break the package manager?
Thanks a lot.
Kind regards.
This is due to OpenTK targetting .NET Framework 2.0, which means that it can be used in projects targetting the .NET Framework (windows only). If you're creating a project targetting .NET Standard (cross-platform), you can't currently use OpenTK 2.0.0.
However, there are already forks of OpenTK that target .NET Standard, and the official version 4.0 of OpenTK will support .NET Standard. You might have to wait a bit for that one though.