2012-08-17 58 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>