C
C#8mo ago
Xan.Nava

❔ Which C# nethost file to include in c++ host application

I am fallowing this tutorial on how to create a nethost application(c++) for .net applications. I am targeting .net 8.0, and have downloaded the sdk but am a bit confused on where to find the nethost file and what to actually include(.dll/.lib/.h)? For example I have found
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Host.win-x64\8.0.0-rc.1.23419.4\runtimes\win-x64\native
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Host.win-x64\8.0.0-rc.1.23419.4\runtimes\win-x64\native
though not sure if the pack is correct. I saw there were some for Maui, and some just .Net.Runtime for Mono and WebAssembly. and some with a Emscripten. I want to for now just use a console application for both c++ and C# sides. I see the .NETCore packs have my .net 8.0 as an option. Is them being called .NETCore just a wierd naming thing on microsofts side(from the .net Core vs .net Framework times)?
5 Replies
WEIRD FLEX
WEIRD FLEX8mo ago
links are formatted like [ name ] ( link ) this i can't really help with the rest doesn't vs try to find it if you include that header
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
reflectronic
reflectronic8mo ago
yes, the apphost pack is the right place to look to be more speciic, you would #include <nethost.h>, and then link against the nethost library. so, use the nethost.lib import library on Windows, and libnethost.so (-lnethost) wherever else
Xan.Nava
Xan.Nava8mo ago
So then should I target the .NET Core runtime and libraries, or is there an actual .NET 5.0 or later runtime that I can target? I am assuming the "Microsoft.NETCore.App.Host.win-x64" pack does both?
reflectronic
reflectronic8mo ago
ignore the name if the folder says 8.0.0 then it is for .NET 8
Accord
Accord8mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.