2

I've created a WPF application using VisualStudio 2017 by selecting the .Net framework 4.6. Know I'm trying to configure it for .Net Core 3.0 for WPF. But unfortunately, after changing my configuration, When reloading my projects, I got this error.

Project file is incomplete. Expected imports are missing.

I've checked all the reference files are there.

Here is my .csproj file.

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <AssemblyName>HelloWorld</AssemblyName>
    <UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
    <ApplicationDefinition Include="..\WpfApp\App.xaml" Link="App.xaml" />
    <Compile Include="..\WpfApp\App.xaml.cs" Link="App.xaml.cs" />
</ItemGroup>

<ItemGroup>
    <Page Include="..\WpfApp\MainWindow.xaml" Link="MainWindow.xaml" />
    <Compile Include="..\WpfApp\MainWindow.xaml.cs" Link="MainWindow.xaml.cs" />
</ItemGroup>

</Project>

I've installed this SDK version 3.0.100-preview5-011568. I've also enabled the Use previews of .Net Core SDK in VisualStudio.

habib
  • 2,366
  • 5
  • 25
  • 41
  • *"after changing my configuration"* - what have you done exactly? Followed [this answer](https://stackoverflow.com/a/55025390/1997232) ? Rather follow [this one](https://stackoverflow.com/a/1551592/1997232). – Sinatr Jun 07 '19 at 11:24
  • I'm following this tutorial https://brianlagunas.com/getting-started-net-core-3-create-wpf-application/ – habib Jun 07 '19 at 11:34
  • I've just changed the default configurations with the above one. – habib Jun 07 '19 at 11:37

1 Answers1

5

You should upgrade to Visual Studio 2019. It includes a project template for WPF and Windows Forms applications targeting .NET Core 3.

From the docs:

Visual Studio 2017 doesn't support .NET Core 3.0 projects.

mm8
  • 163,881
  • 10
  • 57
  • 88