Could not find exe from dependency package after dotnet publish
Repro steps:
- Clear the NuGet cache (not for first run) or the cached ILCompiler folders for subsequent run.
- Unzip the temp.zip file to say
H:\ - Issue dotnet restore as specified in command.txt (change the local paths as per your env)
- Issue dotnet publish as specified in command.txt (change the local paths as per your env)
- Open the
H:\temp\publishdirectory.
The ILC.exe is missing which comes from the dependency of the packages declared in H:\temp\project\project.json
Cc @davidfowl
It is not clear to me if I am doing something wrong... please advise.
Taking a look at the project.lock.json
I see "runtimes/any/lib/dotnet/ilc.exe" is not longer an export, it only exists under the 'files' object.
@anurse Do you know if NuGet treats ".exe" files under lib differently?
@schellap ILC.exe is really an IL application right? You could just rename it ILC.dll and we can make the corresponding changes. Alternatively you could put it under the native piece and it will probably get picked up correctly again.
@brthor, basically, does this mean, dotnet compile --native is not possible in the rel/1.0.0 branch?
@schellap We still use dnu for restore currently so that's probably why we haven't seen this issue.
I think this means we need to make changes to make dotnet compile --native work right once we are using NuGet.
Either in the package & product if you rename to .dll or only in the package if you move to the native section (like we do for some of the other files)
In general, what is the recommended layout to package this exe file? I believe changing to ilc.dll requires CLI changes as well.
It looks like NuGet does not consider .exe a valid assembly. I'll submit a PR there to fix that.
https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Client/ManagedCodeConventions.cs#L35
https://github.com/NuGet/NuGet.Client/pull/220
In the case of all our other "executables" (NuGet, Csc, Fsc, etc.), the packages contain the managed executable as a dll and then the build script copies corehost in and renames as appropriate to make it runnable.
@schellap looks like this got merged. Can you validate and reopen if this is still an issue?