我已經完成了一個mvc應用程序,我想在測試網站上發佈它。我設法用VS中的發佈命令發佈文件,但是當我訪問到我的應用的鏈接時,什麼都沒有。如何部署mvc應用程序
我用FTP發佈的網站,我檢查如果文件在主機上,他們是,但應用程序無法打開。 index.cshtml沒有顯示。我是否需要做一些額外的配置才能使其工作?
此外,我按照http://msdn.microsoft.com/en-us/library/dd410407(v=vs.90).aspx的步驟。
對web.release.config和web.debug.config有任何改變嗎?
這裏是我的web.config:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=xxxxx Initial Catalog=xxxx; Persist Security Info=True; User ID=xxxxx; Password=xxxxx" providerName="System.Data.SqlClient" />
<add name="CDSEntities" connectionString="metadata=res://*/Models.CDS.csdl|res://*/Models.CDS.ssdl|res://*/Models.CDS.msl;provider=System.Data.SqlClient;provider connection string="data source=xxxx;initial catalog=xxxxx;user id=xxxx;password=xxxxx;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /></connectionStrings>
這裏是我web.release.config:
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your Web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
和我web.debug.config:
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your Web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->