1
votes

I am using entity framework power tools 4 (beta). My project uses asp.net identity and EF 6.1.2. I have updated all the entity framework dlls via nuget. When I attempt to pre generate a view with EF Powertools for my dbcontext i receive the error :

Could not load type 'System.ComponentModel.DataAnnotations.Schema.IndexAttribute' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I have updated my EF to 6.1.2 so it is the latest. Has anyone else experienced this issue and solved it. I've seen people on the EF Powertools site posting similar issues to this but there's no solution I can find.

Thanks

UPDATE : - I have reinstalled all the packages with no luck. I have even gone as far as giving the solution to someone else to install on their pc - and they can run it and generate the views using power tools without the error. So it's probably something to do with my environment. Any ideas what to try changing ?

2

2 Answers

0
votes

The IndexAttribute is a new feature that is added in Entity Framework 6.1. You say that you have updated to 6.1, but the error suggests that you have a reference to version 6.0.

Can you remove all references to EF and System.Data.Entity and then try to install it again with Nuget?

0
votes

The reason is that Power tools use the IDE version of EntityFramework and not the referenced. Please check my solution EntityFramwork Power Tools error while generating views