Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2005, 06:48 AM
Authorized User
 
Join Date: Feb 2005
Location: hyderabad, Andhara Pradesh, India.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default Error in Web.config..

hi,

 after uploading my files into the server i got an error like this in web.config.what changes i have to made...?

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".



<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.



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

thanks in advance-ashokparchuri
Reply With Quote
  #2 (permalink)  
Old May 19th, 2005, 09:52 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This is telling you that an error occurred but your web.config is not configured to show you what the error is. You need to follow the instructions outlined in the error message to turn on error message display.

-Peter
Reply With Quote
  #3 (permalink)  
Old May 20th, 2005, 03:52 AM
Authorized User
 
Join Date: Feb 2005
Location: hyderabad, Andhara Pradesh, India.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default

hi...

 First of all thanks for your reply...but in this problem i don't want to display any message so that only i set the custom errors as off.when the custom errors mode is off.,it should forgot about redirecting to some predefined page and i thought it'll diplay some non-user friendly messages...so why is it showing error message...?
-Ashok Parchuri
Reply With Quote
  #4 (permalink)  
Old May 20th, 2005, 08:58 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I guess I'm still not clear on what you want to do. Do you wish to see the error messages in detail so you can fix a problem? Do you wish to supress all error messages?

<customErrors mode="Off"/> will allow you to see details about the error

<customErrors mode="On"/> will send you to the defined page based on the error code. However, this requires you to define the error code to page mapping in the config file.

<customErrors mode="RemoteOnly"/> will perform just like "On" when you connect from a remote machine (not localhost). This is most useful because you don't have to worry about forgetting to change it when you deploy the app but can still see the error details while developing.

-Peter
Reply With Quote
  #5 (permalink)  
Old May 21st, 2005, 12:14 AM
Authorized User
 
Join Date: Feb 2005
Location: hyderabad, Andhara Pradesh, India.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default

hey...
thanks for your reply....

i got another problem.....with web.config....
i just uploaded to web.config with off state i am getting the same message as i posted first..then i uploaded in "remoteonly mode" i am getiindg same error.

   i just modified web.config in all the three modes on,off,remoteonly....for any mode i am getting the same message...

what should i do...?
 -Ashok Parchuri
Reply With Quote
  #6 (permalink)  
Old May 21st, 2005, 01:13 AM
Authorized User
 
Join Date: Feb 2005
Location: hyderabad, Andhara Pradesh, India.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default

Hey,

   I tried a lot and still i am getting same error.please let me know where we have to upload web.config file..is there is any location(like root directory) i have to upload web.config file...?

  please help me...-Ashok Parchuri
Reply With Quote
  #7 (permalink)  
Old May 21st, 2005, 11:14 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You have to load the web.config into the application root. This means it can either be the IIS root (if that is where the application is based) or to the virtual application root. If you upload the file into a directory underneath the application root, .NET will throw an error telling you that you can't put certain config nodes in a config file there. This tells you you are 1 or more directories too deep.

One thing to check on when you upload the file:
When you make changes to web.config the application will reset itself and the next page hit should be considerably slower because it's recompiling itself. If you make changes to the .config file and you don't see this delay, you are probably not putting the file in the right place.

-Peter
Reply With Quote
  #8 (permalink)  
Old July 9th, 2010, 05:46 AM
Registered User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2010
Posts: 9
Thanks: 5
Thanked 0 Times in 0 Posts
Default Getting run time Error, Please some one help me

I have a web.config file ::
<?xml version="1.0"?>

<configuration>
<appSettings>
<add key="xml4" value="v4" />
<add key="EmailFromAddress" value="You@YourProvider.Com" />
<add key="EmailFromName" value="Your Name" />
<add key="MaxImageWidth" value="640" />
<add key="MaxImageHeight" value="480" />
<add key="TempImagesFolder" value="~/Temp" />
<add key="HourOpen" value="8" />
<add key="HourClose" value="18" />
<add key="AdminEmail" value="Admin@MyDomain.com" />
<add key="ClosedMessage" value="We are sorry, but nobody is here to assist you right now. Please try again between 8 AM and 6 PM PST. For online assistance, visit our Help page." />
<add key="HoursToShow" value="1" />
<add key="PageTitle" value="Erls Chat Server" />
<add key="CurrentTheme" value="Cleanblue" />
</appSettings>

