Telerik blogs
DotNetT2 Light_1200x303

New improvements in .NET Core make it simple to decrease the size of your self-contained apps. Check out this quick tip and see how easy it is to trim things down.

.NET Core allows you to build a self-contained (portable) version of your application. When this approach is used, all the .NET Core and other referenced assemblies are shipped with the application. This significantly increases the application size, and even a simple application can take a significant amount of space. This is not an issue for a development or a workstation machine but can be an issue if you are using Xamarin for example, where you need to redistribute the application to the clients’ phones

.NET Core 3+ ships with an IL Linker which allows you to reduce the size of the self-contained application. It automatically determines which assemblies are needed and copies only them.

I have ported the HotelApp form the Telerik UI for WinForms demo application to .NET Core to test this feature. I have published the application with the standard configuration first.

trimed_core_app001

Then I used the trimmed configuration. In the latest Visual Studio Preview version, you can specify this from the UI, and there is no need to edit the project file manually.  

trimed_core_app002

The following image shows the difference.

trimed_core_app003

This feature just saved 50 megabytes in this case, and I believe it is great amount of space considering that the portable version should include the frameworks assemblies as well.

Try It Out and Share Your Feedback

The R3 2019 SP for Telerik UI for WinForms is already available for download in customers’ accounts. If you are new to Telerik UI for WinForms, you can learn more about it via the product page. It comes with a 30-day free trial, giving you some time to explore the toolkit and consider using it for your current or upcoming WinForms development.

    

About the Author

Dimitar Karamfilov

Dimitar Karamfilov is a Support Officer in the UI for WinForms team. He joined Telerik after graduating from the Telerik Academy in 2013. Apart from work he likes outdoor activities and reading philosophy literature.

Related Posts

Comments

Comments are disabled in preview mode.