Archive for July, 2015

Inconsistent accessibility, and other personal problems

I had a fairly simple scenario involving MVC and EF, two technologies I prefer to avoid, but what can you do? I was implementing an interface like so:

 public class EntityDetailRepository : EntityRepository<EntityDetail>, IEntityDetailRepository {
  public EntityDetailRepository()
   : base() {
  }

However, for my troubles, I was getting this error:

Inconsistent accessibility: base interface ‘Yada.IEntityRepository<EntityDetail>’ is less accessible than interface ‘Yada.IEntityDetailRepository’
The interfaces were declared “public”, so the compiler was obviously deranged, and close to going all HAL on me. Luckily, before it could do that, I discovered that the underlying type, EntityDetail, was not:

    class EntityDetail {
        public int ID { get; set; }
    }

See, no “public”. After I made the type public, all was well:

    public class EntityDetail {
        public int ID { get; set; }
    }
Advertisements

Leave a comment

The required anti-forgery cookie “__RequestVerificationToken” is not present.

Sometimes this error isn’t what you think.

I had dutifully put the “@Html.AntiForgeryToken()” call in the Views, and then attached the “[ValidateAntiForgeryToken]” tag to the right events. On the staging server, all was well, but when I debugged the project locally, I was getting the error.

A change to my web.config was the problem. I had added the following tag:

<httpCookies requireSSL="true" />

The problem was that when debugging locally, my system didn’t use SSL. Removing this tag from the debug build worked.

Leave a comment