PDA

View Full Version : سوال: ارور customErrors



takgig
جمعه 02 اردیبهشت 1390, 08:38 صبح
سلام بر اساتید گرامی
من دیروز برنامه رو Publish کردم و داخل سایت قرار دادم با ارور زیر مواجه شدم :


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 مقدار CustomError رو از طریق دستور زیر غیر فعال کنم.


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

اینکارو هم انجام دادم ولی با کمال تعجب دوباره همین پیغام رو میده .ضمناً من فایلهامو توی یک دایرکتوری در هاست آپلود کردم و در شاخه اصلی یک برنامه دیگه موجوده .
برنامه هم روی Local Host کامپیوترم جواب می ده .
از این کد هم در web.Config برای اتصال دیتابیس استفاده کردم :


<add name="ApplicationServices" connectionString="Data Source=.;Initial Catalog=Form;Persist Security Info=True;User ID=,form;Password=abc123456" providerName="System.Data.SqlClient"/>

لطفاً راهنمایی نمایید .
با تشکر

b.paseban
شنبه 03 اردیبهشت 1390, 11:07 صبح
سلام بر شما.
شما باید این کد رو در web.config قرار بدین:


<customErrors mode="RemoteOnly" defaultRedirect="Error.aspx">
<error statusCode="403" redirect="Error.aspx" />
<error statusCode="404" redirect="~/ErrorPages/404notfound.htm" />
<error statusCode="500" redirect="Error.aspx" />
</customErrors>

مثلا اگر صفحه ای وجود نداشته باشه میره به آدرس مشخص شده در redirect ارور 404.
امکان داره که برقراری اتصال با دیتا بیس مشکل داشته باشه.
از اونجایی که مانمیتونیم مثل حالت لوکال برنامه رو trace کنیم مشکل معلوم نیست از کجاست(البته توی این ارور)

takgig
شنبه 03 اردیبهشت 1390, 13:28 عصر
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[HttpException (0x80004005): The file '/test/default.aspx' has not been pre-compiled, and cannot be requested.] System.Web.Compilation.BuildManager.GetVPathBuildR esultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +8763230 System.Web.Compilation.BuildManager.GetVPathBuildR esultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101 System.Web.Compilation.BuildManager.GetVirtualPath ObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126 System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62 System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33 System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40 System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160 System.Web.MapHandlerExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +93 System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +155

الان این ارور رو میده.

b.paseban
شنبه 03 اردیبهشت 1390, 13:39 عصر
من با این ارور آشنا نیستم.
شما فایل ها رو توی شاخه اصلی آپلود کن ببین درست میشه یا نه.