The type or namespace name 'Xamarin' missing in xamarin studio

Multi tool use
Multi tool use


The type or namespace name 'Xamarin' missing in xamarin studio



I'm getting this error "MyAppApp.cs(7,7): Error CS0246: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?) (CS0246)". i'm using Xamarin studio to make cross platform app via Xamarin.Forms but whenever i build the basic form project i get this error don't know why.I'm new in xamarin.Help me if someone know the answer. Here is the code of app.cs:


using System;
using Xamarin.Forms; //This is the line where error occurs

namespace FIrstFormProject
{
public class App
{
public static Page GetMainPage ()
{
return new ContentPage {
Content = new Label {
Text = "Hello, Forms !",
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
},
};
}
}
}





have you referenced the dll which contains Xamarin.Forms in your project? (presumably something like Xamarin.Forms.dll)
– Sam Holder
Jun 2 '14 at 12:20





@SamHolder no but i'm not getting option of adding that reference. can u tell me briefly ? may be this is reason of error
– Hamza Khalil
Jun 2 '14 at 13:02




10 Answers
10



MihaMarkic's post here led me to the right answer. For each project in your solution you'll need to do the following:



This is the workflow that got it working on my Mac. I'm not sure what the exact steps are for you PC users out there.





works same way on PC - once I realized where to look for step 2 -- MENU "Project"; which has menu item "Add Nuget Packages..." for step 3.
– ToolmakerSteve
Apr 26 '15 at 9:37





for me, the "Add Nuget Packages.." doesn't work for me, so i clicked the "Update Nuget Packages..." it works fine.. thanks @eckyzero
– S Gaber
Oct 31 '16 at 3:55



I just had to add the Xarmin.Forms.Addin.dll in app's references. :) (Thanks @sam holder your hint in the comments led me to the answer.)





glad you got it fixed
– Sam Holder
Jun 2 '14 at 13:45





Most of this answer is a thank you, rather than an actual answer. It would probably be better to lead with the solution, then credit the other user with leading you in the right direction. It also wouldn't hurt to flesh out the steps you took to solve the problem.
– Allan
Oct 8 '14 at 22:02





Tell us how you fixed it please. "Thanks" sucks.
– dubyaa
Oct 27 '14 at 23:15





This is the link to know how to add reference.And you just have to add Xamarin.Froms.Addin library to get through this error.
– Hamza Khalil
Nov 7 '14 at 6:19





Where would "Xamarin.Forms.Addin" be located?
– Shilpa Soni
Feb 19 '15 at 7:05




Do the following:



Select the solution & right click
Go to Restore Manage Nuget Packages



You are ready to work with xamarin.forms :)





After updating I needed to close and re-open VS (VS2017 in my case) before the references showed back up.
– Andy S.
Jan 17 at 15:29





@AndyS. Thank you for your comment. It helped me.
– rach
Apr 17 at 17:24



Do the following



3.Go to control panel select programs and features and right click xamarin choose repair.
4. Start xamarin studio again.



This happened when I removed the Xamarin.Android.Support.v4 and Xamarin.Forms library in order to downgrade to an earlier version. I got it working again by resetting the Droid packages.config to:


Xamarin.Android.Support.v4


Xamarin.Forms


packages.config


<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="22.1.1" targetFramework="MonoAndroid44" />
<package id="Xamarin.Forms" version="1.4.2.6355" targetFramework="MonoAndroid44" />
</packages>



Then right-click the Droid Packages folder to Restore missing packages.
The final step is to add the References > From Packages to the *.Droid.csproj


Packages


References


From Packages


<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..packagesXamarin.Android.Support.v4.22.1.1libMonoAndroid403Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..packagesXamarin.Forms.1.4.2.6355libMonoAndroid10Xamarin.Forms.Platform.Android.dll</HintPath>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..packagesXamarin.Forms.1.4.2.6355libMonoAndroid10FormsViewGroup.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..packagesXamarin.Forms.1.4.2.6355libMonoAndroid10Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..packagesXamarin.Forms.1.4.2.6355libMonoAndroid10Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..packagesXamarin.Forms.1.4.2.6355libMonoAndroid10Xamarin.Forms.Platform.dll</HintPath>
</Reference>



Look for your Target. Some targets aren't compatible with Xamarin.



I had to uninstall and reinstall Nuget Xamarin.Forms in both the Android and PCL library.




Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).


Would you like to answer one of these unanswered questions instead?

AuSAB3z5xSDY Huqs8w7jT6axf6gWQV5yuEQHFCu,Pse2Ybfj sjsnp3,pYjh24Jt NbMP hnWu33OU7ZhN,xOJ,bXXM9Wo Ls dS
nRd1jX0ii

Popular posts from this blog

Rothschild family

Cinema of Italy