Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

TargetInvocationException occuring on running an Android Project but not in Windows Phone project?

$
0
0

Same code is running in one solution but not in another solution.

This has a reference to code in @CharlesPetzold‌ book, Chapter 4 - Version 9 & 10. Version 9 code runs without any errors in both Android & WP projects. But Version 10 code throws System.Reflection.TargetInvocationException.

The code part where exception is occurring is in the HomePage shown below:

`using System;
using Xamarin.Forms;

namespace NoteTaker10
{
class HomePage : ContentPage
{
public Homepage ()
{
... ... ...

  button.Clicked += (sender, e) =>
  {
    ... ... ...
    this.Navigation.PushAsync (new NotePage(note));
  };
  ... ... ...
}  

}
}

using System;
using Xamarin.Forms;

namespace NoteTaker10
{
class NotePage : ContentPage
{
Note note;
bool isNoteEdit;

public NotePage()
{
}

public NotePage (Note note, boolisNoteEdit = false)
{
  ... ... ...
}

... ... ...

}
}
`


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>