【问题标题】:Visual Studio - Windows UI Library - set TargetPlatformMinVersion and TargetPlatformVersion (C#)Visual Studio - Windows UI 库 - 设置 TargetPlatformMinVersion 和 TargetPlatformVersion (C#)
【发布时间】:2020-06-01 17:42:37
【问题描述】:

我想试试 Visual Studio 中的 Windows UI 库。我已按照 Microsoft 的安装说明进行操作(链接:https://docs.microsoft.com/en-us/windows/apps/winui/winui2/getting-started)。不幸的是,我找不到可以设置“TargetPlatformMinVersion”和“TargetPlatformVersion”的地方。

我找到了这张图片,但我找不到这些设置。

如果我跳过这一步,很遗憾会收到一条错误消息。

非常感谢

【问题讨论】:

    标签: c# visual-studio


    【解决方案1】:

    第一种方法:

    请按照如何更改 TargetplatformVersion 的说明进行操作:

    1) 在 Visual Studio 中右键单击您的项目

    2) 选择“Unload Project“,它现在将显示为ProjectName (unavailable)

    3) 右键点击卸载的项目,选择“Edit projectName.csproj”

    4) 在第一个 <PropertyGroup> 中找到 <TargetPlatformVersion><TargetPlatformMinVersion> 项。

    5) 将TargetPlatformMinVersion 更改为您想要的版本。

    6) 现在保存并关闭文件

    7) 选择“Load Project”再次启动项目。



    第二种方法:

    1) 在 Visual Studio 中关闭您的项目

    2) 使用记事本或记事本++打开您的projectName.csproj

    4) 在第一个 <PropertyGroup> 中找到 <TargetPlatformVersion><TargetPlatformMinVersion> 项。

    5) 将TargetPlatformMinVersion 更改为您想要的版本。

    6) 现在保存并关闭文件

    【讨论】:

    • 非常感谢。我已采用这些设置,不幸的是我现在收到无法找到 XamlControlsResources 的消息。您知道这可能是什么原因吗?
    • 欢迎您,我的朋友,可能您的某个软件包未正确安装或与您的应用程序的当前版本不匹配。请提供更多细节以获得更好的解决方案。
    • 抱歉,如果缺少任何信息。这是我第一次使用 C#,我不确定您需要什么信息。微软用户界面版本 2.4.2;目标框架 .Net Core 3.1 所有错误消息名称“XamlControlsResource 在命名空间“...”中不可用。每个目录条目必须有一个分配的键。找不到类型 XamlControlsResources。确保没有缺少程序集引用并且所有引用的程序集均已创建。XML 命名空间“using:Microsoft.UI.Xaml.Controls”中不存在标记“XamlControlsResources”。
    • 我认为您的 App.xaml 设置不正确,请将“XamlControlsResources”设置为您的应用程序资源。 ->
    • 非常感谢您的回答。我已经尝试了一些东西,但我还没有得出结果。我已将 app.xaml 设置为 Git。你能在那里快速看一下吗? github.com/A456B123/WindowsUIAppXaml/blob/master/App.xaml
    猜你喜欢
    • 2016-01-27
    • 2015-04-01
    • 2016-10-02
    • 1970-01-01
    • 2022-12-18
    • 1970-01-01
    • 2020-03-06
    • 1970-01-01
    • 2011-08-25
    相关资源
    最近更新 更多