ä¸è½½äº http //aspnetwebstack codeplex com/SourceControl/list/changesets è¿ä¸é¢
.NET 4.0 RTMçæºç ,
è£
äºä¸ä¸ªgit,ç¶åä¸è½½å°±å¯ä»¥äº
git clone https //git01 codeplex com/aspnetwebstack.git
æ¶é´ç¨å¾®é¿äºç¹å¿,å个å°æ¶å§;
ç¶åéé¢srcå
¨æ¯MVC4çæºç (å
¶å®å¾å¤§ä¸é¨åé½å¨éé¢äº)
解å³åææ¯runtime.slnç,æå¼ä¹å,å¨éé¢æ°å»ºä¸ä¸ªMVC4ç项ç®,
è¿éæ个é®é¢,æä¸è½½çMVC4,å¨
system.web.mvc项ç®éProperties\CommonAssembley.csé,å
¨æ¯5.0.0.0ççæ¬å·,
ææä»æ¹æäº5.0.0.1
#if
ASPNETMVC [assembly: AssemblyVersion("5.0.0.1")] [assembly:
AssemblyFileVersion("5.0.0.1")] [assembly: AssemblyProduct("Microsoft ASP.NET
MVC")] #elif ASPNETWEBPAGES
ç¶åä¿®æ¹æ ¹ç®å½ä¸ç web.config
<appSettings>
<add
key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
è¿éä¹æ以æ¹æ3.0.0.0çåå ,æ¯å 为å¨æä¸è½½çæºç é,ä»ççæ¬å·å°±æ¯3.0,
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<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-4.0.0.0" newVersion="5.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0"
newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework"
publicKeyToken="b77a5c561934e089" />
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0"
newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0"
newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime> è¿éçæ¹æäºæèªå·±ççæ¬å·
ç¶åä¿®æ¹viewä¸é¢çweb.config
<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>
è¿éä¿®æ¹æäº3.0,å½ç¶å
·ä½æ¯ä»ä¹,çä½ èªå·±ä¸è½½ç,ä½æ¯æè§å¾å¤§é¨ååºè¯¥è·æçæ¯ä¸æ ·ç(ç¯å¢VS2012,æºç 4.0 RTM)
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory,
System.Web.Mvc, Version=5.0.0.1,
Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter,
System.Web.Mvc, Version=5.0.0.1,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc,
Version=5.0.0.1, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc,
Version=5.0.0.1,
Culture=neutral,
PublicKeyToken=31BF3856AD364E35">
åæ ·,ä¿®æ¹ä¹(å
·ä½æ¯ä¸æ¯ä¸ä¿®æ¹ä¹æ,æå°±ä¸ç¥éäº,ææ¯æç
§ç½ä¸çæ¹æ³æ¹ç,æåçå°æ¹,ä¼ç»åºè¿æ¥å¤§å®¶æ³¨æå¦ä¹ å§)
è¿æ ·,é
ç½®æ件åMVC代ç ä¸ççæ¬å·,就修æ¹å®äº,
ç¶åæå¼VS2012çå½ä»¤è¡,æ§è¡
Run
"sn.exe -Vr *,31BF3856AD364E35" in the Visual Command line (åå,ä½ ç,æççæ¯COPYç,ååçä¸è¥¿å ä¹æ²¡æ)
ç¶åæ项ç®ä¸çsystem.web.mvcçå¼ç¨,æ¹å°ä½ çMVC4çæºç éç项ç®,å½ç¶,ä¸æ¢è¿ä¸ä¸ª,ä¸ç¶ä¼æå¾å¤å°æ¹æ¥éç,大è´çDLLæ :
system.web.razot; system.web.webpages;system.web.webpages.deployment;
system.web.webpages.razor; è¿éä¸å
¨æ²¡å
³ç³»,ç½é¡µä¸ä¼æç¡®æ示å°åªä¸ªç.
å¦æåºç°äºä¸ä¸ªç±»å转æ¢çé误:
ç¨æ·ä»£ç æªå¤ç
System.InvalidCastException
HResult=-2147467262
Message=[A]System.Web.WebPages.Razor.Configuration.HostSection æ æ³å¼ºå¶è½¬æ¢ä¸º
[B]System.Web.WebPages.Razor.Configuration.HostSectionãç±»å A
æºèªâSystem.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35â(å¨ä¸ä¸æâDefaultâä¸çâC:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dllâä½ç½®å¤)ãç±»å
B æºèªâSystem.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35â(å¨ä¸ä¸æâDefaultâä¸çâC:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET
Files\root\49f25bf0\9ce908d5\assembly\dl3\70f2ab4b\b0630cdc_834fce01\System.Web.WebPages.Razor.dllâä½ç½®å¤)ã
Source=System.Web.WebPages.Razor
è¿ä¸ªé误,å°±æ¯æ为ä»ä¹è¦è¯¥system.web.webpagesççæ¬å¥½çåå äº; å¦æåºç°å
¶ä»DLL,大家ä¹å¯ä»¥éçæ¹ä¸ä¸;
ä¹å,å°±å¯ä»¥å¨é¡µé¢ä¸é便å 空é´,å°±è½çå°æç¹çæ§è¡äº,好è¿;
温馨提示:内容为网友见解,仅供参考