In this video, I show you how you to get started using .NET Core 3 by creating a new WPF application that runs on .NET Core 3.
Make sure you install the prerequisites:
- https://github.com/dotnet/core-setup
- https://github.com/dotnet/core-sdk
Update:
As of SDK build 9754 the Project markup has changed to the following:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> <UseWPF>true</UseWPF> <AssemblyName>MyCore3App</AssemblyName> </PropertyGroup> </Project>
Is it really necessary to specify ApplicationDefinition and Page items? I mean, couldn’t they be included automatically? I currently use MSBuild.Sdk.Extras, which includes these items automatically.
Keep in mind, this is very early alpha preview and they will be improving the tooling behind .NET Core 3 as they get closer to release. You have to manually add your XAML Pages for now, but that will change.
Looks like your wish came true. With the latest build 9754, they no longer require you to specific Pages or ApplicationDeifinition
After change the csproj file, i can’t use the designer no more. If i right click the xaml file, the option to open it with the visual editor is missing.
This is because .NET Core 3 does not have designer support yet.
I have tried to convert my WPF application in .NET Framework to .NET Core. However, I am facing an issue regarding the Image item. The ImageSource does not work at all as the application does not show any image.
Your images have to be resources. Images do work in a .NET Core 3 WPF app.
When I try to reload the project, I get an error:
Project file is incomplete. Expected imports are missing.
Any idea what I can do to fix that?
You may need to enable .NET Core in VS (https://brianlagunas.com/enable-net-core-3-in-visual-studio-2017/), or you may need to watch the updated video with the breaking changes (https://brianlagunas.com/net-core-3-breaking-changes-build-9754/)
I have dotnet version – 3.0.100-preview-010086 and I all the time get message – “Project file is incomplete. Expected imports are missing.” I have enabled .net core preview in settings, I use updated project definition file. But no luck. Do you know what they have changed with latest updates?
Hmmm… very interesting. I am running 010110 and everything is working fine. Are you running the latest update of VS2017? Is your project markup the same as in this video https://brianlagunas.com/net-core-3-breaking-changes-build-9754/
Is it really necessary to specify ApplicationDefinition and Page items? I mean, couldn’t they be included automatically? I currently use MSBuild.Sdk.Extras, which includes these items automatically.
They already are included. Check out the latest videos 🙂