<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The Problem Solver : RavenDB, NuGet</title><link>http://msmvps.com/blogs/theproblemsolver/archive/tags/RavenDB/NuGet/default.aspx</link><description>Tags: RavenDB, NuGet</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Using RavenDB with ASP.NET MVC 4</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2012/11/26/using-ravendb-with-asp-net-mvc-4.aspx</link><pubDate>Mon, 26 Nov 2012 18:03:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1819888</guid><dc:creator>Maurice</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/theproblemsolver/rsscomments.aspx?PostID=1819888</wfw:commentRss><comments>http://msmvps.com/blogs/theproblemsolver/archive/2012/11/26/using-ravendb-with-asp-net-mvc-4.aspx#comments</comments><description>&lt;p&gt;Some people might have wondered why I used ASP.NET MVC 3 in my &lt;a href="http://msmvps.com/blogs/theproblemsolver/archive/2012/11/25/getting-started-with-ravendb-in-an-asp-net-mvc-application.aspx"&gt;previous blog post&lt;/a&gt;. The reason is that the RavenDB.Client package uses &lt;a href="http://james.newtonking.com/pages/json-net.aspx"&gt;Newtonsoft.Json&lt;/a&gt; and ASP.NET MVC 4 also has a dependency on Newtonsoft.Json. In itself this isn’t a problem except that RavenDB requires Newtonsoft.Json version 4.0.8 and ASP.NET MVC 4 ships with a much newer version of Newtonsoft.Json, to be exact version 4.5.6. &lt;/p&gt;  &lt;p&gt;The result is that trying to Install-Package RavenDB.Client produces the following error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Install-Package : Updating &amp;#39;Newtonsoft.Json 4.5.6&amp;#39; to &amp;#39;Newtonsoft.Json 4.0.8&amp;#39; failed. Unable to find a version of &amp;#39;Microsoft.AspNet.     &lt;br /&gt;WebApi.Client&amp;#39; that is compatible with &amp;#39;Newtonsoft.Json 4.0.8&amp;#39;.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Does that mean you can’t use RavenDB with ASP.NET MCV 4?&lt;/h3&gt;  &lt;p&gt;No fortunately you can still go ahead and user RavenDB.Client. Instead of the default package you need to installl a specific version which is build with the same version of Newtonsoft.Json as ASP.NET MVC4.&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div id="codeSnippet" style="border-top-style:none;overflow:visible;font-size:8pt;border-left-style:none;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-bottom-style:none;color:black;padding-bottom:0px;direction:ltr;text-align:left;padding-top:0px;border-right-style:none;padding-left:0px;line-height:12pt;padding-right:0px;width:100%;background-color:#f4f4f4;"&gt;     &lt;pre style="border-top-style:none;overflow:visible;font-size:8pt;border-left-style:none;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-bottom-style:none;color:black;padding-bottom:0px;direction:ltr;text-align:left;padding-top:0px;border-right-style:none;padding-left:0px;margin:0em;line-height:12pt;padding-right:0px;width:100%;background-color:white;"&gt;&lt;span id="lnum1" style="color:#606060;"&gt;   1:&lt;/span&gt; Install-Package RavenDB.Client -Version 1.0.971&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;After including this package, and copying the code from the &lt;a href="http://msmvps.com/blogs/theproblemsolver/archive/2012/11/25/getting-started-with-ravendb-in-an-asp-net-mvc-application.aspx"&gt;previous post&lt;/a&gt;. We can run the ASP.NET MCV 4 application and we get to see the same books as before except now with the new stying.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/theproblemsolver.metablogapi/7220.image_5F00_5DF254A7.png"&gt;&lt;img title="image" style="border-top:0px;border-right:0px;border-bottom:0px;border-left:0px;display:inline;" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/theproblemsolver.metablogapi/5125.image_5F00_thumb_5F00_04FCEE1D.png" width="685" height="614" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;However one thing to keep in mind is that RavenDB.Client is the only RavenDB NuGet package build against this version of Newtonsoft.Json. There is no updated version of RavenDB.Server or any of the other packages and that includes &lt;a href="http://nuget.org/packages/RavenDB.Embedded/1.0.960"&gt;RavenDB.Embedded&lt;/a&gt; which can be very useful if you want to embed RavenDB server and client into one application. See &lt;a href="http://ayende.com/blog/157505/ravendb-1-0-amp-newtonsoft-json-4-5-7"&gt;this blog post&lt;/a&gt; by Ayende Rahien for more details on this NuGet package.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1819888" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/theproblemsolver/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/theproblemsolver/archive/tags/NuGet/default.aspx">NuGet</category><category domain="http://msmvps.com/blogs/theproblemsolver/archive/tags/HTML5/default.aspx">HTML5</category><category domain="http://msmvps.com/blogs/theproblemsolver/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://msmvps.com/blogs/theproblemsolver/archive/tags/RavenDB/default.aspx">RavenDB</category></item></channel></rss>