Entity Framework Duplicate type name within an assembly (6.1.0)

Posted by CodeMilian on Stack Overflow See other posts from Stack Overflow or by CodeMilian
Published on 2014-04-21T00:50:02Z Indexed on 2014/05/29 21:28 UTC
Read the original article Hit count: 310

I am not sure what is going on but I keep getting the following exception when doing a query. "Duplicate type name within an assembly." I have not been able to find a solution on the web. I had resolved the issue by removing entity framework from all the projects in the solutions and re-installing using nugget. Then all of the sudden the exception is back. I have verified my table schema over and over and find nothing wrong with.

This is the query causing the exception.

    var BaseQuery = from Users in db.Users
            join UserInstalls in db.UserTenantInstalls on Users.ID equals UserInstalls.UserID
            join Installs in db.TenantInstalls on UserInstalls.TenantInstallID equals Installs.ID
            where
                Users.Username == Username
                && Users.Password == Password
                && Installs.Name == Install
            select Users;

    var Query = BaseQuery.Include("UserTenantInstalls.TenantInstall");

    return Query.FirstOrDefault();

As I mentioned previously the same query was working before. The data has not changed and the code has not changed.

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql-server