Hi Rafael,
Thank you for all your work making clingo-cs! I'm very interested in combining C# and Clingo. When clingo-cs is added to a project, will I then be able to follow the Python API example? Something like:
using Clingo-cs;
var ctl = clingo.Control()
ctl.add("base", [], "p(@id(10)). q(@seq(1,2)).");
ctl.ground([("base", [])], context=Context());
I've taken the following steps:
- downloaded clingo-cs from github as ZIP
- downloaded clingo-5.5.1, renamed it to "clingo", and placed it in clingo-cs-main
- created clingo\build\win and clingo\build\linux
- .\build.ps1 (success!)
- dotnet build --configuration Debug (partial success?)
clingo-cs-main\src\Clingo_cs\bin\Debug contains:
Clingo_cs.0.1.0.nupkg (11kb)
net6.0 (directory)
The net6.0 directory contains:
Clingo_c.dll (10kb)
Clingo_c.pdb (12kb)
Clingo_cs.deps.json (1kb)
Clingo_cs.dll (17kb)
Clingo_cs.pdb (17kb)
ref (directory)
The ref directory contains:
Clingo_cs.dll (10kb)
In Visual Studio, I created a package source entry for clingo-cs-main\src\Clingo_cs\bin\Debug and when I open Nuget and use this source, I see the option to install a single package:
Clingo_cs by Rafael Alcalde Azpiazu A C# bindings to the clingo library.
When I select that package, I see the following errors:
- Package restore failed. Rolling back package changes for 'dle_clingo_cs_test' (my project)
- NU1101 Unable to find package Clingo_c. No packages exist with this id in source(s): Local Clingo_CS, Microsoft Visual Studio Offline Packages dle_clingo_cs_test dle_clingo_cs_test\dle_clingo_cs_test D:\Documents\Programming\CSharp\dle_clingo_cs_test\dle_clingo_cs_test\dle_clingo_cs_test.csproj
Here are the detailed results of the build:
PS D:\Documents\Programming\CSharp\clingo-cs-main> dotnet build --configuration Debug
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Clingo_c -> D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_c\bin\Debug\net6.0\Clingo_c.dll
C:\Program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'D:\Documents\Programming\CSharp\clingo-cs-main\clingo\build\linux\bin'. [D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_c\Clingo_c.csproj]
Clingo_cs -> D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_cs\bin\Debug\net6.0\Clingo_cs.dll
Clingo_cs.Tests -> D:\Documents\Programming\CSharp\clingo-cs-main\tests\bin\Debug\net6.0\Clingo_cs.Tests.dll
Build FAILED.
C:\Program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'D:\Documents\Programming\CSharp\clingo-cs-main\clingo\build\linux\bin'. [D:\Documents\Programming\CSharp\clingo-cs-main\src\Clingo_c\Clingo_c.csproj]
0 Warning(s)
1 Error(s)