奇妙な問題があります。Windows Phone 7 アプリを開発しています。最初、ターゲットの Windows Phone OS バージョンは 7.0 に設定されていました (プロジェクトのプロパティで)。すべてがうまくいきました。
ただし、ターゲット OS をバージョン 7.1 にアップグレードすると、例外が発生します: XamlParseException "[Line: 0 Position: 0]"。このメソッドの LoginPage.gics で例外が発生します。
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/BCMLogic;component/Pages/LoginPage.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
this.image1 = ((System.Windows.Controls.Image)(this.FindName("image1")));
this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
this.loginBtn = ((System.Windows.Controls.Button)(this.FindName("loginBtn")));
this.userNameTxt = ((System.Windows.Controls.TextBox)(this.FindName("userNameTxt")));
this.passTxt = ((System.Windows.Controls.PasswordBox)(this.FindName("passTxt")));
this.clientTxt = ((System.Windows.Controls.TextBox)(this.FindName("clientTxt")));
this.user = ((System.Windows.Controls.Image)(this.FindName("user")));
this.passwd = ((System.Windows.Controls.Image)(this.FindName("passwd")));
this.welcome = ((System.Windows.Controls.Image)(this.FindName("welcome")));
this.client = ((System.Windows.Controls.Image)(this.FindName("client")));
this.progressOverlay = ((Coding4Fun.Phone.Controls.ProgressOverlay)(this.FindName("progressOverlay")));
}
}
}
エラーが次の行に表示されます: this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
LoginPage.xaml のメイン グリッドは次のようになります。
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
....
</Grid>
内部例外はnullなので、そこに情報はありません。これは、プロジェクト dll によって参照されているものが、プロジェクトをアップグレードした OS のバージョンと互換性がないという事実に何らかの形で関連していますか? これを確認するにはどうすればよいですか?他の投稿を調べるのに時間を費やしましたが、私の問題に合った解決策を見つけることができませんでした.
事前に助けてくれてありがとう:)