Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load assembly that contains Nuget Packages #15

Open
antopilo opened this issue Apr 26, 2024 · 7 comments
Open

Failed to load assembly that contains Nuget Packages #15

antopilo opened this issue Apr 26, 2024 · 7 comments

Comments

@antopilo
Copy link

It would be pretty useful to be able to resolve Nuget packages when loading a DLL through Coral.

@kaitabuchi314
Copy link

What do you want to use this for? If you want to use a library, you could do something where you wrap C++ lib functions:
int WrapperCppLibFunction()
{
return CppLibFunction();
}

@antopilo
Copy link
Author

Im using coral to expose C# scripting to users.

It would be nice for user to be able to use C# Nuget libraries in their game scripts.

@mVento3
Copy link

mVento3 commented Aug 7, 2024

It is possible but only by manually loading those nuget libraries using AssemblyLoadContext(I didn't find any other way, maybe there is another). The load order is important so you need to load deps first.

@antopilo
Copy link
Author

antopilo commented Aug 7, 2024

It is possible but only by manually loading those nuget libraries using AssemblyLoadContext(I didn't find any other way, maybe there is another). The load order is important so you need to load deps first.

Good to know that at least there is a way! I would need to write a tool that manually reads the solutions nuget packages and figure out the dependencies order. Would be neat if it got included in Coral though

@mVento3
Copy link

mVento3 commented Aug 8, 2024

I also thought about this, but I noticed that you can't relay on nuget packages versions and their assembly versions because they tend to differ (for example Serilog in my case, nuget version is for example 4.0.1 but assembly says 4.0.0). Since I'm using CMake to generate C++ and C# projects in one solution I might to use compilation definitions (you can also specify nuget packages for C# projects in CMake)

@antopilo
Copy link
Author

antopilo commented Aug 8, 2024

I'm curious what's @peter1745 opinion on this.

@antopilo
Copy link
Author

@TheCherno Any updates on this since peter is no longer part of the maintainers? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants