2013-07-30 33 views
0

我在IIS服務器上部署Asp.net應用程序出現此錯誤,但是當我運行此應用程序時,我的服務器很好,並且沒有任何問題。我在該html中有一個html靜態網站站點文件夾我做工具文件夾,在該工具的文件夾我部署我的asp.net應用程序,在IIS 7上部署Asp.net應用程序

Server Error in '/' Application. 
    Runtime Error 

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

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> 

    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL. 


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

    <configuration> 
    <system.web> 
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> 
</system.web> 
</configuration> 

這裏是我的web.config

 <?xml version="1.0"?> 
<!-- 
    For more information on how to configure your ASP.NET application, please visit 
    http://go.microsoft.com/fwlink/?LinkId=169433 
    --> 
<configuration> 
<system.web> 
<authorization> 
<allow roles="administrators" /> 
<deny users="*" /> 
</authorization> 
</system.web> 
    <connectionStrings> 
    <add name="ConnectionStringName" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source='|DataDirectory|\mfaridalam1.accdb'; Persist Security Info=False"/> 
    </connectionStrings> 

    <system.web> 
     <compilation debug="true" targetFramework="4.0"> 
      <assemblies> 
       <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
       <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
       <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> 
     <authentication mode="Forms"> 
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> 
     </authentication> 
     <membership> 
      <providers> 
       <clear/> 
       <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> 
      </providers> 
     </membership> 
     <profile> 
      <providers> 
       <clear/> 
       <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/> 
      </providers> 
     </profile> 
     <roleManager enabled="true"> 
      <providers> 
       <clear/> 
       <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/> 
       <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/> 
      </providers> 
     </roleManager> 
    </system.web> 
     <system.webServer> 
     <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

     <system.web> 
     <httpHandlers> 
     <add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" /> 
     </httpHandlers> 
    </system.web> 
    <system.webServer> 
     <handlers> 
     <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" /> 
     </handlers> 
     </system.webServer> 
    <location path="AjaxFileUploadHandler.axd"> 
     <system.web> 
     <authorization> 
     <allow users="*"/> 
     </authorization> 
     </system.web> 

     </location> 


    </configuration> 

下面是錯誤的SS
enter image description here

+3

你可以嘗試改變自定義錯誤模式爲「關閉」在網絡配置暫時,只是爲了檢查什麼是實際錯誤 – Mac

+1

@Mac'關'你的意思是? –

+0

我沒有在我的網站中設置。配置文件 –

回答

0

你能否請嘗試從iis刪除網站並重新啓動iis?同時清理你的項目並重建它。然後嘗試將它發佈在正確的位置。你正在創建虛擬目錄嗎?

+0

我可以在我的筆記本電腦上構建我的項目,而不是在服務器上,我可以刪除並複製它,但是be4部署我的項目我已經構建它,沒有錯誤 –

0

這是一個相當普遍的錯誤,它並沒有給我們提供錯誤的細節。

可能的檢查,你可以做的是:

1. Check web.config and make Custom Error Mode off 
2. Try to host application locally 
3. Check all files have been deployed on server or not? 
4. View page locally on server 
5. Add stacktrace to find exact issue. 
6. Do logging on request 
0

,如果你有服務器訪問和使用Windows Server,嘗試在瀏覽器中打開網站,如果失敗再看看事件查看器 - 的> Windows日誌窗口看到錯誤。