LoginSignup
0
0

More than 5 years have passed since last update.

System.TypeLoadExceptionってエラーで実行できない!なぜ!

Last updated at Posted at 2018-03-28

タイトルの通り。昨日までは普通に動いていたはずなのに、画面を表示しようとしてエラーはいたわ:weary:ってことがあったのでまとめます。

そもそも何が起きたか

PageとかのコンストラクタでInitializeComponent またお前かよんでるところありますよね。
private void InitializeComponent() {
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(TopPage));
}

このLoadFromXamlってところでSystem.TypeLoadExceptionが発生。。以下詳細

$exception {"Could not load type 'Xamarin.Forms.Xaml.XamlFilePathAttribute' from assembly 'Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.":"Xamarin.Forms.Xaml.XamlFilePathAttribute"} System.TypeLoadException

解決策

まぁひたすらクリーンしたりしたのですが、改善されず。
答えはNugetのバージョンにあった。

参考:The type or namespace name XamlFilePathAttribute does not exist in the namespace Xamarin.Forms.Xaml

iOSとAndroidはXamarin.Formsのバージョンをあげていたのですが(実装の都合上)、
UWPはあげていなかった。。ただそれだけのこと。

あげたら無事動くようになりました。感謝。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0