Open matty-hall opened 3 years ago
runtime.win-x64.microsoft.dotnet.ilcompiler
package, not in microsoft.dotnet.ilcompiler
package.Thank you so much! I was able to get VS2019 working for a managed build (which works). The setting you're referencing is under Tools | Options | Environment | Preview Features | Use Previews of the .NET SDK.
After getting that working, I now magically have "runtime.win-x64.microsoft.dotnet.ilcompiler" in my .nuget folder, which wasn't the case after building in VS2022 Preview (I only had microsoft.dotnet.ilcompiler). I think that gives me everything I need to just hook things up from the command line.
For the sake of reference, dotnet publish still fails even after using "win-x64" rather than "windows-x64" with the following. This doesn't matter to me since I really just needed ilc.exe, but I wanted to add this for anyone else who runs into it:
Running 'dotnet publish -r win-x64 -c Release' still fails with the following:
Microsoft (R) Build Engine version 17.0.0-preview-21460-01+8f208e609 for .NET Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore... efinoruntime.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.win-x64 with version (= 6.0.0-rc.1.21451.13) efinoruntime.csproj : error NU1102: - Found 11 version(s) in dotnet-experimental [ Nearest version: 6.0.0-s390x.1.20553.1 ] efinoruntime.csproj : error NU1101: Unable to find package Microsoft.WindowsDesktop.App.Runtime.win-x64. No packages exist with this id in source(s): dotnet-experimental efinoruntime.csproj : error NU1101: Unable to find package Microsoft.AspNetCore.App.Runtime.win-x64. No packages exist with this id in source(s): dotnet-experimental Failed to restore efinoruntime.csproj (in 931 ms).
Thank you so much for the help and for all of this work - really appreciate it!
efinoruntime.csproj : error NU1101: Unable to find package Microsoft.WindowsDesktop.App.Runtime.win-x64. No packages exist with this id in source(s): dotnet-experimental
Maybe try deleting the <clear />
line from NuGet.config to allow restoring from NuGet.org.
But if you're comfortable doing this with the batch scripts, it's better that way.
Thank you so much for this! So, I've followed the instructions and building isn't working (I'm trying efi-no-runtime). A few notes:
The readme says that VS2019 is required, but the project doesn't build at all in 2019 (stating that the 6.0 SDK isn't supported). So, I installed the 2022 preview.
A build in VS2022 works and successfully generates a binary. However, a dumpbin on the binary shows the subsystem as Windows CUI, so the extra "stuff" (i.e. in the CSPROJ) doesn't appear to be hooked up.
Invoking "dotnet publish -r windows-x64 -c Release" also does not working, yielding: C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1083: The specified RuntimeIdentifier 'windows-x64' is not recognized. [C:\Users\m\Downloads\zerosharp-master\zerosharp-master\efi-no-runtime\efinoruntime.csproj]
The readme also claims that build.cmd is redundant w/ the CSPROJ file, but the file names are totally different (i.e. build.cmd refers to 'zerosharp' while the output name in the CSPROJ is 'efinoruntime')
ILC isn't in the nuget package. Mine was cached at C:\Users[username].nuget\packages\microsoft.dotnet.ilcompiler\7.0.0-alpha.1.21504.4\ but the tools directory (nor any directory in there) has an ILC.exe that the build.cmd is looking for.
Given that I can successfully compile the code to a managed binary, I'm perfectly fine using a batch file rather than the CSPROJ file to link to native, so I think the issue really is finding where ILC.exe is located? Help is greatly appreciated!