-
Notifications
You must be signed in to change notification settings - Fork 508
How to compile into one single executable? #6819
Comments
Yes, it is possible. Take a look at our samples: https://github.com/dotnet/corert/tree/master/samples Note that CoreRT does not support all .NET features (for example, Reflection.Emit and COM interop are not supported). Whether your application is going to work with CoreRT will depend on whether it uses one of the unsupported features. |
which of the examples do you mean? i can't see any that consists of multiple projects. Actually my application builds fine, and it seems also to be native compiled,but the output still contains alot of files. |
Could you please share the list of the files that you see in your publish directory and that you do not expect it to be there? |
i can't send you the exact list but what i see there and didnt expect is:
|
@TFTomSun try deleting your binaries and intermediates and build again. This is probably leftovers from when you ran publish without referencing the ILCompiler package. These files are not needed. |
@MichalStrehovsky I did a tree clean and just executed this command line: dotnet publish -f netcoreapp2.1 -c Release -r win-x64 /p:UseCoreRT=true /p:OutDir=D:\Build%CurDir%\Native UseCoreRT is actually a property based on which i decide whether to reference the ILCompiler package. The result is still the same. No single executable. |
ah.. Problem solved. The OutDir property was not considered for the native output, so there was just some kind of intermediate output there. Is this a minor bug? Actually i would expect the final output there where the OutDir property points to. |
Is this the same as the announcement about compiling .net 3.0 WinForms and WPF apps to a single exe? If not which repo is that in? Thanks! |
No. The 3.0 solution for WinForms and WPF is discussed in https://github.com/dotnet/coreclr/issues/20287. |
Another option is Roslyn:
|
The CoreRT is advertised as a possibility to compile any application into one single native executable. I have an application with some project and nuget dependencies. Is it already possible to create a single exe out of it? If so, how? Is there a special build flag, that i need to pass?
Thanks in advance
The text was updated successfully, but these errors were encountered: