Raylib-cs: NuGet package does not work in most configurations
I am trying to use Raylib-cs with fsharp on dotnet 3.1.
I am able to install the lib on a console app using dotnet add Raylib-cs
But now in my code doing
open Raylib
gives me the error The namespace or module 'Raylib' is not defined.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (8 by maintainers)
Update. Taking another look to see if there was something I missed. Looks like there is a open issue about using native libraries in nuget packages here.
The point of having it be a package is to make it easy for people to install and use so I would want it to include the native libraries too although I am not sure how it should be done. The dev branch is nearly ready to merge into master so I will work on that and take another look at this after.
@Shadowblitz16 Are you targeting .Net Framework or .Net Core?
.Net Framework doesn’t handle cross-platform native libraries that well - in this case you will need to copy the native raylib dll into your output directory.
In any case, you will probably have better luck by only building x64. I know AnyCPU is broken. not sure about x86.
I am currently testing a fix for this (see pre-release NuGet packages).
Good news! We have just released a NuGet package targeting netstd2.0 (which should support Framework 4.7.2) & Core 3.1
So far we have tested it with the examples and with Github Actions, but please feel free to open new issues if there are problems with the package.
https://www.nuget.org/packages/Raylib-cs
dotnet add package Raylib-cs