Android Project can no longer find "App()" in .Net Standard 2.0 after a while

ThreezoolThreezool USMember ✭✭

I have now started two separate projects using .Net Standard 2.0 and the blank template and on both at first everything is fine but after a 5-10 minutes when i start to add some code and compile the Android project suddenly looses the reference to the shared project. I get the following error when i try to run the project:

(1,1): error: Dependent project Savely.App.csproj failed to build, using old version.

But when i try to build the project it builds fine except this error is till there:

'App' is a namespace but is used like a type

The only changes i have had time to make was adding Microsoft App Center nugget packages on the shared project but even after reverting those changes its still not back to normal.

Do any one know what the issue could be?

Answers

  • coeniecoenie USMember

    Did you ever find a solution to your issue?

  • coeniecoenie USMember

    Looks like it was getting confused with the namespace XXX.App because of the default App.xaml file.
    My MainActivity.cs looked like this:

    protected override void OnCreate(Bundle bundle)
    {
      TabLayoutResource = Resource.Layout.Tabbar;
      ToolbarResource = Resource.Layout.Toolbar;
    
      base.OnCreate(bundle);
    
      global::Xamarin.Forms.Forms.Init(this, bundle);
      try
      {
        LoadApplication(new XXX.App.App()); //Problematic line
      }
      catch(Exception ex) { }
    }
    

    I renamed my shared .NetStandard project (and updated all namespaces) to XXX.MobileApp and now it seems to works.

Sign In or Register to comment.