AaronRobinsonMSFT / DNNE

Prototype native exports for a .NET Assembly.
MIT License
397 stars 41 forks source link

No cross-platform build possible after installing the DNNE package (windows -> Linux) #124

Closed ramikhaldi closed 2 years ago

ramikhaldi commented 2 years ago

Hi,

I am facing a compilation issue on windows (visual studio 2019). I want to have a Linux build: <RuntimeIdentifier>ubuntu.16.04-x64</RuntimeIdentifier>

I am getting the error: .nuget\packages\dnne\1.0.31\tools\platform\platform.c(30): fatal error C1083: Cannot open include file: 'nethost.h': No such file or directory

It looks like, it was searching for this path: \dotnet\packs\Microsoft.NETCore.App.Host.win-x64\6.0.5\runtimes\win-x64\native which does not exist. Trying to install Microsoft.NETCore.App.Host.win-x64 6.0.5 gives: error: NU1213: The package Microsoft.NETCore.App.Host.win-x64 6.0.5 has a package type DotnetPlatform that is incompatible with this project.

Using the container mcr.microsoft.com/dotnet/sdk:5.0 or mcr.microsoft.com/dotnet/sdk:6.0 did not help (but other error message): C:\Users\ContainerUser\.nuget\packages\dnne\1.0.31\build\DNNE.targets(130,5): error MSB4018: The "CreateCompileCommand" task failed unexpectedly. -> Maybe just because the visual studio is missing

I am using the .net core 5 (update: Same problem with .net 6).

Note, that building for linux on linux seems to be working fine.

It would be great, if a dockerfile including an example will be provided to assure that the cross-platform build is working.

Thanks in Advance.

KR, Rami

AaronRobinsonMSFT commented 2 years ago

@ramikhaldi This has been asked before, see https://github.com/AaronRobinsonMSFT/DNNE/issues/84. The cross-platform scenario is just plain hard. However, it sounds like I need to add some details to the FAQ. Please let me know if you have additional questions than what is described in the referenced issue.

ramikhaldi commented 2 years ago

Okay, Thanks for your response.

AaronRobinsonMSFT commented 2 years ago

Added FAQ entry - https://github.com/AaronRobinsonMSFT/DNNE#faqs.