CS0246: The type or namespace... Seeking help

Hello fellow developers!

I tried to build my first cross platform application and it's working smoothly till now. But since today I have this nasty CS0246 "The type or namespace name could not be found" error and I simply can't find the solution for this. I have one solution with to projects in it, one is the Android project and the other one is a library project (Mono / .NET 4.0) that contains the shared code.

Here is my code:

Android Project:

using Library;
namespace ClassA.App.Android
{
    public class WeekdayAdapter : BaseAdapter
    {
        private Context context;
        private List<CalendarDayFileStruct> daysInCurrentMonth;

        public WeekdayAdapter(Context context)
        {
            this.context = context;
            daysInCurrentMonth = new List<CalendarDayFileStruct>();
        }
    }
}

Core Library:

namespace Library
{
    public class CalendarDayFileStruct
    {
        public int day { get; set; }
        public bool emptyDay { get; set; }

        public CalendarDayFileStruct (int day, bool emptyDay)
        {
            this.day = day;
            this.emptyDay = emptyDay;
        }
    }
}

First thing first, I added the using directive (using Library.Core) and added the reference from the library to the Android Project. But when I try to build my solution the CS0246 error comes up, pointing at the codefile in the Android project at the line "private List daysInCurrentMonth;" that he can't find "CalendarDayFileStruct". IntelliSense works and I can use "Go to definition" in VS2010 on it, but only building doesn't work.

Can anyone help me with this? When more code or information is needed I will happily offer it.

Posts

  • ArneDeVreeseArneDeVreese BEMember ✭✭

    Having the same problem here in Xamarin Studo after upgrading to the latest version of Xamarin Studio (4.0.9) and Xamarin.Android (4.6.8)

    Building the individual projects works, but building the solution goes wrong...

    Any solution come across?

  • ArneDeVreeseArneDeVreese BEMember ✭✭

    hmmm, i got it working by setting 'local copy' of my references to OFF in my Project that i include (not on my 'Application' project).

    I hope this trick helps for you...

Sign In or Register to comment.