首页 > 解决方案 > 在 ..Net5.0 中找不到 System.Windows.GridLength

问题描述

我无法将应用程序从 .NetFramework 转换为 .Net5.0。例如,我在 Properties.Settings.Default 中正确设置了一个 System.Windiws.GridLength 类型的变量,我在 Net5.0 中无法再引用它,因为它无处可寻(我收到错误“System.Windows. GridLength 类型未定义”,方法是在类型选择窗口的相应字段中插入类型名称,方法是从设置窗口的“类型”列中的弹出菜单中选择“浏览”项来显示)。我错过了什么?

**** 编辑 ************

我的项目的 .csproj 按要求:

<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
   <OutputType>WinExe</OutputType>
   <TargetFramework>net5.0-windows</TargetFramework>
   <UseWPF>true</UseWPF>
   <StartupObject>Stats4Betting_NetCore.App</StartupObject>
   <ApplicationIcon>Resources\soccer_boom_alt.ico</ApplicationIcon>
   <Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>
  <ItemGroup>
    ....
  </ItemGroup>
</Project>

标签: c#.net-5

解决方案


推荐阅读