gpt4 book ai didi

c# - 为什么我会收到此错误?无法从中加载类型

转载 作者:行者123 更新时间:2023-11-29 11:33:02 24 4
gpt4 key购买 nike

我在我的项目中,突然出现了这个错误:
无法从 xmlns http://schemas.microsoft.com/winfx/2006/xaml/presentation TaskX.UWP C:\Users\M\source\repos\TaskX\TaskX\TaskX\New.xaml 加载类型

这是我的完整代码:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage

x:Class="TaskX.New"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TaskX"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

<StackLayout>
<Label Text="Hello World"/>
</StackLayout>

</ContentPage>

最佳答案

如果您要重命名页面,您需要确保 xaml 类指向您的支持类

Xaml

<ContentPage
x:Class="YourNameSpace.SomeAwesomeNamePage"

代码隐藏

public partial class SomeAwesomeNamePage : ContentPage

关于c# - 为什么我会收到此错误?无法从中加载类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51664841/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com