question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trimming default WPF app breaks it

See original GitHub issue
dotnet new wpf
dotnet publish -r win-x64 /p:PublishTrimmed=true
run the app

Running the app “does nothing” no window shows up.

Note that this is a regression from 3.1 where this worked.

Used: 5.0.100-rtm.20515.8 SDK

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
agockecommented, Mar 23, 2021
0reactions
vatsan-madhavancommented, Mar 31, 2021

This should be replaced by the proper C# module initializer now that that C# can emit them.

👍

Replacing this infrastructure is exactly why @rladuca and I pushed for the C# module-initializer feature (along with many others for many other good reasons). This should absolutely be changed in .NET 6. The ILASM/ILDASM trick is ok for now, but it’s meta-stable at best.

/cc @SamBent @ryalanms

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trimming options - .NET
Learn how to control trimming of self-contained apps. ... This setting enables trimming and will trim all assemblies by default.
Read more >
Known trimming incompatibilities - .NET
Unfortunately, almost no WPF apps are runnable after trimming, so trimming support for WPF has been disabled in the .NET 6 SDK. Windows...
Read more >
WPF: Trim all textboxes
I recently got a requirement that all the textboxes in my application should automatically trim the text when leaving the textbox. I can't/don't ......
Read more >
NET 5.0 App Trimming and Potential for Future Progress
NET 5.0 app trimming to reduce the size of our deliverable; use both Visual Studio 2019 and the dotnet command to achieve app...
Read more >
3 Ways to Deploy a WinForms or WPF .NET Core Application
Just set PublishTrimmed=true in your project. Typically, small tool-like console apps benefit the most as they tend to use fairly small subsets ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found