使用 VS 2022 RC3 和 SDK6.0.0-rc.2.21501.6
项目文件已经喜欢
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
Microsoft.WindowsDesktop.App.WPF
框架被正确引用,版本6.0.0-rc.2.21501.6
当我尝试构建项目时,我得到一个错误
Error LC0000 'Could not load file or assembly 'PresentationFramework,
Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. Reference assemblies should not be loaded for execution. They can only
be loaded in the Reflection-only loader context. (Exception from HRESULT:
0x80131058)' filename filePathHere LC 1