-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why createdump.exe is needed to do "dotnet publish"? #43716
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @vitek-karas, @agocke |
@sbomer Do you remember the rules around native library trimming in self-contained apps? Did As for Please note that trimming is still an experimental feature. Be sure to thoroughly test the trimmed app. |
/cc @Scottj1s |
We don't remove native libraries at the moment. The OOB package had some support for it but we didn't productize it. There's at least one existing issue about it at dotnet/linker#2853. IIRC one of the open questions was how to handle the windows native compat shims - they may or may not be required, depending on the target windows version. |
Sorry, I don't quite clear for "createdump.exe“, is it expected at this moment? |
Sorry for the confusion. Short version: yes, it is expected at this moment. I would think you can safely remove the file if you really want to - it might break some dump debugging scenarios, but it should not be needed to run the app itself. The trimming process splits the files in the output into 3 categories:
As noted above there has been some history around trying to remove some of the files in the native libraries category when trimming. Apparently none of the prototypes made it into the product, so we intentionally leave the native binaries as is. |
Thank you, it's clear for the categories. Actually, the "createdump.exe" is needed to start my service(my App). Message: Error: |
You're right - it is still needed. This is unfortunate - the app actually doesn't need the file for anything, but it's listed as "being part of the app" and the host checks that everything which is part of the app is present, so it fails. |
OK, the last question is, will it be removed in .NET 5 release? or .NET 6? p.s. after answer this, you can choose to CLOSE or any other actions for this issue. |
Yeah I put it in the 6.0 milestone because I don't think we should require it in the deps.json if it's unused. It may still be useful to copy to the output, but if users should be able to remove it if they want |
It's a particular problem for Squirrel users distributing .NET 5 apps as the two .exe's confuse the installer, and there's no way to mark one of them as Squirrel-aware. As a workaround, this does the job:
|
@vadi2 if we can get Squirrel/Squirrel.Windows#1692 merged, then there will be a better solution to the squirrel issue |
@vadi2 Just wondering, did you set this up as a MSBuild step? I have my Squirrel releasify running as a PostBuild step. Any suggestions? |
Sorry, I just did it as a separate github actions step. MSBuild does not look pleasant to be messing with. |
Thanks for replying. I'll probably just include jq in my Scripts folder and call it as a PS script, or something. Hopefully that will let us release with Squirrel, as that is our hold on migrating to Core. |
@vadi2 @agocke Can you elaborate on in what way it may be useful to copy that file to the output? What "dump debugging scenarios" are depending on the existence of I am asking because, we built our own little executable that the .NET application itself will launch to create a dump whenever there is an unhandled exception in the app. Maybe we can get rid of our executable and use |
See https://docs.microsoft.com/en-us/dotnet/core/diagnostics/debug-linux-dumps for info on |
Alternatively, one way to remove |
Can I prevent it to be created in .NET 6? It's my experience that in 99.9999% of all crash cases in the real world these dump files will never be used anyway, just bloating your system and steel time, CPU and ram when being created. Not saying they cannot be useful, it's just EXTREMELY rare they will be investigated by anyone. |
There's no simple way to prevent this. The simplest is probably to add a custom post-build target and just delete the file from the output. |
Yea, that's what I did, but what a waste of time.
|
I created dotnet/sdk#27336 to start the discussion as the problem is bigger (more files) and really lies in the SDK (at least the design part, some of the implementation might be in runtime, but that's not important for the feature request). |
I am trying to publish a .NET 5 trimmed App(upgrading from .NET Core 3.1), with the command
"dotnet publish -c Release --force -r win-x86 --self-contained true "xxxcsproj" /p:PublishTrimmed=true"
I found the following DLLs are needed.
But I am quite confused why createdump.exe is needed to run?
Is it for .NET 5 RC2 to collect dump file and will not be needed in Release version?
And, is there a way to reduce the size of "Microsoft.Windows.SDK.NET.dll", it's nearly 30MB.
The text was updated successfully, but these errors were encountered: