Namespace used as a Type? RRS feed

  • Question

  • Hello,

    I know there are many threads already here in regards to this, but I do not see at all why I would be getting this error. I have used this struct the same way MANY times before.

    Here is the class:

    namespace DigitalBillboard
        public struct Account
            public string windows_id;
            public string password;
            public string gers_id;
            public string region;
            public string store_group;
            public string home_store;
            public string home_store_region;
            public string email_address;
            public string home_store_phone;
            public string fname;
            public string lname;
            public string full_name;
            public ArrayList arr;

    And here is how it is being called in my CodeBehind:

    Account acc = (Account)(Session["Account"]);

    Very simple, and like I said, used MANY times throughout our applications.

    Why would the compiler throw the "'DigitalBillboard.Account' is a 'namespace' but is used like a 'type'" error?

    Any help would be greatly appreciated.



    • Edited by donato1026 Friday, April 1, 2016 3:40 PM
    Friday, April 1, 2016 3:39 PM


  • Do you perhaps have a namespace also called DigitalBillboard.Account?

    E.g. Some code somewhere saying:

    namespace DitigalBillboard.Account
      // etc

    • Proposed as answer by Kristin Xie Thursday, April 14, 2016 9:33 AM
    • Marked as answer by DotNet Wang Monday, April 18, 2016 8:42 AM
    Friday, April 1, 2016 3:46 PM