簡體   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