Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Support SQL Server HierarchyId data type

$
0
0
Hi thayson_f,

EntityFrameworkWithHierarchyId is not an official EF package, so it has different public key token.
EntityFramework.Extended works with the official EF only.
So if you want to use EntityFramework.Extended, you should change the public key token of the refereced EF in EF.Extended.

You can do it in the following way:
  • Decompile EF.Extended with ildasm
    "c:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ildasm.exe" EntityFramework.Extended.dll
  • Change the public key token for the assembly reference of EF
    from:
    .assembly extern EntityFramework
    {
    .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
    .ver 6:0:0:0
    }
to:
.assembly extern EntityFramework
{
.publickeytoken = (68 47 F3 39 5F C6 1B 47 )
.ver 6:0:0:0
}
  • Remove the strong name from EF.Extended (remove the following lines)
    .publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 // .$..............
            00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00   // .$..RSA1........
            3D 79 B4 C6 A5 5E FC D9 67 12 4F 16 89 97 3C 70   // =y...^..g.O...<p
            6F 25 EF 89 16 BC C1 95 25 CC 6D 13 62 5F 00 98   // o%......%.m.b_..
            01 88 8A 5E 94 EA 78 36 45 37 A9 73 E5 25 C0 41   // ...^..x6E7.s.%.A
            3E 0A 2E CB 41 5D 69 0A 21 F4 C0 4E 56 A1 E6 58   // >...A]i.!..NV..X
            D7 44 86 29 57 14 46 37 CF 64 2F 89 CA F9 71 85   // .D.)W.F7.d/...q.
            BB 4C 5B 46 05 1D E4 CB 31 5A CE 15 65 48 C7 A2   // .L[F....1Z..eH..
            F0 E6 23 40 05 A8 CB B7 6B 75 32 67 7B 2A 4F B5   // ..#@....ku2g{*O.
            CB DA 1D EB CD 30 C9 16 E8 7E 38 DE EF F9 18 C7 ) // .....0...~8.....
    .hash algorithm 0x00008004
  • Compile it again:
    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ilasm.exe EntityFramework.Extended.il /dll
  • Make sure that you use the modified dll in your project.
After this hack it seems to work.

Sorry, but I don't know any better solution:(

zgabi

Viewing all articles
Browse latest Browse all 1793

Trending Articles