Select to view content in your preferred language

Compilation error with basic project

95
5
yesterday
ModyBuchbinder
Esri Regular Contributor

I just started to use 200.8

I have VS 17.8

Started a project with the template and just compile it (no changes)

I get the error:

Severity Code Description Project File Line Suppression State
Error MC1000 Unknown build error, 'Could not find type 'WinRT.WinRTRuntimeClassNameAttribute' in assembly 'C:\Users\mody\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.31\lib\net6.0\WinRT.Runtime.dll'. Line 14 Position 23.' WpfMapApp1 C:\Projects\WpfMapApp1\WpfMapApp1\MainWindow.xaml 14

As far as I understand I have everything installed.

Any idea?

0 Kudos
5 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

As I understand it, your project template is WPF application. Requirements for WPF application are:

Development environments

  • Visual Studio 2022 17.8 or higher with the .NET desktop development workload.
  • Visual Studio 2019 16.9 or higher (for .NET Framework applications only).

.NET SDKs and frameworks

  • .NET 8 (8.0.404 or higher) is required for developing WPF for .NET applications.
  • .NET Framework 4.7.2 or higher is required for developing .NET Framework applications.

From error message I see that your .NET SDK is 6.0. What .NET version did you choose when create new project from template? Do you have the same .NET SDK (8.x or 9.x) installed? Run "dotnet sdk check" from Developer Powershell to see.

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Thanks for the quick response.

See my screen shot, it looks like I have all the versions.

I do not see anywhere an option to select .NET version when I create a new project. I select the template from the list and get my project. When I edit the project file I see the line:

<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>

Thanks again

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Checking my dependencies in the project and Frameworks you can see the the two lines under SDK.NET.Ref point to NET 6

All entries in the NETCore and App.WPF are pointing to NET 8

0 Kudos
GKmieliauskas
Esri Regular Contributor

After creating project, you can find .NET version in project properties:

GKmieliauskas_0-1764070187899.png

You can select .NET version in next step after choosing project template, selecting location for project:

GKmieliauskas_1-1764070360075.png

Another one thing is Visual Studio version. I have found: Visual Studio 2022 v17.12 with .NET 9



 

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Hi

 

Upgrade to VS2022 17.14 solved the problem.

The docs say 17.8 is supported (that is what I had before upgrade).

Many thanks

0 Kudos