Native Hosting .NET Runtime

Following https://dev.to/tvinko/control-net-runtime-from-native-code-473f and its repository of https://github.com/tvinko/HostWithHostFxr/ , the native host part states the following (see image) Now, the article doesnt explain how said NuGet package is supposed to be installed? Seemingly I can select the C++ project to install a NuGet package, but it fails with the output
Attempting to gather dependency information for package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' with respect to project 'NativeHost', targeting 'native,Version=v0.0'
Gathering dependency information took 3 ms
Attempting to resolve dependencies for package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.NETCore.App.Host.win-x64.6.0.8'
Resolved actions to install package 'Microsoft.NETCore.App.Host.win-x64.6.0.8'
Install failed. Rolling back...
Package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' does not exist in project 'NativeHost'
Package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' does not exist in folder 'C:\Users\Wholesome\source\repos\TestProgram\packages'
Executing nuget actions took 12 ms
Package 'Microsoft.NETCore.App.Host.win-x64 6.0.8' has a package type 'DotnetPlatform' that is not supported by project 'NativeHost'.
Attempting to gather dependency information for package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' with respect to project 'NativeHost', targeting 'native,Version=v0.0'
Gathering dependency information took 3 ms
Attempting to resolve dependencies for package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.NETCore.App.Host.win-x64.6.0.8'
Resolved actions to install package 'Microsoft.NETCore.App.Host.win-x64.6.0.8'
Install failed. Rolling back...
Package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' does not exist in project 'NativeHost'
Package 'Microsoft.NETCore.App.Host.win-x64.6.0.8' does not exist in folder 'C:\Users\Wholesome\source\repos\TestProgram\packages'
Executing nuget actions took 12 ms
Package 'Microsoft.NETCore.App.Host.win-x64 6.0.8' has a package type 'DotnetPlatform' that is not supported by project 'NativeHost'.
And now looking at the repo, it seems like what they did was wrapping the C++ project in some kind of C# project running on .NET 5? I at least see the csproj file, including the NuGet and stuff https://github.com/tvinko/HostWithHostFxr/blob/master/HostWithHostFxr/src/NativeHost/NativeHost.csproj
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server