【问题标题】:Why I get This error? Can't Load Types From为什么我会收到此错误?无法从中加载类型
【发布时间】:2018-08-03 03:19:05
【问题描述】:

我在我的项目中,突然出现这个错误:
Can't load types from 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>

【问题讨论】:

  • I was in my project and suddenly, this error appeared: 在编译时?运行? forums.xamarin.com/discussion/98377/… 有帮助吗?
  • 您是否尝试过重命名课程或其他内容?
  • @TheGeneral 是的,有一段时间有效,但它仍然
  • 你改什么名字了
  • @TheGeneral 它是新的,现在我将文件名和类名更改为 Newpage

标签: c# android ios xaml xamarin


【解决方案1】:

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

Xaml

<ContentPage
    x:Class="YourNameSpace.SomeAwesomeNamePage"

代码背后

public partial class SomeAwesomeNamePage : ContentPage

【讨论】:

  • @GerardoMartinez 我可以建议创建一个新页面,它会更快,重新开始。然后比较差异
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-01-22
  • 1970-01-01
  • 1970-01-01
  • 2018-06-22
  • 2016-01-01
相关资源
最近更新 更多