Search code examples
c#androiddllxamarin-studio

Xamarin Studio and reference to project


So i try to develop little andriod application by Xamarin Studio 5.4. I have three projects in my solution - project of android application (ClientProject), some class library that used by first one (MyLib) and some console application (ConsoleApp).

But when i try to add reference to MyLib into ClientProject i fail. Xamarin Studio tells me that "Incompatible target framework .NET Framework Version 4.0".

That looks this

enter image description here

I changed MyLib's framework version to 3.5, to 4.5 but it takes no effect.

But when i try to add this reference into ConsoleApp there is no problem:

enter image description here

So i have to add to ClientProject a reference to MyLib.dll so I can not debug its code. What should i do to solve this problem?


Solution

  • The Android project will have a framework of MonoAndroid. This framework is incompatible with the full .NET Framework. Your options are to do one of the following:

    1. Create an Android Library Project.
    2. Create a Portable Class Library Project.
    3. Create a Shared Project.

    If you are only interested in creating an Android application, and not interested in using the library for other mobile platforms, then the first option will be the simplest.