The type or namespace name ‘App’ could not be found. Are you missing an assembly reference? RRS feed

  • Question

  • User138517 posted

    I got this error when I was trying to deploy this: https://github.com/xamarin/xamarin-forms-samples/tree/master/BugSweeper

    I was able to build other Android/iOS apps that don't rely on Xamarin.Forms, so I think that's where the problem is from.

    And here are some screenshots:

    Tuesday, July 7, 2015 7:15 AM

All replies

  • User139626 posted

    sometimes it seems to work to build all the projects... and then the error goes away...it seems the thing it is referring to hasn't been compiled yet...so I find I can debug in the Android for example.. Set your startup project and build it..and then test..see if the error goes away.

    Thursday, July 9, 2015 5:51 PM
  • User48032 posted

    @YKSugi In the Android screenshot you provided it doesn't look like you have the BoxViewClock Portable Class Library loaded in Xamarin Studio. It needs to be loaded and included in the build configuration so it's compiled as well. The App class is in the BoxViewClock Portable Class Library project which is why it can't find it.

    In the iOS screenshot you provided, the PCL is listed and loaded in Xamarin Studio, but it doesn't look like it's being built with the project. Right-click on the solution name in Xamarin Studio, select Options. In the Solution Options dialog select Configurations under the Build node, and select the Configuration Mappings tab. Make sure the Build checkbox is selected for each project (platform specific and PCL). Rebuild the project.

    Let me know if this helps!

    Thursday, July 9, 2015 6:10 PM
  • User138517 posted

    @LoriLalonde I tried what you suggested, and I'm still getting the same error. Here are some screenshots. I've been getting the same errors with Android as well.

    Friday, July 10, 2015 7:19 AM
  • User48032 posted

    @YKSugi check the References in your BoxViewClock.iOS app to make sure it has a reference to the BoxViewClock PCL. Also you need a using directive in your AppDelegate.cs to include the namespace that the App class is part of in the BoxViewClock PCL. Let me know if that solves the problem!

    Friday, July 10, 2015 2:00 PM
  • User138517 posted

    Thanks, it worked when I added a reference!

    Saturday, July 11, 2015 5:14 AM
  • User176262 posted

    why this errors,?

    Thursday, December 17, 2015 12:37 PM
  • User176262 posted

    please check the attachement and reply me

    Thursday, December 17, 2015 12:37 PM
  • User204553 posted

    I seem to have the same issue. I have a Xamarin.Forms project that references a PCL project. The solution builds fine, but as soon as I open a XAML file and switch back to any C# class in the Xamarin.Forms project, VS complains about being unable to resolve types from the PCL. When I manually re-add the project reference to the PCL, the issue goes away, but then as soon as I open a XAML file, the issue appears again.

    Tuesday, March 22, 2016 10:56 AM
  • User309620 posted

    clean the project ..Rebuild the application

    Wednesday, April 19, 2017 12:27 PM
  • User333156 posted

    Hi all, Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)

    i am getting this error in all platforms like xamarin.android, ios, uwp in xamarin.forms

    Please help me to resolve it.

    Thursday, June 29, 2017 12:26 PM
  • User324047 posted

    @PriyaXamarin1 , Sorry for the late response , i hope you have sorted out your error.

    But to remove your error , Add Reference of of PortableProject into all Platforms project , by clicking on References in each platform project -> Add References -> Project -> Add you portable project reference

    Wednesday, July 19, 2017 6:02 AM
  • User341826 posted

    can anyone help what is the problem?

    Tuesday, September 5, 2017 3:52 PM
  • User346648 posted

    Hi guys, Good day. I'm having the same issue above as well.

    CODE :smile:

    using System; using System.Collections.Generic; using System.Linq;

    using Foundation; using UIKit; using Xamarin.Forms; using Xamarin.Forms.Xaml; using Xamarin.Forms.Platform.iOS; using XFormsUI.iOS.CustomRenderer;

    namespace XFormsUI.iOS { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register("AppDelegate")] public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate { // // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { global::Xamarin.Forms.Forms.Init(); LoadApplication(new App());

            return base.FinishedLaunching(uiApplication, launchOptions);


    Monday, November 6, 2017 2:08 PM
  • User31568 posted

    No solution?

    I have the same problem and the portable project is already added as a reference in both Droid and iOS

    Wednesday, November 29, 2017 4:46 PM
  • User162878 posted

    same here using the latest version of VS 2017 and Xamarin.Form

    Friday, January 5, 2018 6:22 PM
  • User364586 posted

    I had this too in a brand new App with a Standard .Net Library. Removing the reference to the lib and readding it fixed it.

    Wednesday, January 31, 2018 8:14 PM
  • User283325 posted

    I had this error: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?and I had a problem with AdMob .What I did, I downgrade Xamarin.Forms from version to version, after that all projects worked fine.

    Friday, March 2, 2018 7:13 AM
  • User13174 posted


    I was jerking around with my project files and moved them around. I then got the same issue (App could not be found anymore). Two things you can check:

    1) Is the shared / PCL project referred from the platform specific projects? 2) In my case, the App.xaml.cs Build action wasn't set to "Compile" anymore which caused this. Also, check that the App.xaml file's Build action is set to EmbeddedResource

    Thursday, March 29, 2018 1:37 PM
  • User386059 posted

    @xxayy said: I had this too in a brand new App with a Standard .Net Library. Removing the reference to the lib and readding it fixed it.

    This Worked for myself! Thanks @xxay, very simple solution. I had moved my project to another drive and it messed up most of the bindings. I also had to remove and re-add in the DROID project as well. Ty.

    Thursday, June 6, 2019 4:42 PM
  • User382584 posted

    @xxayy said: I had this too in a brand new App with a Standard .Net Library. Removing the reference to the lib and readding it fixed it.

    This also worked for me. Thank you @xxayy!

    Monday, June 1, 2020 12:47 PM