在“/”中出现“共享服务器错误”应用。运行时错误”无论如何,在我转移到不同的服务器之后

发布于 2024-12-09 07:03:08 字数 5888 浏览 0 评论 0原文

我不是新用户...但我丢失了登录信息。 不知道为什么它说我是新来的。也许是一个新的部分。 无论如何...

我已将我的网站移动到新的 Shered windows 服务器。 我在使用任何 aspx 文件时都会遇到此错误。

Server Error in '/' Application.
Runtime Error

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

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


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

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

请参阅示例:http://picit.co.il/test.aspx

它在旧服务器中运行良好。

这是我的 Web.config 文件。

<?xml version="1.0"?>
<configuration>
<appSettings>
    <add key="SiteAddress" value="http://www.picit.co.il/" />
    <add key="EMAIL_HOST" value="mail.barak.net.il"/>
    <add key="EMAIL_CONTACT_NAME" value="PicIt"/>
    <add key="EMAIL_USER" value="bonsite-barak.net.il"/>
    <add key="EMAIL_PASS" value="013013"/>
    <add key="MASTER_USERNAME" value="picit"/>
    <add key="MASTER_PASSWORD" value="2hH4HeC3"/>

    <add key="FCKeditor:UserFilesPath" value="~/Up/Main/"/>
    <add key="FCKeditor:BasePath" value="~/Controls/FCKeditor/"/>
</appSettings>
<connectionStrings>
    <add name="Con" connectionString="Data Source=127.0.0.1;Initial Catalog=picitDB;user=User;password=Password;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
    <customErrors mode="Off"/>
    <globalization culture="he-IL" uiCulture="he-IL"/>
    <sessionState mode="InProc"/>
    <identity impersonate="true"/>
    <authentication mode="Windows"/>
    <httpRuntime maxRequestLength="22000"
minFreeThreads="16"
executionTimeout="500"
useFullyQualifiedRedirectUrl="false"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="1000" />
    <pages theme="Front">
        <namespaces>
            <add namespace="Website"/>
        </namespaces>
        <controls>
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagPrefix="asp"/>
            <add tagPrefix="Upload" namespace="Brettle.Web.NeatUpload" assembly="Brettle.Web.NeatUpload"/>
            <add tagPrefix="fck" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/>
            <add tagPrefix="swf" tagName="movie" src="~/Controls/swf.ascx"/>
            <add tagPrefix="Btn" tagName="Friend" src="~/Controls/btn_friend.ascx"/>
            <add assembly="Bound" namespace="CustomControls" tagPrefix="asp"/>
            <add assembly="skmValidators" namespace="skmValidators" tagPrefix="Vld"/>

            <add tagPrefix="CC" tagName="Upload" src="~/Controls/upload.ascx"/>
        </controls>
    </pages>
    <compilation debug="true">
        <assemblies>
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </assemblies>
    </compilation>
    <httpModules>
        <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false"     type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,     Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add verb="GET,HEAD" path="ScriptResource.axd"     type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,     Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
            <add verb="GET" path="ScriptResource.axd"     type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
    </httpHandlers>
</system.web>
<system.webServer>
    <modules>
        <add name="UploadHttpModule"     type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"     preCondition="managedHandler"/>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule,     System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,     PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
    </modules>
    <handlers>
        <add name="ScriptResource.axd_GET" path="ScriptResource.axd"     verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler"     preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd"     verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,         Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"     preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="*.asmx_*" path="*.asmx" verb="*"     type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,     Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"     preCondition="integratedMode,runtimeVersionv2.0"/>
    </handlers>
    <validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>

I'm not a new User... but i lost my Login Info.
Don't know why it's says that i'm new here. Maybe a new section.
ANYWAY...

I have moved My Site to a new Shered windows Server.
and i getting this Error with any aspx file.

Server Error in '/' Application.
Runtime Error

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

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


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

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

Please See Example: http://picit.co.il/test.aspx

It was working perfectly in the old server.

This is my Web.config file.

<?xml version="1.0"?>
<configuration>
<appSettings>
    <add key="SiteAddress" value="http://www.picit.co.il/" />
    <add key="EMAIL_HOST" value="mail.barak.net.il"/>
    <add key="EMAIL_CONTACT_NAME" value="PicIt"/>
    <add key="EMAIL_USER" value="bonsite-barak.net.il"/>
    <add key="EMAIL_PASS" value="013013"/>
    <add key="MASTER_USERNAME" value="picit"/>
    <add key="MASTER_PASSWORD" value="2hH4HeC3"/>

    <add key="FCKeditor:UserFilesPath" value="~/Up/Main/"/>
    <add key="FCKeditor:BasePath" value="~/Controls/FCKeditor/"/>
</appSettings>
<connectionStrings>
    <add name="Con" connectionString="Data Source=127.0.0.1;Initial Catalog=picitDB;user=User;password=Password;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
    <customErrors mode="Off"/>
    <globalization culture="he-IL" uiCulture="he-IL"/>
    <sessionState mode="InProc"/>
    <identity impersonate="true"/>
    <authentication mode="Windows"/>
    <httpRuntime maxRequestLength="22000"
