我在我的项目中,突然出现了这个错误:
无法从 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/