19

#Net5 – Migrating a fully functional Windows Form app to Net 5 in 10 minutes ! –...

 3 years ago
source link: https://elbruno.com/2020/12/30/net5-migrating-a-fully-functional-windows-form-app-to-net-framework-5-in-10-minutes/?utm_campaign=Feed%3A+elbruno+%28El+Bruno%29
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

#Net5 – Migrating a fully functional Windows Form app to Net 5 in 10 minutes !

elbruno EnglishPost 30 Dec 202030 Dec 2020

1 Minute

TbVolScroll is a super cool project, take a look 👇

Simple utility to enable volume control when your mouse cursor is positioned above the taskbar.
Hold the left ALT key to enable precise volume control (decrease/increase volume by 1%). Standard volume step is 5%. The volume bar will follow the cursor when it’s moved.
By default, if the volume is lower than 10% precise volume control is automatically enabled.

TbVolScroll

Note: As far as I remember, this feature is available in other OS.

And thanks to his author the code of the tool is available in GitHub (see references).

The original project is a .Net Framework 4.7.2 project, so I decided to test how much time it will take to migrate the project to .Net 5. I didn’t perform a deep analysis of the source project, before start. This is my labs migration path

  • Create a new Windows Form Net 5 project named [TbVolScrollNet5]
  • Copy all the files from the original project, avoiding the .csproj file
  • Rebuild !

And it worked ! I mean, I fixed some namespaces, added a missing NuGet package and 10 minutes later it was working. Of course, I submitted a pull request with the migration project, in the meantime I will keep this local just for fun.

And I want to use it ! So now is the time to pack and publish a local version of the tool. I created a local publish profile and defined

  • Build in Release | Any CPU
  • Deployment as Self-Contained
  • Runtime win-x86
  • Produce as single file
  • Enable ReadyToRun compilation
tbvolscroll publish profile as self contained

And that’s it! 150 MB to a fully functional working app 👇😸👇

tbvolscroll published version

Now back to work, and in my next steps I’ll publish this as a clickonce app so it’s easy to distribute. And the perfect excuse to learn more about .Net 5 !

References

¿Con ganas de ponerte al día?

En Lemoncode te ofrecemos formación online impartida por profesionales que se baten el cobre en consultoría:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK