我已经完成了一个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>
-->