<connectionStrings>
<add name="ASPNETDBConnectionString" connectionString="server=(local)\SqlExpress;Attach DbFileName=|DataDirectory|ASPNETDB.MDF;Integrated Security=true;User Instance=true" providerName="System.Data.SqlClient" />
<add name="ConnectionString" connectionString="server=(local)\SqlExpress;Attach DbFileName=|DataDirectory|chatserverDB.mdf;Integra ted Security=true;User Instance=true" providerName="System.Data.SqlClient" />
<add name="ServiceConnectionString1" connectionString="server=(local)\SqlExpress;Attach DbFileName=|DataDirectory|ServiceDB.mdf;Integrated Security=true;User Instance=true" providerName="System.Data.SqlClient" />
<add name="WebShop" connectionString="server=(local)\SqlExpress;Attach DbFileName=|DataDirectory|WebShop.mdf;Integrated Security=true;User Instance=true" providerName="System.Data.SqlClient" />
<add name="BlogConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|Blog.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" />
<add name="AlccDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|AlccDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" />
<add name="SearchDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|SearchDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" />
<add name="BlogConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|Blog.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" />
<add name="ConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
<add name="ServiceConnectionString2" connectionString="server=(local)\SqlExpress;Attach DbFileName=|DataDirectory|ServiceDB.mdf;Integrated Security=true;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>

<system.web>
<customErrors mode="on" defaultRedirect="~/custerrmsg.aspx" />
<authorization>
<allow roles="Administrator" />
</authorization>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" connectionStringName="WebShop" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
<properties>
<add name="FirstName" />
<add name="LastName" />
<add name="ProfileCompleted" type="System.Boolean" />
<group name="Address">
<add name="Street" />
<add name="ZipCode" />
<add name="City" />
<add name="Country" />
</group>
</properties>
</profile>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="WebShop" enablePasswordRetrieval="False" enablePasswordReset="True" requiresQuestionAndAnswer="True" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>
<roleManager defaultProvider="SqlProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
<providers>
<add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="WebShop"/>
</providers>
</roleManager>

<compilation debug="true"/>

<authentication mode="Forms" />

</system.web>

<location path="Management">
<system.web>
<authorization>
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="Shop/CheckOut.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<system.net>
<mailSettings>
<smtp from="">
<network host="smtp.YourProvider.Com" password="" userName="" />
</smtp>
</mailSettings>
</system.net>
</configuration>

This Gives Run Time Error on running website on remote server..
Please any one can help me what i have to do??
Reply With Quote
  #9 (permalink)  
Old July 9th, 2010, 06:04 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

It would help you posted the actual error message. If you don't have one, try looking in the servers' Event VIewer.

Also, try pasting this in a new web site's web.config in Visual Studio and then look at the Errors list for errors and warnings. Do you see anything?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Denno Secqtinstien (October 16th, 2012)
  #10 (permalink)  
Old April 29th, 2011, 02:51 AM
Registered User
 
Join Date: Apr 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Solve these error and reply

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

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:


[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +4846887
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4860189
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +376
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4861315
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection, ConnectionState& originalState) +31
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1297
System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.Perform Select() +142
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
_Default.Page_Load(Object sender, EventArgs e) +71
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error in web.config when using roles hertendreef ASP.NET 2.0 Professional 2 March 8th, 2008 05:47 AM
VB: web.config error Rich57 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 October 12th, 2007 06:27 AM
web.config error koco ASP.NET 2.0 Basics 1 February 16th, 2007 12:04 PM
error at web.config aynajus BOOK: ASP.NET Website Programming Problem-Design-Solution 2 August 16th, 2006 03:24 AM
Web.config error ashokparchuri General .NET 4 June 28th, 2005 04:51 AM



All times are GMT -4. The time now is 09:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.