繁体   English   中英

Xamarin程序集与导入的类型冲突

[英]Xamarin assembly conflicts with the imported type

因此,我正在更改项目名称以及文件夹等。我从这里遵循了指南如何在Visual Studio中重命名项目文件夹? 一切似乎正常,我可以启动我的应用程序,但是我遇到了一些错误,并且收到了很多警告

警告示例:

Warning CS0436  The type 'ObservableObject' in 'C:\Users\Godhaze\Documents\Volaapp\Volaapp\Volaapp\Base\ObservableObject.cs' conflicts with the imported type 'ObservableObject' in 'TodoScheduler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\Godhaze\Documents\Volaapp\Volaapp\Volaapp\Base\ObservableObject.cs'.    Volaapp C:\Users\Godhaze\Documents\Volaapp\Volaapp\Volaapp\Base\SelectableObject.cs 5   IntelliSense    Active

和这样的错误:

Error   CS0234  The type or namespace name 'XamlFilePathAttribute' does not exist in the namespace 'Xamarin.Forms.Xaml' (are you missing an assembly reference?)    Volaapp C:\Users\Godhaze\Documents\Volaapp\Volaapp\Volaapp\obj\Debug\TodoScheduler.Pages.MenuPage.xaml.g.cs 14  IntelliSense    Active

错误代码:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace TodoScheduler.Pages {


    [global::Xamarin.Forms.Xaml.XamlFilePathAttribute("C:\\Users\\Godhaze\\Documents\\Visual Studio 2017\\Projects\\Volaapp\\Volaapp\\Volaapp\\Pa" +
        "ges\\MenuPage.xaml")]
    public partial class MenuPage : global::TodoScheduler.Controls.BasePage {

        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
        private global::Xamarin.Forms.ListView listView;

        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
        private void InitializeComponent() {
            global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(MenuPage));
            listView = global::Xamarin.Forms.NameScopeExtensions.FindByName<global::Xamarin.Forms.ListView>(this, "listView");
        }
    }
}

所以我认为这是组装的问题吗? 我首先添加了参考,那么可能是什么问题?

还需要更改名称空间吗? 我的PCL项目名称为“ Volaapp”,但是我使用的命名空间为:TodoScheduler.Base,因为我认为它指的是Assembly。 我可能误会了!

我试着清理解决方案,然后删除bin,obj文件夹,然后重建它,但这确实有所帮助。

所以我该怎么做? 我真的很想解决这个问题,甚至可以提供完整的代码来解决:(

我遇到了同样的问题,发现我正在意外地对包含图像的标签数组执行字体大小更改操作。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM