简体   繁体   English

在IIS 7上部署Asp.net应用程序

[英]Deploy Asp.net Application on IIS 7

I am deploying Asp.net Application at IIS server getting this error, But when i run this application my server its fine and give no problem .I have one html static web site in that html site folder i made tool folder, In that tool folder i deploy my asp.net application , 我在IIS服务器上部署Asp.net应用程序时遇到此错误,但是当我运行该应用程序时,我的服务器运行正常,没有任何问题。在该html站点文件夹中有一个html静态网站,我在其中创建了工具文件夹,我部署了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>

Here is my Web.config 这是我的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>

Here is SS of error 这是错误的SS
在此处输入图片说明

Can you please try deleting the website from iis and restarting iis? 您可以尝试从iis中删除网站并重新启动iis吗? at the same time clean your project and rebuild it. 同时清理您的项目并重建它。 then try publishing it in the right location. 然后尝试将其发布在正确的位置。 Are you creating virtual directory? 您要创建虚拟目录吗?

This is quite a general error which does not give us details of what went wrong. 这是一个非常普遍的错误,不会向我们提供错误原因的详细信息。

Possible checks you can do is: 您可以做的检查是:

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

如果您可以访问服务器并使用Windows服务器,请尝试在浏览器中打开网站,如果网站失败,则查看Windows的事件查看器-> Windows日志以查看错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM