﻿{"id":39,"date":"2013-04-01T19:17:19","date_gmt":"2013-04-01T17:17:19","guid":{"rendered":"http:\/\/blog.pjsen.eu\/?p=39"},"modified":"2013-04-01T19:20:22","modified_gmt":"2013-04-01T17:20:22","slug":"quick-tip-using-newest-entity-framework-assembly-in-asp-net-mvc-4","status":"publish","type":"post","link":"https:\/\/blog.pjsen.eu\/?p=39","title":{"rendered":"Quick-tip: Using newest Entity Framework assembly in ASP.NET MVC 4"},"content":{"rendered":"<p>For me it has been kind of unexpected behavior. When I update NuGet package, I get newest Entity Framework binaries. Today it is version 5.0. However, default MVC template targets .NET version 4.0. Newest version of Entity Framework for .NET 4.0 is 4.4. The NuGet package contains both assemblies, but the project <strong>will use 4.4<\/strong> because the project <strong>targets .NET 4.0 by default<\/strong>. Furthermore, simply changing target runtime version in project properties is not enough. What finally has worked for me was manually editing <code>.csproj<\/code> file. I located assembly reference in XML and changed path in <code>HintPath<\/code> tag from <code>\\lib\\<strong><span style=\"color: #339966;\">net40<\/span><\/strong>\\EntityFramework.dll<\/code> to <code>\\lib\\<strong><span style=\"color: #339966;\">net45<\/span><\/strong>\\EntityFramework.dll<\/code>. The conclusion is to pay close attention to <strong>what particular version<\/strong> of assembly is <strong>actually being referenced<\/strong> and not relying only on NuGet versioning.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For me it has been kind of unexpected behavior. When I update NuGet package, I get newest Entity Framework binaries. Today it is version 5.0. However, default MVC template targets .NET version 4.0. Newest version of Entity Framework for .NET 4.0 is 4.4. The NuGet package contains both assemblies, but the project will use 4.4<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8,7],"tags":[],"class_list":["post-39","post","type-post","status-publish","format-standard","hentry","category-net","category-asp-net","category-quick-tip"],"_links":{"self":[{"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=\/wp\/v2\/posts\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=39"}],"version-history":[{"count":0,"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=\/wp\/v2\/posts\/39\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=39"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pjsen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}