minFreeThreads="16"
executionTimeout="500"
useFullyQualifiedRedirectUrl="false"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="1000" />
    <pages theme="Front">
        <namespaces>
            <add namespace="Website"/>
        </namespaces>
        <controls>
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagPrefix="asp"/>
            <add tagPrefix="Upload" namespace="Brettle.Web.NeatUpload" assembly="Brettle.Web.NeatUpload"/>
            <add tagPrefix="fck" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/>
            <add tagPrefix="swf" tagName="movie" src="~/Controls/swf.ascx"/>
            <add tagPrefix="Btn" tagName="Friend" src="~/Controls/btn_friend.ascx"/>
            <add assembly="Bound" namespace="CustomControls" tagPrefix="asp"/>
            <add assembly="skmValidators" namespace="skmValidators" tagPrefix="Vld"/>

            <add tagPrefix="CC" tagName="Upload" src="~/Controls/upload.ascx"/>
        </controls>
    </pages>
    <compilation debug="true">
        <assemblies>
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </assemblies>
    </compilation>
    <httpModules>
        <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false"     type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,     Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add verb="GET,HEAD" path="ScriptResource.axd"     type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,     Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
            <add verb="GET" path="ScriptResource.axd"     type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
    </httpHandlers>
</system.web>
<system.webServer>
    <modules>
        <add name="UploadHttpModule"     type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"     preCondition="managedHandler"/>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule,     System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,     PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
    </modules>
    <handlers>
        <add name="ScriptResource.axd_GET" path="ScriptResource.axd"     verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler"     preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd"     verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,         Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"     preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="*.asmx_*" path="*.asmx" verb="*"     type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,     Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"     preCondition="integratedMode,runtimeVersionv2.0"/>
    </handlers>
    <validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

因为看清所以看轻 2024-12-16 07:03:08

经过大量测试...
我发现有几行阻止了真正的错误..
为什么?我不知道..但这对我有用..

我发现这些行阻止了真正的错误并始终显示 CustomError 。

<connectionStrings>
    <add name="Con" connectionString="Data Source=127.0.0.1;Initial     Catalog=PicIt;user=small_site;password=small_site123;" providerName="System.Data.SqlClient"/>
</connectionStrings>

这个标签也带来了麻烦..

<system.webServer>
    <modules>
        <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
    </modules>
    <handlers>
        <add name="ScriptResource.axd_GET" path="ScriptResource.axd" verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
    </handlers>
    <validation validateIntegratedModeConfiguration="false"/>
</system.webServer>

现在我有不同的错误:)但是!这比只是非相关错误要好!
感谢大家的帮助!

After alot of testing...
i found that there are a few lines that block the real Error..
WHY? I don't know.. But it's work for me..

I found that this lines are blocking the real error and showing the CustomError always.

<connectionStrings>
    <add name="Con" connectionString="Data Source=127.0.0.1;Initial     Catalog=PicIt;user=small_site;password=small_site123;" providerName="System.Data.SqlClient"/>
</connectionStrings>

And this Tag make the trouble too..

<system.webServer>
    <modules>
        <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
    </modules>
    <handlers>
        <add name="ScriptResource.axd_GET" path="ScriptResource.axd" verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
        <add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
    </handlers>
    <validation validateIntegratedModeConfiguration="false"/>
</system.webServer>

now i have differnt errors :) But! It's better then just non reletive error!
Thanks all for your Help!

不知在何时 2024-12-16 07:03:08

将自定义错误模式设置为“关闭”以查看错误。纠正错误后并在部署之前,将其更改为“打开”并指定默认错误页面,如下所示:-

    <customErrors defaultRedirect="ErrorPage.aspx" mode="On">

    </customErrors>

这样您的用户将无法看到实际错误并获得友好的错误页面,您可以在其中礼貌地说“An发生错误!给您带来的不便敬请谅解……”。

如果上述解决方案不起作用(即,即使将自定义错误模式设置为打开后,也会发生相同的“服务器错误”,那么很可能是您的 web.config 文件格式不正确并且包含无效字符等

,解析,它将文件的内容复制粘贴到记事本中,将其另存为 xml 文件并尝试在浏览器中浏览 xml 文件,如果浏览器无法呈现 xml 文件并抛出错误,那么您可以。找到标签格式不正确或无效的地方字符存在并纠正它们,

值得注意的是 Web.config 区分大小写,甚至尾随/前导空格也可能导致上述错误。

Set the custom error mode to "Off" to view the error. After rectifying it and before deployment, change it to "On" and specify a default error page, as follows:-

    <customErrors defaultRedirect="ErrorPage.aspx" mode="On">

    </customErrors>

such that your users will not be able to see the actual error and get your friendly error page where you can politely say "An error has occured! Sorry for the inconvenience ..." .

If the above solution is not working (i.e. even after setting the custom error mode to On, the same "Server Error" occurs, then the likely chance is that your web.config file is not well formed and has invalid characters etc.,

To resolve, it copy paste the contents of the file to a notepad, save it as an xml file and try to browse the xml file in the browser. If the xml file is unable to be rendered by the browser and throws error, then you can find the place where the tags are not well formed or invalid character(s) exist and rectify them.

Things worth noting is Web.config is case sensitive and even trailing / leading spaces can cause the above error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文