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

Xamarin.Forms Shared Projects Problems

$
0
0

Does anyone actually use shared projects in Xamarin.Forms? I'm not new to XAML, MVVM or even shared projects, just new to Xamarin. And I'm having problems with the simplest things - leading me to think I must have fallen on my head in my sleep last night. At first I tried some fairly complex solutions and had so many issues that I've reduced it to utter simplicity by reading the "Introduction to Xamarin.Forms" and "Getting Started with XAML" articles on the Xamarin site. Here's what I've reduced it to:

  1. I create a new solution (in Xamarin Studio 5.2 build (386) using the Blank App template. I've done both Portable and Shared - more on that in a bit.
  2. Without touching a line of code I run the app on an Android 4.0.3 emulator. So far so good.
  3. I click on either the shared or portable project and add a new file using the Forms ContentPage XAML template and accept the default name of MyPage.
  4. I alter the GetMainPage method of App to "return new MyPage();" That's it - nothing else.

Here's where things get weird. If I have used the Portable template it runs just fine. But if I've used a Shared template I get a compiler error that the type or namespace MyPage can't be found. Yes, I've checked the references and they are identical in both solutions.

What am I missing? What's the secret handshake? How can something as simple as following the most rudimentary of tutorials on Xamarin's Web Site fail so miserably so early?

Thanks for any insights.


Viewing all articles
Browse latest Browse all 58056

Trending Articles