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

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:
image
image
image

Tagged:

Posts

  • ChrisMason.2517ChrisMason.2517 USMember, University

    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.

  • LoriLalondeLoriLalonde CAInsider, University, Developer Group Leader ✭✭✭
    edited July 2015

    @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!

  • YKSugiYKSugi USMember
    edited July 2015

    @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.

    image
    image

    ios4.png 266.7K
  • YKSugiYKSugi USMember

    Thanks, it worked when I added a reference!

  • naseefmtlnaseefmtl USMember, University

    why this errors,?

  • naseefmtlnaseefmtl USMember, University

    please check the attachement and reply me

  • SipkeSchoorstraSipkeSchoorstra NLMember ✭✭

    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.

  • manasaavmanasaav INMember ✭✭

    clean the project ..Rebuild the application

  • PriyaXamarin1PriyaXamarin1 INMember ✭✭

    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.

  • Sumit_SharmaSumit_Sharma USMember ✭✭✭

    @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

  • MuhammadhamzaMuhammadhamza USMember ✭✭


    can anyone help what is the problem?

  • DavalGregoryDavalGregory USMember

    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);
        }
    }
    

    }

Sign In or Register to comment.