I want to use Entity Framework 6 Code First with Sharepoint 2013 Farm Solutions. Everything works find when I migrate the database (using C# and Console Application).
But then I made a change to model (changed one property from int
to string
). I wanted to update model but then I had an exception:
Could not load file or assembly 'System.Design, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I tried and added reference to the project to System.Design
. Then I got an exception: Could not load file or assembly 'System.Design, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Eventually I removed/commented all Sharepoint references from project and removed the project from GAC. Only then add-migration
and update-database
have worked.
My solution works but it is time consuming and I would love if there was a better one.I think it can be related to System.Design, Version=15.0.0.0 - from what I have found, there is no such version, only 2 or 4. Is there version 15 or is it a Sharepoint bug?
Try to add the following key to the section in your web.config:
<compilation debug="true" targetFramework="4.5" >
<assemblies>
<add assembly="System.Design, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
User contributions licensed under CC BY-SA 3.0