r/csharp•
Harag_

C# 8.0 with wpf and .Net Core 3.0

Hello everyone!

I wanted to play around with some of the new C# 8.0 features, however I cannot make it work with the new .net core 3.0 wpf. It is no problem in a console application.

Visual Studio 2019 says that the C# version is automatically inferred from my project, and manually changing it by editing the project file with a text editor seems to change nothing. The project is definitely .net core 3.0.

Did I miss the memo and it's not gonna be supported in desktop apps?

Posted Oct 4, 2019, 1:22 PM UTC

14
Brasz•

Works fine for me.

My csproj:

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <UseWPF>true</UseWPF>
    <LangVersion>8.0</LangVersion>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <!-- ... -->
</Project>
2
Harag_OP•

I will try it out thanks!

1
isocal•

Are you using VS 16.3.0 or greater?

1
Harag_OP•

Yes I do!

1