2013-02-13 49 views
0
<configuration> 

<system.net> 

<mailsettings> 

<smtp deliverymethod="Network" from="[email protected]"> 

<network defaultcredentials="true" host="smtp.gmail.com" password="[email protected]" port="587" username="[email protected]"> 

</network></smtp> 

</mailsettings> 

</system.net> 

<appsettings> 

<add key="con" value="Data Source=moviemaster.db.10502677.hostedresource.com; Initial Catalog=picketmaster; User ID=picketmaster; [email protected];"> 

</add></appsettings> 

<connectionstrings> 

<system.webserver> 

<httperrors errormode="Detailed"> 

<asp scripterrorsenttobrowser="true"> 

</asp></httperrors></system.webserver> 

<system.web> 

<compilation debug="true" targetframework="4.0"> 

<assemblies> 

<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 

<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"> 

<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"> 

</add></add></add></assemblies> 

</compilation> 

<authentication mode="Windows"> 

<customerrors mode="Off"> 

<compilation debug="true"> 

</compilation></customerrors> 

<pages clientidmode="AutoID" controlrenderingcompatibilityversion="4.0"> 

</pages></authentication></system.web> 

<system.web> 

<sessionstate mode="InProc" timeout="15"> 

</sessionstate></system.web> 

</connectionstrings></configuration> 

當我試圖從我的本地系統連接數據庫與此字符串錯誤位於連接字符串。上傳我的網絡文件到服務器後得到web.config文件錯誤和500錯誤godaddy

我試圖改變自定義錯誤內容並添加詳細錯誤仍然錯誤仍然存​​在。而且我是asp.net的初學者我開發了一個網站,並且爲了測試目的而上傳了,我希望看到錯誤細節清楚地說明需要做哪些網頁修改。

發佈網站,我看不到文件夾中的應用程序代碼會是什麼原因之後是錯誤

原因

請檢查此鏈接提前http://www.ticket65.com/test

感謝

+0

你關閉了自定義錯誤,你能檢查你的iis設置 - > .NET錯誤頁面嗎? – 2013-02-13 07:03:32

+0

iam使用godaddy共享主機我該如何檢查,謝謝你的回覆 – Tajkumar 2013-02-13 07:05:57

回答

0
<?xml version="1.0"?> 
<!-- 
Note: As an alternative to hand editing this file you can use the 
web admin tool to configure settings for your application. Use 
the Website->Asp.Net Configuration option in Visual Studio. 
A full list of settings and comments can be found in 
machine.config.comments usually located in 
\Windows\Microsoft.Net\Framework\vx.x\Config 
--> 
<configuration> 
    <system.net> 
     <mailSettings> 
      <smtp deliveryMethod="Network" from="[email protected]"> 
       <network host="XXXXXXXXX" port="25" userName="[email protected] password="XXXXXX" defaultCredentials="true"/> 
     </smtp> 

     </mailSettings> 
    </system.net> 
    <appSettings> 
    <add key="con" value="Data Source=XXXXXXX; Initial Catalog=XXXXXXX; User ID=XXXXXXXX; Password=XXXXXXX;"/> 

    <!--<add key="SentMail" value="smtp.gmail.com"/>--> 
</appSettings> 
<connectionStrings/> 
<system.web> 
    <!-- 
     Set compilation debug="true" to insert debugging 
     symbols into the compiled page. Because this 
     affects performance, set this value to true only 
     during development. 
    --> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
      <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     </assemblies> 
    </compilation> 
    <!-- 
     The <authentication> section enables configuration 
     of the security authentication mode used by 
     ASP.NET to identify an incoming user. 
    --> 
    <authentication mode="Windows"/> 
    <!-- 
     The <customErrors> section enables configuration 
     of what to do if/when an unhandled error occurs 
     during the execution of a request. Specifically, 
     it enables developers to configure html error pages 
     to be displayed in place of a error stack trace. 

- >

 <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/> 
    </system.web> 
    <system.webServer> 
     <httpErrors errorMode="Detailed" /> 
     <asp scriptErrorSentToBrowser="true"/> 
    </system.webServer> 
    <!-- 
     The system.webServer section is required for running ASP.NET AJAX under Internet 
     Information Services 7.0. It is not necessary for previous version of IIS. 
    --> 
    <system.web> 
     <customErrors mode="Off"/> 
     <sessionState mode="InProc" timeout="15"/> 
    </system.web> 
    </configuration> 
在你的web.config
+0

請將解釋添加到您的代碼,只有代碼是不夠的。 – eatSleepCode 2014-01-22 05:31:44

0

您在配置文件的appsettings部分中有連接字符串,它應該位於connectionstrings部分內。

除此之外,你的web.config文件還有一些其他問題,包括錯誤位置的鍵,不匹配的結束元素,格式不正確的XML等。使用web.config文件時要記住的兩件重要事情是文件必須格式良好,有效的xml和元素和屬性名稱是區分大小寫的。換句話說<mailSettings>是一個有效的元素名稱,但<mailsettings>不是。

我建議你參考system.web Element (ASP.NET Settings Schema)How to: Read Connection Strings from the Web.config Filesystem.webServer Section Group [IIS Settings Schema]

我已經糾正了所有我能找到我下面的示例中的錯誤。它使某些假設(比如你是在IIS7和使用的應用程序池運行的.NET 4.0框架。)

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.net> 
     <mailSettings> 
      <smtp deliveryMethod="Network" from="[email protected]"> 
       <network defaultCredentials="true" host="smtp.gmail.com" password="[email protected]" port="587" userName="[email protected]" /> 
      </smtp> 
     </mailSettings> 
    </system.net> 

    <connectionStrings> 
     <add name="con" connectionString="Data Source=moviemaster.db.10502677.hostedresource.com; Initial Catalog=picketmaster; User ID=picketmaster; [email protected];" /> 
    </connectionStrings> 

    <system.webServer> 
     <httpErrors errorMode="Detailed" /> 
     <asp scriptErrorSentToBrowser="true" /> 
    </system.webServer> 

    <system.web> 
     <compilation debug="true"> 
      <assemblies> 
       <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
       <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
       <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
      </assemblies> 
     </compilation> 
     <authentication mode="Windows" /> 
     <customErrors mode="Off" /> 
     <pages clientIDMode="AutoID" controlRenderingCompatibilityVersion="4.0"/> 
     <sessionState mode="InProc" timeout="15" /> 
    </system.web> 
</configuration> 
+0

仍然會得到相同的錯誤。 – Tajkumar 2013-02-13 08:28:01

+0

我在回答中修復了元素中的一個小錯誤。如果沒有額外的調整,這仍然可能無法正常工作,具體取決於您的網絡服務器與godaddy.com和您的網站的確切設置。基於你的問題,它幾乎聽起來像是在機器級別打開自定義錯誤,但你應該能夠在本地機器上調試任何額外的web.config問題。要仔細檢查的一件事是確保您在使用.net 4.0的應用程序池中運行,因爲程序集和頁面值都特別引用該.net版本。 – 2013-02-13 14:55:27

+0

我與godaddy檢查使用asp.net 4.0和godaddy相同請你可以幫助更多關於這個錯誤我抓我的頭解決這個錯誤。在此先感謝 – Tajkumar 2013-02-13 16:35:12

相關問題