when you deploye asp.net MVC 2.0 to old version IIS (5.0,6.0) WebSite , you may meet some troubles.
1.IIS don't run on .Net Framework 3.5!!
After you FTP / deploye your file to Website, You should copy the all .Net Framework 3.5 DLL file into the "bin" folder in your website.
the .Net Framework 3.5 DLL files are in this path
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5
2. Website didn't install asp.net MVC 2.o
You can copy the "System.Web.Mvc.dll" to the "bin" folder
System.Web.Mvc.dll in
C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll
3. Can't not find the VB/VC Complier ,because the Complier version is too old.
Because there is a setting in web.config
you can remark all setting or change the "CompilerVersion" to "v2.0"
4.Routing can't work
You can look those method in http://www.asp.net/learn/mvc/tutorial-08-vb.aspx
One method is to modify the Global.asax.vb
add ".aspx" after "{controller}"
otherwise, you can use any other Url Rewrite third DLL
5.Get Error 'ActionLink' is not member of 'System.Web.Mvc.HtmlHelper(Of Object)' in view
modify the view / sitemaster file.
not only for ActionLink, it can use in for All System.Web.Mvc.Html
1.IIS don't run on .Net Framework 3.5!!
After you FTP / deploye your file to Website, You should copy the all .Net Framework 3.5 DLL file into the "bin" folder in your website.
the .Net Framework 3.5 DLL files are in this path
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5
2. Website didn't install asp.net MVC 2.o
You can copy the "System.Web.Mvc.dll" to the "bin" folder
System.Web.Mvc.dll in
C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll
3. Can't not find the VB/VC Complier ,because the Complier version is too old.
Because there is a setting in web.config
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
you can remark all setting or change the "CompilerVersion" to "v2.0"
<provideroption name="CompilerVersion" value="v2.0"> </provideroption>
4.Routing can't work
You can look those method in http://www.asp.net/learn/mvc/tutorial-08-vb.aspx
One method is to modify the Global.asax.vb
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
' MapRoute takes the following parameters, in order:
' (1) Route name
' (2) URL with parameters
' (3) Parameter defaults
routes.MapRoute( _
"Default", _
"{controller}/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = ""} _
)
End Sub
add ".aspx" after "{controller}"
routes.MapRoute( _
"Default", _
"{controller}.aspx/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = ""} _
)
otherwise, you can use any other Url Rewrite third DLL
5.Get Error 'ActionLink' is not member of 'System.Web.Mvc.HtmlHelper(Of Object)' in view
modify the view / sitemaster file.
Change
<%=HTML.ActionLink("Home","Index","Home") %>
to
<%=System.Web.Mvc.Html.LinkExtensions.ActionLink(Html, "Home", "Index", "Home")%>
not only for ActionLink, it can use in for All System.Web.Mvc.Html
留言