[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

Website Error - "Server Error in '/' Application"

Ive published my website and getting the error below when I try to open default page.
I have visual studio 2005. ASP.NEt 2.0. VC#
I did Build->Publish Website to the webserver. I tested whole site locally on my own machine and it worked perfectly
Your kind advice would be appreciated.

Thanks,
HD
--------------------------------------------------------------
Server Error in '/web' 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>
 
0
Takeoutdinner
Asked:
Takeoutdinner
  • 8
  • 6
1 Solution
 
McExpCommented:
I'm only guessing here, but maybe your error is in the web.config file and hence it is failing before you can set the errors on?
0
 
TakeoutdinnerAuthor Commented:
Hi Master,

Then what step should I start from?

Thanks,
HD
0
 
McExpCommented:
you could try posting your web config here?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
TakeoutdinnerAuthor Commented:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <configSections>
            <section name="thePrayerHouse" type="MB.ThePrayerHouse.ThePrayerHouseSection, __code"/>
      </configSections>

   <thePrayerHouse defaultConnectionStringName="LocalSqlServer">
      <contactForm mailTo="thePrayerHouse@infokare.com"/>
      <articles pageSize="10" />
      <polls archiveIsPublic="true" votingLockByIP="false" />
      <newsletters fromEmail="thePrayerHouse@infokare.com" fromDisplayName="ThePrayerHouse" />
      <forums threadsPageSize="8" hotThreadPosts="10"  bronzePosterPosts="10" silverPosterPosts="20" goldPosterPosts="50" />
      <store sandboxMode="true" businessEmail="thePrayerHouse@infokare.com" />
   </thePrayerHouse>
      
   <connectionStrings>
      <remove name="LocalSqlServer"/>
      <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" providerName="System.Data.SqlClient"/>
      <!--
      <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" providerName="System.Data.SqlClient"/>
      <add name="LocalSqlServer" connectionString="Data Source=.\SQL05;Initial Catalog=ThePrayerHouse_Remote;User ID=sa;Password=ok" providerName="System.Data.SqlClient"/>
      -->
   </connectionStrings>
      
   <system.web>
            <authentication mode="Forms">
                  <forms cookieless="AutoDetect" loginUrl="~/AccessDenied.aspx" name="TBHFORMAUTH"/>
            </authentication>
     
      <pages theme="TemplateMonster" masterPageFile="~/Template.master" maintainScrollPositionOnPostBack="true"></pages>

      <!--
      Possible modes are "transitional", "strict", and "legacy".
      <xhtmlConformance mode="transitional" />
      -->      

      <compilation debug="true">
            <assemblies>
                  <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
         </assemblies>
      </compilation>
     
            <membership defaultProvider="TBH_MembershipProvider" userIsOnlineTimeWindow="15">
                  <providers>
                        <add name="TBH_MembershipProvider" connectionStringName="LocalSqlServer" applicationName="/" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Encrypted" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                        <!--
            <add name="TBH_MembershipProviderEx"
                              connectionStringName="LocalSqlServer"
                              applicationName="/"
                              enablePasswordRetrieval="true"
                              enablePasswordReset="true"
                              requiresQuestionAndAnswer="true"
                              requiresUniqueEmail="true"
                              passwordFormat="Encrypted"
                              maxInvalidPasswordAttempts="5"
                              passwordAttemptWindow="10"
                              minRequiredPasswordLength="5"
                              minRequiredNonalphanumericCharacters="0"
                              type="MB.ThePrayerHouse.DAL.SqlClient.SqlMembershipProviderEx, __code"
            />
            -->
                  </providers>
            </membership>
            
      <siteMap defaultProvider="TBH_SiteMapProvider" enabled="true">
                  <providers>
                        <add name="TBH_SiteMapProvider" type="System.Web.XmlSiteMapProvider" securityTrimmingEnabled="true" siteMapFile="web.sitemap"/>
                  </providers>
            </siteMap>
            
      <sessionState cookieless="AutoDetect"/>
            
      <roleManager enabled="true" cacheRolesInCookie="true" cookieName="TBHROLES" defaultProvider="TBH_RoleProvider">
                  <providers>
                        <add connectionStringName="LocalSqlServer" applicationName="/" name="TBH_RoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                  </providers>
            </roleManager>
            
      <anonymousIdentification cookieless="AutoDetect" enabled="true"/>
            
      <profile defaultProvider="TBH_ProfileProvider">
                  <providers>
                        <add name="TBH_ProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                  </providers>
                  <properties>
            <add name="FirstName" type="String" />
            <add name="LastName" type="String" />
            <add name="Gender" type="String" />
            <add name="BirthDate" type="DateTime" />
            <add name="Occupation" type="String" />
            <add name="Website" type="String" />
            <add name="ShoppingCart" type="MB.ThePrayerHouse.BLL.Store.ShoppingCart" serializeAs="Binary" allowAnonymous="true" />
            <group name="Forum">
               <add name="Posts" type="Int32" />
               <add name="AvatarUrl" type="String" />
               <add name="Signature" type="String" />
            </group>
            <group name="Address">
               <add name="Street" type="String" />
               <add name="PostalCode" type="String" />
               <add name="City" type="String" />
               <add name="State" type="String" />
               <add name="Country" type="String" />
            </group>
            <group name="Contacts">
               <add name="Phone" type="String" />
               <add name="Fax" type="String" />
            </group>
            <group name="Preferences">
               <add name="Theme" type="String" allowAnonymous="true" />
               <add name="Culture" type="String" defaultValue="en-US" />
               <add name="Newsletter" type="MB.ThePrayerHouse.BLL.Newsletters.SubscriptionType" />
            </group>
                  </properties>
            </profile>

      <webParts enableExport="true">
         <personalization defaultProvider="TBH_PersonalizationProvider">
            <providers>
               <add name="TBH_PersonalizationProvider" connectionStringName="LocalSqlServer" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </providers>

            <authorization>
               <allow roles="Administrators,Editors" verbs="enterSharedScope" />
            </authorization>
         </personalization>
      </webParts>
            
      <machineKey validationKey="287C5D125D6B7E7223E1F719E3D58D17BB967703017E1BBE28618FAC6C4501E910C7E59800B5D4C2EDD5B0ED98874A3E952D60BAF260D9D374A74C76CB741803" decryptionKey="5C1D8BD9DF3E1B4E1D01132F234266616E0D5EF772FE80AB" validation="SHA1"/>

      <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx">
         <error statusCode="404" redirect="~/Error.aspx?code=404" />
         <error statusCode="408" redirect="~/Error.aspx?code=408" />
         <error statusCode="505" redirect="~/Error.aspx?code=505" />
      </customErrors>

      <urlMappings>
         <add url="~/articles/prayer.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=28" />
         <add url="~/articles/events.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=41" />
         <add url="~/articles/news.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=31" />
         <add url="~/articles/photos.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=40" />
         <add url="~/articles/blog.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=29" />
         <add url="~/articles/faq.aspx" mappedUrl="~/BrowseArticles.aspx?CatID=42" />
      </urlMappings>

      <healthMonitoring heartbeatInterval="10800" >
         <providers>
            <remove name="SqlWebEventProvider" />
            <add name="SqlWebEventProvider" connectionStringName="LocalSqlServer"
               buffer="false" bufferMode="Notification" maxEventDetailsLength="1073741823"
               type="System.Web.Management.SqlWebEventProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />            
         </providers>
         <eventMappings>
            <add name="TBH Events" type="MB.ThePrayerHouse.WebCustomEvent, MB.ThePrayerHouse.CustomEvents" />            
         </eventMappings>
         <rules>
            <clear />
            <add name="TBH Events" eventName="TBH Events" provider="SqlWebEventProvider" profile="Critical" />            
            <add name="All Errors" eventName="All Errors" provider="SqlWebEventProvider" profile="Critical" />
            <add name="Failure Audits" eventName="Failure Audits" provider="SqlWebEventProvider" profile="Critical" />
            <add name="Heartbeats" eventName="Heartbeats" provider="SqlWebEventProvider" profile="Critical" />
         </rules>
      </healthMonitoring>      
   </system.web>

   <location path="EditProfile.aspx">
      <system.web>
         <authorization>
            <deny users="?"/>
            <allow users="*"/>
         </authorization>
      </system.web>
      </location>

   <location path="OrderHistory.aspx">
      <system.web>
         <authorization>
            <deny users="?"/>
            <allow users="*"/>
         </authorization>
      </system.web>
   </location>

   <location path="AddEditPost.aspx">
      <system.web>
         <authorization>
            <allow roles="Administrators,Editors,Moderators,Posters" />  
            <deny users="*"/>
         </authorization>
      </system.web>
   </location>
      
   <system.net>
      <mailSettings>
         <!-- <smtp deliveryMethod="Network"> -->
         <smtp deliveryMethod="PickupDirectoryFromIis" from="thePrayerHouse@infokare.com">
            <network defaultCredentials="true" host="(localhost)" port="25" />
         </smtp>
      </mailSettings>
   </system.net>
</configuration>
0
 
McExpCommented:
There is plenty of scope in your site for errors your using plenty of custom functionality.

Can you view the site from a Web Browser local to the server?

If not to see the error you are going to need to update your custom errors, Replace this:
      <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx">
         <error statusCode="404" redirect="~/Error.aspx?code=404" />
         <error statusCode="408" redirect="~/Error.aspx?code=408" />
         <error statusCode="505" redirect="~/Error.aspx?code=505" />
      </customErrors>
With:
      <customErrors mode="Off"/>

Once you've tracked down the problem you can put it back to your original customErrors section
0
 
TakeoutdinnerAuthor Commented:
Hi Master,
I replaced it with your instruction. Then this message comes up. I hope you can fix it for me.
Thanks,
HD

Server Error in '/' Application.
--------------------------------------------------------------------------------

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not 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: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

0
 
McExpCommented:
it's 00:54 in the morning here so I'm off to bed but you should find plenty of possible solutions if you google for "under the default settings SQL Server does not allow remote connections"
0
 
RejojohnyCommented:
did you test that the SQL server that your application is coded for can be accessed from the server where you have published it ..

Rejo
0
 
TakeoutdinnerAuthor Commented:
Hi Experts,

I tested it in differnt ways.
When I upload these codes to Websites, App_Data is copied also. Then I needed to change App_Data's Properties Everyone = Full Control (Check), Internet Guest Access = Full Control. Then it's working fine.

If this is right, here is my problem:
1. It is working in some case (I'm not sure exactly what kind of condition), but not all cases. If I upload App_Data using FTP program it is fine. If I upload App_Data using Visual Studio's Copy Website, it's not.
Of course before I uplaod file, I changed properties of App_Data Full Control. I believe ASPNETDB in App_Data needs to update.

2. I need to upload final version to Hosting site. At that time, property change function may not give me from Hosting Company, I think Visual Studio has some function to set App_Data folder's properties.

Your worthy advices would be appreciated.
Thanks,
HD
0
 
McExpCommented:
One thing you should look into is Web Deployment projects, this will extend on the capabilites of Visual studio to provide a number of enhancment, One of which allows you to package a site for uploading without the appData, probalby with the intention of defending against the sort of issues you face.

http://msdn2.microsoft.com/en-gb/asp.net/Aa336619.aspx

I'm guessing that you shouldn't need to update the ASPNETDB that often? especially if it is being update by users who are accesing the site?
0
 
TakeoutdinnerAuthor Commented:
Hi Master,

I printed the hand out from http://msdn2.microsoft.com/en-gb/asp.net/Aa336619.aspx.
But it is not easy how to process. So can you help me to process it step by step?
I increased point from 50 to 100 for your kind help.

I think this problem is caused from App_Data folder. But I do not know how to avoid it. My test program's App_Data folder has ASPNETDB.mdf and WroxUnited.mdf. My test program is downloaded from www.wrox.com, Beginning ASP.NET 2.p VB version Chapter 3, written by Chris Hart, John Kauffman, David, Chris. My hosting website is www.infokare.net in DiscountASP.net. If you downlaod it from www.wrox.com and publish it to this site, you may see the same problem. Now there is already published and has my problem with this site.

Really appreciate your kind help.
HD
0
 
McExpCommented:
you have said that if you FTP everything is ok?

Why not just publish to a local dir and then ftp the changed files up?
0
 
McExpCommented:
Have you resolved your problems?

If so shall we close this off?

We might even win the laptops!!!
0
 
TakeoutdinnerAuthor Commented:
Yes.
You may close this off.

Thanks,
HD
0
 
McExpCommented:
No you need to close this off select the answer that best fits and select accept this as an answer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now