locked
Error CS0246: The type or namespace name 'Xamarin' could not be found RRS feed

  • Question

  • User55492 posted

    Why i am getting error in new generated Project (Xamarin.Forms Project)? Error CS0246: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?) (CS0246)

    Monday, June 2, 2014 1:40 PM

All replies

  • User352 posted

    It looks like your library project is missing the reference. I think template unfolding failed. Can you try re-creating the project?

    Tuesday, June 3, 2014 12:34 AM
  • User55492 posted

    Yeah i got there is reference missing But my Question is Why? Even i Tried more than 10 times to re-create the project in Every possible way But still no way found to overcome this issue. Can you help me to override the problems?

    Thanks in Advance.

    Tuesday, June 3, 2014 4:53 AM
  • User352 posted

    Are you using Xamarin Studio on Windows?

    Tuesday, June 3, 2014 4:59 AM
  • User55492 posted

    Yeah right i am using Xamarin Studio for Windows Version 5.0

    Tuesday, June 3, 2014 5:02 AM
  • User352 posted

    Okay I can confirm this is an issue on Xamarin Studio for windows, I am alerting the XS team. You probably want to use XS for OSX or using Xamarin for Visual Studio.

    Tuesday, June 3, 2014 5:03 AM
  • User55492 posted

    Currently i am using XS on Windows, not Xamarin for Visual Studio.

    Tuesday, June 3, 2014 5:12 AM
  • User55492 posted

    So now what should i do? i mean please can you suggest me a better or alternative way to Create Xamarin.Forms Project So i can move on my Project.

    Thanks @JasonASmith? for reply

    Tuesday, June 3, 2014 5:17 AM
  • User352 posted

    I can't resolve your issue, the problem is a bug in Xamarin Studio for Windows. You will need to either use XS for OSX or Xamarin for Visual Studio until Xamarin Studio for Windows is fixed.

    Sorry :(

    Tuesday, June 3, 2014 5:17 AM
  • User55492 posted

    OK, Thanks @JasonASmith?

    Tuesday, June 3, 2014 5:25 AM
  • User1350 posted

    I had the same issue on OSX, I had to re-create the project.

    Wednesday, June 4, 2014 11:31 PM
  • User56499 posted

    Also stuck. Xamarin Studio on Windows 8 trying to use Xamarin.Forms... I find it sad to waste my trial period doing nothing... :-(

    Tuesday, June 10, 2014 8:33 PM
  • User14 posted

    I'm able to successfully download and run Xamarin.Forms samples from http://github.com/xamarin/xamarin-forms-samples on Windows 8.1 with Xamarin Studio 5 (Android parts of the solutions only).

    Even without being able to create a new, blank solution from scratch, it's fairly easy to pick one of the simpler sample apps and start modifying it. Don't let the Xamarin Studio for Windows broken template hold you back @nikolajskov? , @RajivChowdhery?

    Wednesday, June 11, 2014 12:22 AM
  • User56499 posted

    Thanks, @CraigDunn. I'll give it a try.

    Wednesday, June 11, 2014 11:41 AM
  • User57812 posted

    Fixed this on XS OSX by going into Project > Edit referencers and double clicking on "Xamarin.Forms.Core.dll" on the right-hand side menu. Doesn't seem to do anything but the compile error went away.

    Thursday, June 12, 2014 9:32 PM
  • User63992 posted

    I am using v5.2.1 and if you use NuGet (Project | Add Packages...) to search for Xamarin.Forms it will add the relevant packages to your project and this should get rid of the error message.

    Monday, September 1, 2014 1:36 PM
  • User96874 posted

    I was resolve it by Add Refrence of Project. Suppose your project is TestApp1, So to add its dll First select TestAPP1.Android >> Add >> Add Web Refrence >> Select TestApp1 Tab and Chose dll that required (TestApp1.dll) and click on Add. Now can build your project successfully.

    Thursday, January 8, 2015 6:02 AM
  • User122180 posted

    I find the solution for this problem. The reason for this error is the complier can not find the corresponding .dll files, so if you add the .NET Assembly path for that .dll file, you will solve the problem.

    right-click the "reference" of project, and enter the "Edit References...", then choose the ".NET Assembly" tab, click the "Browser.." button, navigate to the path of that .dll file, and make sure the right path be added in the reference, you will find everything is ok!

    Monday, April 20, 2015 3:14 AM
  • User122180 posted

    PS: The platform is Windows 8.1 Professional Edition, and Xamarin Studio is version 5.7.1

    Monday, April 20, 2015 3:16 AM
  • User122180 posted

    I found another solution for this problem. When I look through the setting files for project, I found something stange. For example, when I add the "POIApp" project to the "POITestApp" References, in the POITestApp.csproj file, there are something be added as follow: {921FF87A-B1A4-45AA-BBAB-77EBD858CEBF} POIApp True False

    But When I delete this following two lines from that file and save it: True False

    I found the problem be solved, the solution be bulid successfully. But the smart code intellsense still don't work. And I'm searching the reason cause it.

    Monday, April 20, 2015 9:29 AM
  • User80441 posted

    Xamarin studio so buggy!!

    Wednesday, August 19, 2015 7:19 AM
  • User188427 posted

    So, it's Jan 17 2016 and the issue is still there. Installed new XS >> New Hello World project >> Cannot find Xamarin.Forms Any ideas. Nothing of the obove mentioned fixes works...

    Xamarin Studio Version 5.10.1 (build 6) Installation UUID: 684bdc2b-d07c-479e-9322-b5f04221bbd6 Runtime: Microsoft .NET 4.0.30319.34209 GTK+ 2.24.23 (MS-Windows theme) GTK# 2.12.30

    Xamarin.Profiler Not Installed

    Xamarin.Android Version: 6.0.0 (Starter Edition) Android SDK: D:\Xamarin\google Supported Android versions: 4.0.3 (API level 15) 4.4 (API level 19) 5.1 (API level 22) 6.0 (API level 23)

    SDK Tools Version: 24.4.1 SDK Platform Tools Version: 23.1

    SDK Build Tools Version: 23.0.2

    Java SDK: C:\Program Files (x86)\Java\jdk1.7.071 java version "1.7.071" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

    Xamarin Android Player Not Installed

    Build Information Release ID: 510010006 Git revision: 0b60eecdb531933734519c13257d16a780274aab Build date: 2015-12-04 19:20:22-05 Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af Build lane: monodevelop-windows-cycle6-baseline

    Operating System Windows 6.3.9600.0 (64-bit)

    Sunday, January 17, 2016 11:52 AM
  • User172239 posted

    I have a Problem: The type or namespace name 'PersistableBundle' could not be found(are you missing a using directive or and assembly reference?) (CS0246)

    Friday, March 25, 2016 3:07 PM
  • User236584 posted

    Hi. I have the same issue as ilyas above. I need this to work so i can continue with my app. I am trying to learn how to use xamarin and mvvm but this is very hard and confusing.

    I am using Xamarin from within visual studio 2015 enterprise.

    All i am trying to do is create a splash screen for my app, something which took me minutes in Apache Cordova.

    Friday, July 1, 2016 12:54 PM
  • User170690 posted

    Hi I’m learning how to use a “Creating Custom Row Layouts” and I’m having the same issue with Visual Studio 2015, I’m getting an error on Error: The type or namespace name ‘TableItem’ could not be found(are you missing a using directive or an assembly reference?)

    Code example is from https://developer.xamarin.com/guides/android/userinterface/workingwithlistviewsandadapters/part3-customizingalistview's_appearance/

    public class HomeScreenAdapter : BaseAdapter { ListView listView;

            List<TableItem> items;
            Activity context;
            public HomeScreenAdapter(Activity context, List<TableItem> items)
                : base()
            {
                this.context = context;
                this.items = items;
            }
            public override long GetItemId(int position)
            {
                return position;
            }
            public override TableItem this[int position]
            {
                get { return items[position]; }
            }
            public override int Count
            {
                get { return items.Count; }
            }
            public override View GetView(int position, View convertView, ViewGroup parent)
            {
                var item = items[position];
                View view = convertView;
                if (view == null) // no view to re-use, create new
                    view = context.LayoutInflater.Inflate(Resource.Layout.CustomView, null);
                view.FindViewById<TextView>(Resource.Id.Text1).Text = item.Heading;
                view.FindViewById<TextView>(Resource.Id.Text2).Text = item.SubHeading;
                view.FindViewById<ImageView>(Resource.Id.Image).SetImageResource(item.ImageResourceId);
                return view;
            }
        }
    

    My objective is to have the Android App display several rows for data that was consume from a REST server(Json serialization process).

    Sunday, January 29, 2017 3:22 PM
  • User297337 posted

    For those who are still facing CS0246 error using Visual Studio on Windows, I found a way to solve it.

    Right click on Solution >> Manage NuGet Packages for Solutions, select the "Browse" tab and search for "Xamarin.forms", then install the first one Xamarin.Forms.

    It solved my problem!

    Saturday, February 4, 2017 9:52 PM
  • User280913 posted

    @MrPenguin said: For those who are still facing CS0246 error using Visual Studio on Windows, I found a way to solve it.

    Right click on Solution >> Manage NuGet Packages for Solutions, select the "Browse" tab and search for "Xamarin.forms", then install the first one Xamarin.Forms.

    It solved my problem!

    a resposta dele funciona (caso venha Brasileiro aqui procurando uma solução)

    Saturday, March 25, 2017 6:08 PM
  • User249671 posted

    I solved the problem by setting the right solution platform. E.g for UWP set it to x86, set IOS and Andriod solution platform. For me everything worked fine.

    Friday, June 2, 2017 10:23 AM
  • User326314 posted

    I was trying to solve the Error CS0246: The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?) (CS0246). When I tried to see more into the warning section, I could see that the project name was exceeding the required length. Renaming the project solved the issue.

    Tuesday, June 6, 2017 10:46 AM
  • User361757 posted

    Hi. I have the same problem, when i build the ios project. I have Visual Studio 2017 version 15.5.1 and Xcode 9.2

    Friday, December 15, 2017 2:12 PM
  • User59780 posted

    starting to get the same issues using Visual Studio 2017. Apps has been working just fine now today... same issues everyone is having. I have the latest visual studio too. smh. Microsoft need to get rid of Xamarin Studio. Kill that project 100%. Everything should be done EASILY inside Visual Studio. Every tutorial online should be ONLY visual studio. Create a migration tool to move everyone's code from Xamarin Studio to Visual Studio.

    Thursday, March 15, 2018 5:56 PM
  • User59780 posted

    For my solution, I had to uninstall Xamarin.Forms and reinstall Xamarin.Forms. it works now.

    Thursday, March 15, 2018 6:15 PM
  • User59780 posted

    stopped working again.. lol and all I did was restart VS.

    Thursday, March 15, 2018 6:21 PM