Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have installed Xamarin just now, but when i wanna add new references, i see no .Net Framework.

Xamarin ported a subset of .Net Framework, i wanna get it and use.
I see it on the Xamarin's website, it is called "Base Class Library":
http://api.xamarin.com/[^]

So, how can use Base Class Library in my new project?
Posted
Updated 6-Apr-15 8:50am
v4

Please see: http://en.wikipedia.org/wiki/List_of_data_types_of_the_Standard_Libraries#Base_Class_Library.

You can use BCL classes the same way as you do it in .NET: you reference the assembly by its strong name, assuming that this assembly is placed in GAC (http://en.wikipedia.org/wiki/Global_Assembly_Cache).

After you do it, top-level assembly types become accessible to your assembly code by full names, which you can shorten in use using using declarations (not to be mixed up with using statements).

Basically, the assembly name is referenced in a command line of appropriate build tools. If you use Xamarin Studio, please see http://developer.xamarin.com/guides/cross-platform/getting_started/introducing_xamarin_studio, the section "Assembly References". By the way, it looks exactly the same in different IDE: Visual Studio, SharpDevelop, MonoDevelop.

—SA
 
Share this answer
 
v2
Comments
Ziya1995 6-Apr-15 15:40pm    
No, you didn't answer.

I opened the next page:
http://androidapi.xamarin.com/
I see "System.Windows.Forms" on the page in "Base Class Library", it means it is supported by Android.
I wanna add a reference to it to use in my Android app.
But i can't do it, how to do?

I feel like "System.Windows.Forms" is Windows specific, but that fact - it is in the list for Android. What is wrong?
Ziya1995 6-Apr-15 16:17pm    
Solved: Solution 2.
Sergey Alexandrovich Kryukov 6-Apr-15 17:10pm    
Sure, it tells you the names. What was the problem?
—SA
Sergey Alexandrovich Kryukov 6-Apr-15 17:08pm    
Hm... The names are well-known, they depend on the platform version. When you click "Add Reference", you are supposed to see all assemblies... Don't you?
And now, Forms is a non-standard Microsoft library implemented in Mono and Xamarin. It is not a part of BCL. In all cases, you can add reference to whatever you have in GAC.
—SA
Ziya1995 7-Apr-15 6:07am    
> you can add reference to whatever you have in GAC.
I don't know what is GAC, but BCL is not included into any API completely.
There are 3 APIs and the list shows everything included into a certain API in exception BCL.

The answer from another forum:
"You can't use Windows Forms in an Android app. That doc is misleading - it is showing you everything in the BCL, not the classes specifically supported in Xamarin Android."

That was a problem.
Just a note, Xamarin can also work from within Visual Studio - check this out - http://xamarin.com/visual-studio[^].
 
Share this answer
 
The next page shows API for Android:
http://androidapi.xamarin.com/[^]
It shows Base Class Library (BCL) first, but it is not included into the API.
You can use only what you see after BCL, you can use everything out the list in exception of BCL.
BCL is all APIs used by all 3 platforms and it is a subset of .Net Framework.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900