HotTowel EF6 MVC5 Angular Breeze version challenge


Question

Is it Possible to Get HotTowel and EntityFramework 6 working together?

Our DataAccess Layer was upgraded to EF6. The only reference we have to EntityFramework in the Web layer is the Web.Config

 <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

 <entityFramework>
   <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
  <parameters>
      <parameter value="Data Source=.; Integrated Security=True; MultipleActiveResultSets=True" />
      </parameters>
   </defaultConnectionFactory>
</entityFramework>

We are unable to update the ER version 6 because HotTowel There was a Breeze Update available. But how to resolve the HotTowel

Install failed. Rolling back... install-package : Updating 'Microsoft.AspNet.WebApi.OData 5.0.0' to 'Microsoft.AspNet.WebApi.OData 4.0.30506' failed. Unable to find a version of 'Breeze.Server.WebApi2' that is compatible with 'Microsoft.AspNet.WebApi.OData 4.0.30506'.

EDIT: We are using KNOCKOUT.js library version of HotTowel.

Accepted Answer

There was an incompat that the Web APi v2 had when it came out (same week as my course). It is now resolved so just install

Install-Package HotTowel.Angular.Breeze -pre

Popular Answer

The QUICK version of John Papas answer YES i needed the pre version of HOtTowel, actual more the angularJS Pre version. But that didnt resolve all issues. I needed breeze packages for ef6 and also the WEB.CONFIG entries.

Install-Package HotTowel.Angular.Breeze -pre

ALSO I had to use Install-Package Breeze.WebApi2.EF6

See their site for more info WHY Breeze and EF6

A detail Explanation for what helped get it running. About 12 hrs later... Just in case someone has the issue: I would describe it as ef6, MVC5, Razor, Hottowel, AngularJs Breeze Knockout combo The package COMBINATION

<packages>
  <package id="AngularJS.Animate" version="1.2.0-rc3" targetFramework="net45" />
  <package id="AngularJS.Core" version="1.2.0-rc3" targetFramework="net45" />
  <package id="AngularJS.Route" version="1.2.0-rc3" targetFramework="net45" />
  <package id="AngularJS.Sanitize" version="1.2.0-rc3" targetFramework="net45" />
  <package id="Antlr" version="3.5.0.2" targetFramework="net45" />
  <package id="Breeze.Client" version="1.4.5" targetFramework="net45" />
  <package id="Breeze.Server.ContextProvider" version="1.4.5" targetFramework="net45" />
  <package id="Breeze.Server.ContextProvider.EF6" version="1.4.5" targetFramework="net45" />
  <package id="Breeze.Server.WebApi2" version="1.4.5" targetFramework="net45" />
  <package id="Breeze.WebApi2.EF6" version="1.4.5" targetFramework="net45" />
  <package id="Durandal" version="2.0.1" targetFramework="net45" />
  <package id="Durandal.Router" version="1.2.0" targetFramework="net45" />
  <package id="Durandal.Transitions" version="2.0.0" targetFramework="net45" />
  <package id="EntityFramework" version="6.0.1" targetFramework="net45" />
  <package id="FontAwesome" version="4.0.0" targetFramework="net45" />
  <package id="HotTowel.Angular" version="2.0.1-rc3" targetFramework="net45" />
  <package id="HotTowel.Angular.Breeze" version="2.0.1-rc3" targetFramework="net45" />
  <package id="infuser" version="0.2.1" targetFramework="net45" />
  <package id="jQuery" version="2.0.3" targetFramework="net45" />
  <package id="jQuery.Form" version="3.32" targetFramework="net45" />
  <package id="jQuery.UI.Combined" version="1.10.3" targetFramework="net45" />
  <package id="jQuery.Validation" version="1.11.1" targetFramework="net45" />
  <package id="Knockout.js_External_Template_Engine" version="2.0.5" targetFramework="net45" />
  <package id="Knockout.Mapping" version="2.4.0" targetFramework="net45" />
  <package id="Knockout.Validation" version="1.0.1" targetFramework="net45" />
  <package id="knockoutjs" version="2.3.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.OData" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.Tracing" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
  <package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
  <package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
  <package id="Modernizr" version="2.6.2" targetFramework="net45" />
  <package id="Moment.js" version="2.1.0" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net45" />
  <package id="Q" version="0.9.7" targetFramework="net45" />
  <package id="RequireJS" version="2.1.8" targetFramework="net45" />
  <package id="RequireJS.Text" version="2.0.7" targetFramework="net45" />
  <package id="Sammy.js" version="0.7.4" targetFramework="net45" />
  <package id="Spin.js" version="1.3" targetFramework="net45" />
  <package id="System.Spatial" version="5.6.0" targetFramework="net45" />
  <package id="TinyMCE.JQuery" version="4.0.8" targetFramework="net45" />
  <package id="toastr" version="2.0.1" targetFramework="net45" />
  <package id="TrafficCop" version="0.3.1" targetFramework="net45" />
  <package id="Twitter.Bootstrap" version="2.3.2" targetFramework="net45" />
  <package id="Unity" version="3.0.1304.0" targetFramework="net45" />
  <package id="WebActivator" version="1.5.3" targetFramework="net45" />
  <package id="WebActivatorEx" version="2.0.2" targetFramework="net45" />
  <package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>

AND SOME VERY IMPORT WEB.CONFIG entries Under Views/

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Optimization"/>
    <add namespace="System.Web.Routing" />
  </namespaces>
    </pages>
  </system.web.webPages.razor>

  <appSettings>
  <add key="webpages:Enabled" value="false" />
  </appSettings>

 <system.web>
  <httpHandlers>
    <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
  </httpHandlers>
  <pages
    validateRequest="false"
    pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
   <controls>
    <add assembly="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
   </controls>
 </pages>
</system.web>

 <system.webServer>
  <validation validateIntegratedModeConfiguration="false" />

 <handlers>
  <remove name="BlockViewHandler"/>
  <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
 </handlers>
 </system.webServer>
 </configuration>

Then in ROOT Web.Config, check these entries are OK regarding versions

<add key="webpages:Version" value="3.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />

no change should be required Namespaces, but just in case.

 <httpRuntime targetFramework="4.5" />
   <pages>
    <namespaces>
    <add namespace="System.Web.Helpers" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Optimization" />
    <add namespace="System.Web.Routing" />
    <add namespace="System.Web.WebPages" />
   </namespaces>
  </pages>

and some dependent assembly tweaks to versions

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
  </dependentAssembly>
</assemblyBinding>




Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why