Add a reference to assembly

Volodymyr_LeskivVolodymyr_Leskiv USMember ✭✭
edited March 2016 in Xamarin.Forms

Hi to all,

I want to add Xlabs to my project, so I read how to implement it ( https://github.com/XLabs/Xamarin-Forms-Labs/wiki ).

I found this problem:

when I try to add this code to "App.cs" in my WinPhone 8.1 project

var app = new XFormsAppWP();
app.Init(this);

on "Init" (app.Init(this)) I had this problem:

The type 'Application' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
'

I have a "Quick Fix" option -> Add a reference to assembly 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e', but when I try to click on it, nothing happens.

In "Reference Manager" (WinPhone project -> Right click -> Add reference) I can't add this reference because I can't found it.

I using Visual Studio 2015 pro, Xamarin.Forms PCL.
My project targeting .NET 4.5 (I tried also with 4.5.2 but I had the same problem).

How can I resolve this problem?

Answers

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    I guess you should add the Xamarin-Forms-Labs component via NugetManager to your project.

  • Volodymyr_LeskivVolodymyr_Leskiv USMember ✭✭

    @ThomasBurkhart I already added Xlabs components (Platform, Forms, Core, IoC and Serialization).

  • GeraldVersluisGeraldVersluis NLUniversity ✭✭✭✭

    Sounds like the problem is a bit deeper.
    Please check your PCL project references. There is probably a exclamation mark there which causes the PCL not to build, therefore your Windows project cannot find your Application object.

  • Volodymyr_LeskivVolodymyr_Leskiv USMember ✭✭

    @GeraldVersluis I checked but the problem is given by "app.Init(this);" ( The type 'Application' is defined in an assembly that is not referenced. You must add a reference to assembly...).
    If I delete Xlabs libraries, my App worked correctly

  • @Volodymyr_Leskiv is this fixed ? I am facing the same problem. Could you please share your solution ?

  • AlexRutherfordAlexRutherford GBUniversity ✭✭

    Did you fix this? I am having the same problem and cannot find a fix.

  • 2kmrChaps2kmrChaps USMember

    Hi all,
    I have a similar issue:
    The type System.IDisposable' is defined in an assembly that is not referenced. Consider adding a reference to assemblySystem.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

    I'm trying to use the StackExchange.Redis.StrongName Nuget package for iOS which I already added. I can't seem to find a way to add the reference mentioned in the error message. This is the C# statement I tried to build which was found here:

    ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");

    Someone please help.
    Thanks for your time.

  • 1xo21xo2 NZMember ✭✭✭

    having the same with UMP
    Error CS0012 The type 'Type' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Sign In or Register to comment.