Thursday 4 January 2018

c# - VS2013 create a new MVC project runs fine, update all packages via NuGet get error

Created a new MVC API project with VS2013, Target
Framework 4.5.1. Compiles and runs fine. Went to NuGet and updated all the packages and
now get the following runtime error.





[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be
cast
to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type
A
originates from 'System.Web.WebPages.Razor, Version=2.0.0.0,

Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context


'Default' at location

'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.

Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0,

Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context
'Default' at
location .....




I'm
thinking I have to modify this in the
web.config



            name="system.web.webPages.razor" 


type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,

System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=31BF3856AD364E35">
type="System.Web.WebPages.Razor.Configuration.HostSection,

System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection,

System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=31BF3856AD364E35" requirePermission="false"
/>


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...