Error CS0012: The type 'System.ComponentModel.INotifyPropertyChanged' is defined but not found

My first attempt to use Xamarin.Forms and I've his several issues, most of which I've worked around but the latest I cannot find a solutions for, When compiling the sampe code on http://developer.xamarin.com/guides/cross-platform/xamarin-forms/introduction-to-xamarin-forms/ . I ghet a compile erro. At first I thought it was my code and so used the sample code below and still get an erro:

E:\Development\xamarin\formtest01\formtest01\content_main.cs(15,15): Error CS0012: The type 'System.ComponentModel.INotifyPropertyChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. (CS0012) (formtest01)

using System;
using Xamarin.Forms;

/*
* Defines the main page ineterction for the test app
*
*/

namespace formtest01
{
public class StackLayoutExample: ContentPage
{
public StackLayoutExample()
{
Padding = new Thickness(20);
var red = new Label
{
Text = "Stop",
BackgroundColor = Color.Red,
Font = Font.SystemFontOfSize (20)
};
var yellow = new Label
{
Text = "Slow down",
BackgroundColor = Color.Yellow,
Font = Font.SystemFontOfSize (20)
};
var green = new Label
{
Text = "Go",
BackgroundColor = Color.Green,
Font = Font.SystemFontOfSize (20)
};

        Content = new StackLayout
        {
            Spacing = 10,
            Children = { red, yellow, green }
        };
    }
}

}

Any ideas? I've re-installed visual studio express in an attempt to refresh the .net assemblies but to no avail.

Posts

  • MarkMarshallMarkMarshall GBMember

    Sorry the formatting did not go as expected. The offending line is:

    public class StackLayoutExample: ContentPage

  • MarkMarshallMarkMarshall GBMember

    Hi,

    Finally solve the issue.

    The standard solution creator did not create a PCL shared project, so the .Net Portable Subset reference was missing. So I created a PCL project in my solution and transferred the code. I could not configure the correct option for the project because mono.android and mono.ios were not available. Solved this by removing and re-installing xamarin. The last challenge was to select the correct option to allow me to insert the reference into my android project.

    A lot of "wasted" time but I finally got a running demo.

    My conclusion is that, "hopefully", installing MS VS 2013 Desktop Express messed up a lot of stuff in xamarin.

Sign In or Register to comment.