【发布时间】:2014-01-20 08:40:53
【问题描述】:
我正在与我的 ASP.NET 托管公司合作。我使用 Visual Studio 2012 .NET Framework 4.5 创建了一个简单的 Web 应用程序
起初我尝试使用 web deploy 来发布我的网站,即使使用他们的文档也无法完成。然后他们让我使用 FTP 选项发布。效果很好,我可以发布到我的域的根目录。但是当我尝试发布到不同的文件夹 domain.com/apps/root/thisapp 时,Visual Studio 会发布而没有错误,但是当我导航到 URL 时,我收到了 500 服务器错误。
现在我被要求只使用 FTP 程序并将我的所有文件复制到我想要该站点所在的目录,所以我这样做了,现在我的 web.config 文件上出现“配置错误”:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 21: </namespaces>
Line 22: <controls><add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /></controls></pages>
Line 23: <authentication mode="Forms">
Line 24: <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
Line 25: </authentication>
我没有在本地收到此错误,也没有在我的域根目录发布该站点时收到此错误。我的想法不多了,看来我的主人也是。有谁知道您如何将网站发布到 ASP.NET 服务器上的任何目录?
还有人可以帮助我缩小导致此错误的原因吗?托管支持,说它是代码或我的项目。但是我不这么认为,因为它在本地和域的根目录下都可以正常工作。我认为 IIS 或我的文件夹的权限存在问题。
【问题讨论】:
-
那条线上的错误是什么?
-
@MikeChristensen 抱歉,这是一个配置错误。
-
它只是说“配置错误”,没有别的?确实需要有人为 那个错误消息向 .NET 团队大喊大叫。
-
@MikeChristensen 是的,还有更多内容可以让我编辑我的帖子,对此感到抱歉。
标签: asp.net .net visual-studio-2012 ftp hosting