2012-08-17 59 views
0

我想在远程服务器上部署我的ASP.NET网站和数据库(SQL Server 2008)。但是,我从WebConfig文件中收到错误。WebConfig文件在部署ASP.NET网站时的问题

WEBCONFIG

在VS 2010中,WebConfig包含:

<configuration> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
     <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=SOMETOKEN"/> 
     </assemblies> 
    </compilation> 
    </system.web> 
</configuration> 

当我运行在Web服务器上的页面,我得到这个错误:

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off". 


<!-- Web.Config Configuration File --> 

<configuration> 
    <system.web> 
     <customErrors mode="Off"/> 
    </system.web> 
</configuration> 

所以,我添加了<customErrors mode="Off"/>并将我的Web.Config修改为:

<compilation debug="false" targetFramework="4.0"> 
    <customErrors mode="Off"/> 
     <assemblies> 
     <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     </assemblies>   
    </compilation> 

但它不会帮助。我仍然收到同样的错误。我错过了什么?我记得部署其他项目没有汇编(* .dlls),并且工作正常。议会搞乱了什么?如果是的话,你能提出建议吗?

我很惊讶,没有解释ASP.NET“网站”部署的单一教程,以及web.config文件应该做什么。当使用组件时(如果有的话)应该特别小心。

我会感谢帮助顺利部署相同的。谢谢。

+0

第一,使调试=真正的,因为你现在调试。但是我相信你在自定义错误模式=关闭后没有得到相同的错误。基本上你的第一个错误说'嗨,发生了一个错误,但我们还没有显示给你。改变CustomErrors =“关”,我们会告诉你。这是您对我们提供的信息和帮助的改变后得到的错误。 – Phil 2012-08-17 15:37:40

回答

1

错误:是的customErrors编译标记内

更改为了:

<customErrors mode="Off"/> 
<compilation debug="false" targetFramework="4.0"> 
    <assemblies> 
    <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
    </assemblies>   
</compilation>