0
所以我改變了我的項目名稱,也是我的文件夾等。我從這裏按照指南How do I rename a Project Folder from within Visual Studio?。一切似乎都工作,我可以啓動我的應用程序,但我得到了很多的警告Xamarin彙編與導入類型衝突
的一些誤差修改和大量警告例如:
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");
}
}
}
所以我認爲它與Assembly的問題? 我增加了參考首先,那麼可能是什麼問題?
我也需要改變我的命名空間嗎?我的PCL項目名稱是「Volaapp」,但我使用的命名空間如:TodoScheduler.Base,因爲我認爲它是指大會。我可能會誤解這個!
我試圖清理解決方案,然後刪除斌,OBJ文件夾,然後重建它,但dident幫助。
那我該怎麼辦?我真的想解決這種情況下,我甚至可以給全碼的這個解決:(
我認爲錯誤信息是很清楚,你有型'ObservableObject'在「Volaapp \基地\ ObservableObject.cs」,而這個名字衝突的另一種類型具有「TodoScheduler,版同名= 1.0.0.0,文化=中立,公鑰=空」,你需要改變它的名字。 –