【问题标题】:Cant load `PresentationFramework` after upgrade C# .Net 4.8 to .Net 5 (or 6)将 C# .Net 4.8 升级到 .Net 5(或 6)后无法加载“PresentationFramework”
【发布时间】:2021-11-07 18:02:57
【问题描述】:

使用 VS 2022 RC3 和 SDK 6.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   

【问题讨论】:

标签: c# .net-6.0 visual-studio-2022


【解决方案1】:

这与 Telerik 文件 Licenses.licx 相关,该文件引用了 .NET 4.7 组件。

【讨论】:

    猜你喜欢
    • 2022-07-07
    • 2022-01-21
    • 2010-12-26
    • 2013-03-22
    • 2022-07-21
    • 1970-01-01
    • 2021-12-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多