You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use cppsharp to convert a few headers but i can't figure out the gaps in the documentation.
First i tried using the nuget.org package, but that is terribly outdated and not compatible anymore. Then i tried the GitHub package, but that only contains the linux runtime, since I'm on windows that is a no-go. Then i tried compiling myself, building went fine. Testing didn't work through the test script but went fine in the sln. So i think i have a properly built cppsharp, somewhere...
But now the getting started markdown ends and there is no list anywhere what i need to include in a new generator project to get this working.
I tried to pack the nugets myself with the windows runtime with the build script, but that fails at runtime with an error "Could not load file or assembly CppSharp.Parser.CLI ...". I also tried to include the dlls in the bin directory, but nothing seems to be working. Any chance of extending the docs to what we are supposed to do after the building? Or including the windows runtime in the nuget package?
For the NuGet and Windows stuff, unfortunately I don't use Windows these days anymore, so I don't have a way to test this. I would appreciate if someone else could help, I'll happy review and merge such PRs.
I think the major problem is the nuget package does not include the windows runtimes, this is what is in the nuget package from github:
I think windows just isn't being built in the workflow to generate the package?
The driver code i get completely, but neither of these samples have a buildable csproj i can build so i have no way of knowing what dlls i need to include in my project to build since the nuget package isn't working and the output of the build seems to spam a huge amount of artifacts (dll, json, lib, ...) that are not at all included in the nuget. this step of which dlls to include is also not in the docs, which is the only step that im missing atm to get it working.
Like i said before i have the source built, that is not the issue. The issue is being able to use the built binaries in a project to generate bindings. Which is also not shown in that video, at least i think so because i don't speak the same language. All the samples across github i could find all use the nuget, but the nuget does not include the windows runtime, so there are not samples using the binaries directly.
I think we can simply change the name 'intermediate' to include some os/config variables. (And then don't forget to pick that same name on the side that uses the artifacts)
There is still a mismatch where the NuGet package version is not in sync with the branch/release version, I'll have to debug and fix that at a later stage.
But feel free to test this new release and let me know if it works or not.
Activity
tritao commentedon Nov 17, 2025
Easiest way to get started is probably to invoke the CppSharp CLI at https://github.com/mono/CppSharp/blob/main/src/CLI/CLI.cs
For the more traditional way of using CppSharp, which is probably what you want long-term, check for example the driver code of the example: https://github.com/mono/CppSharp/blob/main/examples/SDL/SDL.cs
For the NuGet and Windows stuff, unfortunately I don't use Windows these days anymore, so I don't have a way to test this. I would appreciate if someone else could help, I'll happy review and merge such PRs.
tritao commentedon Nov 17, 2025
Let me know if this helps or you need further assistance.
Levi--G commentedon Nov 17, 2025
I think the major problem is the nuget package does not include the windows runtimes, this is what is in the nuget package from github:
I think windows just isn't being built in the workflow to generate the package?
The driver code i get completely, but neither of these samples have a buildable csproj i can build so i have no way of knowing what dlls i need to include in my project to build since the nuget package isn't working and the output of the build seems to spam a huge amount of artifacts (dll, json, lib, ...) that are not at all included in the nuget. this step of which dlls to include is also not in the docs, which is the only step that im missing atm to get it working.
Thank you for the assistance! :)
fengxinran233 commentedon Nov 17, 2025
@Levi--G
I think you can learn how to use and compile CppSharp from this video.
https://b23.tv/I4ZfRfh
Levi--G commentedon Nov 17, 2025
Like i said before i have the source built, that is not the issue. The issue is being able to use the built binaries in a project to generate bindings. Which is also not shown in that video, at least i think so because i don't speak the same language. All the samples across github i could find all use the nuget, but the nuget does not include the windows runtime, so there are not samples using the binaries directly.
tritao commentedon Nov 17, 2025
I think the NuGet issue has been caused due to a regression in c25c7df.
The update to
upload-artifact@v4caused a difference in behavior fromv3, we were relying on same named artifacts being merged together, which is not possible now: https://github.com/actions/upload-artifact#not-uploading-to-the-same-artifactPinging @duckdoom5 in case he is still around, for possible help on this.
duckdoom5 commentedon Nov 18, 2025
Hi, I see.
To be honest, I don't remember why the change was needed. Wasn't it because v3 was no longer supported and would fail automatically?
Also, I'm no expert on GitHub actions. Maybe there is still a way to get the old behavior back?
duckdoom5 commentedon Nov 18, 2025
If I were to guess a proper solution though;
I think we can simply change the name 'intermediate' to include some os/config variables. (And then don't forget to pick that same name on the side that uses the artifacts)
tritao commentedon Nov 19, 2025
The CI action is now fixed, I published a new
v1.2release: https://github.com/mono/CppSharp/releases/tag/v1.2It also published a new NuGet at: https://www.nuget.org/packages/CppSharp/1.1.84.17100
There is still a mismatch where the NuGet package version is not in sync with the branch/release version, I'll have to debug and fix that at a later stage.
But feel free to test this new release and let me know if it works or not.
Levi--G commentedon Nov 21, 2025
I can confirm the nuget is working now on windows, thank you everyone!
Small last question, i see the linux runtime now has a .net 10 lib folder and the windows version has a .net 9 version? Is this correct?
duckdoom5 commentedon Nov 22, 2025
That looks like an error, but I can't say for sure @tritao