简体   繁体   English

XAMARIN-在xmlns clr-namespace中找不到

[英]XAMARIN - not found in xmlns clr-namespace

i'm new with Xamarin, i tried to open the simulator iOS but i found this error: 我是Xamarin的新手,我尝试打开模拟器iOS,但发现此错误:

Position 9:14. 位置9:14。 Type infra:IstanceLocator not found in xmlns clr-namespace:Convert.Infrastructure;assembly=Convert 在xmlns中找不到infra:IstanceLocator类型clr-namespace:Convert.Infrastructure; assembly = Convert

MY PROJECT 我的项目

https://snag.gy/98ygVu.jpg https://snag.gy/98ygVu.jpg

App.xaml App.xaml中

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    xmlns:infra="clr-namespace:Convert.Infrastructure;assembly=Convert"
    x:Class="Convert.App">
    <Application.Resources>
        <!-- Application resource dictionary -->
        <ResourceDictionary>
            <infra:IstanceLocator x:Key="Locator"></infra:IstanceLocator>
        </ResourceDictionary>
    </Application.Resources>
</Application>

App.xaml.cs App.xaml.cs

using Xamarin.Forms;
using Convert.Pages;

namespace Convert
{
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new MainPage());
        }

        protected override void OnStart()
        {
            // Handle when your app starts
        }

        protected override void OnSleep()
        {
            // Handle when your app sleeps
        }

        protected override void OnResume()
        {
            // Handle when your app resumes
        }
    }
}

IstanceLocator.cs IstanceLocator.cs

using System;
using Convert.ViewModels;
namespace Convert.Infrastructure
{
    public class InstanceLocator
    {
        public MainViewModel Main { get; set; }

        public InstanceLocator()
        {
        }
    }
}

you have a typo 你有错字

<infra:IstanceLocator x:Key="Locator"></infra:IstanceLocator>

You're missing the "n" in InstanceLocator 您在InstanceLocator中丢失了“ n”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin - 在 xmlns clr-namespace 中找不到类型 - Xamarin - Type not found in xmlns clr-namespace 在xmlns clr-namespace中找不到Xamarin Forms throw Exception: - Xamarin Forms throw Exception is not found in xmlns clr-namespace: 在xmlns clr-namespace:Prism.Behaviors中找不到EventToCommandBehavior - EventToCommandBehavior not found in xmlns clr-namespace:Prism.Behaviors 我需要两个xmlns:local =“clr-namespace”? - Do I need two xmlns:local=“clr-namespace”? xmlns:controls =“ clr-namespace:XLabs.Forms.Controls; assembly = XLabs.Forms”,找不到 - xmlns:controls=“clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms” this is could not find 我如何在 .NET 6.0 中像 XmlnsDefinitionAttribute 那样 map 一个 xmlns 和一个 clr 命名空间? - How can I map a xmlns and a clr-namespace in .NET 6.0 like XmlnsDefinitionAttribute? 无效的 ResourceDictionary clr 命名空间 - Invalid ResourceDictionary clr-namespace 名称空间“ clr-namespace:…”中不存在ViewModel - ViewModel does not exists in the namespace “clr-namespace:…” 名称 &lt;...&gt; 不存在于命名空间 clr-namespace &lt;...&gt; - the name <...> does not exist in the namespace clr-namespace <...> 是否在clr-namespace中不存在UIRoot? - UIRoot does not exist in the clr-namespace?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM