Digest - .NET Conf 2021 - Focus on Windows and More!
Digest of the free virtual event at https://focus.dotnetconf.net held February 25th, 2021 with a focus on Windows desktop development plus assorted links and blog posts for .NET 6 Preview 1 and Visual Studio.
There was not a lot of new stuff at the conference, see previous digest from .NET Conf 2020 covering .NET 5 at Digest - .NET Conf 2020 for more content 😁.
Announcements and Blog Posts
A few links can be found below. Most are unrelated to the .NET Conf.
Summary: Cathy Sullivan introduces .NET Upgrade Assistant announced at .NET Conf. This is covered a bit in the videos section with a link to video from .NET Conf and me trying out the tool on a project and failing 😅.
Summary: Very long and detailed post about everything .NET 6 Preview 1 by Rich Lander.
Summary: Sourabh Shirhatti covers “what’s new in ASP.NET Core in .NET 6 Preview 1”
- Support for
ElementReferenceexposed on relevant components
dotnet watchnow does
dotnet watch runby default
- Nullable reference type annotations
Summary: Lots of new attributes it seems.
Summary: Jacqueline Widdis covers a few very nice improvements and .NET productivity features available in Visual Studio 2019 v16.9 just released. For C#:
- Remove Unused References
- Simplify LINQ Expressions
- New Completion Options - e.g. completion for Enum values when a type is known even if the Enum value is not entered.
Summary: Sagar Shetty introduces the new dynamic instrumentation tool. This tool shows the exact number of times your functions are called and is faster than our previous static instrumentation tool. It also supports .NET Core instrumentation without needing PDBs.
Summary: Maoni Stephens writes about the .NET Pinned Object Heap introduced in .NET 5.
Summary: Konrad Kokosa lists results of a twitter poll about missing C# features. The compiled wishlist being:
- Discriminated unions
- First class void/aka Unit
- Pipe operator
- Type interference of methods
- Anonymous interface implementation
- Shapes aka type classes
- Primary constructors
- constexpr from C++
You can see a status table of C# language features on GitHub at
Language Feature Status.
Personally I wish for value type records e.g.
record struct, which is being worked on.
Summary: Philip Carter covers the major improvements made by category:
- .NET 5 scripting for Visual Studio
- New productivity features for Visual Studio
- Tooling performance and responsiveness improvements
- Core compiler improvements
I have selected a few videos I found interesting below incl. full playlist of all videos from the conference. With summaries some of which are just copies of the official summary.
Summary: 17 videos excl. the full day stream.
Summary: Full length live video.
To put it through some rough testing I tried using it on a solution with many projects incl. an WPF application and several console applications. This had already been ported to new SDK csproj, but is targeting net461. Below some notes on what I did in Powershell.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 > dotnet tool update -g try-convert You can invoke the tool using the following command: try-convert Tool 'try-convert' (version '0.7.212201') was successfully installed. > dotnet tool install -g upgrade-assistant You can invoke the tool using the following command: upgrade-assistant Tool 'upgrade-assistant' (version '0.2.212405') was successfully installed. > upgrade-assistant .\SOLUTIONNAME.sln [Next step] Select an entrypoint > 1 # Selecting 1 since that is the primary project - WPF app [Next step] Select project to upgrade > ENTER # A list of projects and their order is listed which looks fine > ENTER [Next step] Back up project > 2 # Skipping since in git # Then proceeds to do conversion (not needed since already SDK project) [18:23:20 INF] Initializing upgrade step Convert project file to SDK style [18:23:20 ERR] Failed to open project PROJECTPATH.csproj; Exception: System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate) at Microsoft.DotNet.UpgradeAssistant.MSBuild.MSBuildProject.get_TFM() in /_/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs:line 266 at Microsoft.DotNet.UpgradeAssistant.MSBuild.MSBuildProject.<get_TransitivePackageReferences>g__GetTransitiveDependencies|26_0() in /_/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs:line 203 at Microsoft.DotNet.UpgradeAssistant.MSBuild.MSBuildProject.get_TransitivePackageReferences() in /_/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs:line 194 at Microsoft.DotNet.UpgradeAssistant.MSBuild.MSBuildProject.get_Components() in /_/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs:line 74 at Microsoft.DotNet.UpgradeAssistant.Steps.ProjectFormat.TryConvertProjectConverterStep.InitializeImpl(IUpgradeContext context) in /_/src/steps/Microsoft.DotNet.UpgradeAssistant.Steps.ProjectFormat/TryConvertProjectConverterStep.cs:line 108 > 2 # The tool continues so trying to skip conversion [Failed] Update TFM # However, Update TFM step fails too with the same error # At this point the upgrade assistant has made no changes to project files
Bummer… notorious LINQ
.Single() exception, seen that too many times.
Assumptions are always wrong.
Pretty sure our
csproj customizations are not supported 😅
Note we have tried changing the TFM to
net5.0 manually and this builds fine, but fails
to run the app with no meaningful error. It just stops during startup.
Summary: Dmitry Lyalin takes a tour of what’s new for Windows desktop developers building applications using WPF and UWP apps with Visual Studio. Covers improvements in tooling such as what’s new in XAML data binding, diagnostics, XAML designer and Hot Reload. Nothing really new here, but great things just released in Visual Studio 2019 16.9.
- Windows Store
- Third-party solutions
Which does not cover my favorite for complex installers; a .NET Framework application with the application and it’s resources embedded. This gives you full control over the installation experience using normal C# code. This depends on knowing the minimum .NET Framework version being available on target machines.
Summary: Great talk by Isaac Levin about how to automate “deploying” a desktop application via GitHub Actions to:
- Windows Store
Yaml galore, hundreds of lines of it. Having spent a lot of time on build and CI definitions I can definitely appreciate the collected efforts to get all the things being automated working. Local testing of these yaml pipelines is a huge issue, though, for quicker dev loop. Code can be found at https://github.com/isaacrlevin/presencelight
Summary: Angela Zhang and Mike Ballista on “Unlock the full potential of your .NET applications by taking advantage of the native platform APIs in Windows. In this demo heavy session, you’ll learn how we’ve simplified Windows development by making access to both WinRT and Win32 APIs easy in .NET 5.”
Summary: Awesome talk by Daniel Roth about all things Blazor incl.
running Blazor inside native desktop apps e.g. via
Summary: Zanya and Migual Ramos talk about the goal of Project Reunion. The capabilities of Project Reunion and how you can take advantage of it from your .NET applications. This includes WinUI 3.
Summary: Maddy Leger and David Ortinau give a quick introduction to .NET MAUI (Multi-platform App UI aka Xamarin vNext), the premise of it and an overview of how it works. As always with great enthusiasm. 😁 At the end a tentative and loose timeline is given. No promises!
|.NET 6 Preview 1||Runtime and BCL. Mobile workloads.||Contributors|
|.NET 6 Preview 2||.NET MAUI views, layouts Android, iOS, MacOS.||Contributors|
|.NET 6 Preview 3&4||.NET MAUI most controls, layouts, pages, services. Adding WinUI4.||You! Kick the tires.|
|.NET 6 Preview 5 -> RC||.NET MAUI fills the remaining gaps. Responds to feedback.||Everyone!|
Download Videos for Offline Viewing
Most videos can be found below for direct download: