?
Solved

Custom errors

Posted on 2006-04-13
17
Medium Priority
?
329 Views
Last Modified: 2011-10-03
My app. works fine on my local machine. Now I put it on the prodution server and get a Runtime Error.

This is the browser's message: "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"."

The problem is that the <customErrors> tag is set to Off!!!!!
Hier is the code in the web.config:
<system.web>
      <customErrors mode="Off"/>
What could be wrong hier? How can I know what problem is occuring on the remote server?

Thanks!
 
0
Comment
Question by:Gitti
  • 10
  • 7
17 Comments
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16443431
Normally you web.config looks like this

            <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->

You then change it to "Off" and forget to remove the --> to above the <customErrors tag.

Try that first....
0
 

Author Comment

by:Gitti
ID: 16443552
Hi and thanks for the answer. I am sorry, but it isn't clear for me what exactly to do? You mean I should remove the following code?
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />

It doesn't exist any more in the web.config file. The only tag that exists is: <system.web>
    <customErrors mode="Off"/>
Nevertheless the browser still reads this tag: <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
Although IT DOES'T EXIST IN THE CODE!

Thanks
0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16443580
Firstly check to see that you only have one web.config file.

Then check to see that it is properly formed.

Paste your entire web.config here. Possibly something else is wrong in it.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Gitti
ID: 16443636
Ach many thanks! Hier is the whole web.config ;)

<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
 
  <configSections>
    <section name="CommerceDataProvider" type="Commerce.Providers.DataProviderConfigurationHandler, Commerce.DataProvider"/>
    <section name="CommerceOrdersProvider" type="Commerce.Providers.OrdersProviderConfigurationHandler, Commerce.OrdersProvider"/>
    <section name="CommerceShoppingCartProvider" type="Commerce.Providers.ShoppingCartConfigurationHandler, Commerce.ShoppingCartProvider"/>
    <section name="CommerceCatalogProvider" type="Commerce.Providers.CatalogProviderConfigurationHandler, Commerce.CatalogProvider"/>
    <section name="CommerceTaxProvider" type="Commerce.Providers.TaxProviderConfigurationHandler, Commerce.TaxProvider"/>
    <section name="CommerceShippingProvider" type="Commerce.Providers.ShippingProviderConfigurationHandler, Commerce.ShippingProvider"/>
    <section name="CommercePaymentProvider" type="Commerce.Providers.PaymentProviderConfigurationHandler, Commerce.PaymentProvider"/>
  </configSections>
  <appSettings>
    <!--PayPal Settings-->
    <add key="SimpleTaxRate" value="0.0825"/>
    <add key="BusinessEmail" value="business@csk.com"/>
    <add key="RequireShipping" value="True"/>
    <add key="RequireLogin" value="checkout"/>
    <add key="SecureURL" value="http://localhost/pp2/"/>
    <add key="SiteURL" value="http://localhost/pp2/"/>
    <add key="ShipFromZip" value="96960"/>
    <add key="ShowZeroInventoryItems" value="True"/>

    <!--the sandbox is PayPal's development server-->
    <add key="UseSandbox" value="False"/>
    <add key="UseDirectPay" value="True"/>

    <!--setting this to true will override DirectPay-->
    <add key="UsePayPalPaymentsStandard" value="True"/>
   
    <!--this is the currency code that will be sent to process the transaction
    valid codes are "USD" (us dollar), "EUR" (euro), "GBP" (Brit pound), JPY (Japanese yen) etc.
    -->
    <add key="CurrencyCode" value="EUR"/>
   
    <!--PayPal Payments Pro Settings     -->
    <!--make sure you also set the PaymentProvider settings below
    The below if for the ExpressCheckout
    -->
    <add key="PayPalAPIAccountName" value="business_api1.csk.com"/>
    <add key="PayPalAPIAccountPassword" value="commerce"/>
    <add key="PayPalAPICertificate" value="csk.pfx"/>
    <add key="PayPalAPICertificationPassword" value="commerce"/>

    <!--PayPal Payments Standard Settings-->
    <add key="PayPalPDTID" value="4wscjERBD3ik_E7hmrqVaXHilJTCegrJ5FJogluERPo8H9ixPskOmFXuQK8"/>
  </appSettings>

  <!--this is for the DirectPay-->
  <CommercePaymentProvider defaultProvider="PayPalPaymentProvider">
    <providers>
      <clear/>
      <add name="PayPalPaymentProvider"
      type="Commerce.Providers.PayPalPaymentProvider, Commerce.PaymentProvider"
      serviceUserName="business_api1.csk.com"
      servicePassword="commerce"
      sslCertFile="csk.pfx"
      sslCertPassword="commerce"
      merchantID="me@myCompany.com"
      />
 
    </providers>
  </CommercePaymentProvider>
  <CommerceShippingProvider defaultProvider="SqlShippingProvider">
    <providers>
      <clear/>
      <add name="SqlShippingProvider"
    type="Commerce.Providers.SqlShippingProvider, Commerce.ShippingProvider"
    connectionStringName="CommerceTemplate"/>
    </providers>
  </CommerceShippingProvider>
  <CommerceTaxProvider defaultProvider="SqlTaxProvider">
    <providers>
      <clear/>
      <add name="SqlTaxProvider"
        type="Commerce.Providers.SqlTaxProvider, Commerce.TaxProvider"
        connectionStringName="CommerceTemplate"/>
    </providers>
  </CommerceTaxProvider>
  <CommerceOrdersProvider defaultProvider="SqlOrdersProvider">
    <providers>
      <clear/>
      <add name="SqlOrdersProvider"
        type="Commerce.Providers.SqlOrdersProvider, Commerce.OrdersProvider"
        connectionStringName="CommerceTemplate"/>
                  </providers>
            </CommerceOrdersProvider>
      <CommerceShoppingCartProvider defaultProvider="SqlShoppingCartProvider">
                  <providers>
                        <clear/>
                        <add name="SqlShoppingCartProvider"
     type="Commerce.Providers.SqlShoppingCartProvider, Commerce.ShoppingCartProvider"
     connectionStringName="CommerceTemplate"/>
                  </providers>
            </CommerceShoppingCartProvider>
      <CommerceCatalogProvider defaultProvider="SqlCatalogProvider">
            <providers>
                  <clear/>
                  <add name="SqlCatalogProvider"
    type="Commerce.Providers.SqlCatalogProvider, Commerce.CatalogProvider"
    connectionStringName="CommerceTemplate"/>
            </providers>
      </CommerceCatalogProvider>


      <connectionStrings>
            <clear/>
            
            <add name="CommerceTemplate"
   connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|CommerceDB.mdf" providerName="System.Data.SqlClient" />
            <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|ASPNET.mdf" providerName="System.Data.SqlClient" />
      </connectionStrings>
      
      <system.web>
    <customErrors mode="Off"/>
    <roleManager enabled="true"/>
            <membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15" hashAlgorithmType=""
     >
                  <providers>
                        <clear/>
                        <add connectionStringName="LocalSqlServer"
     enablePasswordRetrieval="false"
     enablePasswordReset="true"
     requiresQuestionAndAnswer="true"
     applicationName="/"
     requiresUniqueEmail="false"
     passwordFormat="Hashed"
     maxInvalidPasswordAttempts="5"
     passwordAttemptWindow="10"
     passwordStrengthRegularExpression=""
     minRequiredPasswordLength="1"
     minRequiredNonalphanumericCharacters="0"
     name="AspNetSqlMembershipProvider"
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                  </providers>
            </membership>
            <anonymousIdentification enabled="true"/>
            <authentication mode="Forms">
                  <forms name=".ASPNET" loginUrl="login.aspx" protection="All" timeout="30" path="/"/>
            </authentication>
            <authorization>
                  <allow users="?"/>
            </authorization>
            <profile automaticSaveEnabled="true">
                  <!--
                  <providers>
                        <clear/>
                        <add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="CommerceTemplateSQL"/>
                  </providers>
                  -->
                  <properties >
                        <group name="Commerce">
                              <!--shipping prefs-->
                              <add name="ShipFirst" type="System.String" allowAnonymous="true"/>
                              <add name="ShipLast" type="System.String" allowAnonymous="true"/>
                              <add name="ShipCity" type="System.String" allowAnonymous="true"/>
                              <add name="ShipAddress1" type="System.String" allowAnonymous="true"/>
                              <add name="ShipAddress2" type="System.String" allowAnonymous="true"/>
                              <add name="ShipState" type="System.String" allowAnonymous="true"/>
                              <add name="ShipZip" type="System.String" allowAnonymous="true"/>
                              <add name="ShipCountry" type="System.String" allowAnonymous="true"/>
                              <add name="ShipPhone" type="System.String" allowAnonymous="true"/>

                              <!--encrypted info-->
                              <add name="CCNumber" type="System.String" allowAnonymous="true"/>
                              <add name="CCType" type="System.String" allowAnonymous="true"/>
                              <add name="CCExpMonth" type="System.String" allowAnonymous="true"/>
                              <add name="CCExpYear" type="System.String" allowAnonymous="true"/>
                              <add name="CCAuthNumber" type="System.String" allowAnonymous="true"/>

                        </group>
                        <add name="First" type="System.String" allowAnonymous="true"/>
                        <add name="Last" type="System.String" allowAnonymous="true"/>
                        <add name="City" type="System.String" allowAnonymous="true"/>
                        <add name="Address1" type="System.String" allowAnonymous="true"/>
                        <add name="Address2" type="System.String" allowAnonymous="true"/>
                        <add name="State" type="System.String" allowAnonymous="true"/>
                        <add name="Zip" type="System.String" allowAnonymous="true"/>
                        <add name="Country" type="System.String" allowAnonymous="true"/>
                        <add name="Phone" type="System.String" allowAnonymous="true"/>
                        

                  </properties>
            </profile>
            <compilation debug="true">
                  <assemblies>
                        <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
             <pages styleSheetTheme="White" />
       </system.web>
   
      
      <system.net>
            <mailSettings>
                  <smtp from="me@email.com">
    <network host="my.email.com" password="password" userName="username" />
   </smtp>
            </mailSettings>
      </system.net>

</configuration>
-------------------------------------------------------------------------
And yes, there is only one web.config in this directory!
Thanks again

0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16443749
Okay good news.... your web.config looks fine...

Bad news... Why are you having this problem?

Are you sure your application is marked as an application in IIS? Are you trying to rwite files or anything like that?
Still looking but try these two for now.
0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16443773
Also try running the app locally from the prod server and see what it says. Might help narrow it down.

Looking around it seems to happen to some unlucky person every now and then...
0
 

Author Comment

by:Gitti
ID: 16443880
Sorry for so much problems. You saw the web.config, and this is the url: http://e-commerce.eport.at/default.aspx and this is the setting on the remote server:
http://e-commerce.eport.at(Current IIS Virutal Direction)
Such a unique problem ....:(
0
 
LVL 15

Accepted Solution

by:
GavinMannion earned 2000 total points
ID: 16443950
Okay so in IIS it has been set as a Application and not only a virtual directory? Can you get to the box to check the settings?

Do you have any .html files in the same directory that you can see if you can hit?
0
 

Author Comment

by:Gitti
ID: 16444040
Yep! This is: http://e-commerce.eport.at/README.htm -and I set it also as an Application (Thanks for the hint).

But the vexatious runtime error doesn't disappear, It seems to be a vicious circle! If I just could get ride of this error page and see where the problem is occuring?
Think better to try to go through the real application. Many, many thanks for your kind helps,


0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16444075
So is it still not working?

0
 

Author Comment

by:Gitti
ID: 16444153
Unfortunately NO! I hope I will find the error of the application and will get ride of this mystique error page.
Regards
0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16444171
Hmm you shouldn't have accepted my answer then if it doesn't work.

I am 90% sure it has something to do with your permissions on the remote server.
try running aspnet_regiis -i inthe command line and then
try running iisreset in the command line
0
 

Author Comment

by:Gitti
ID: 16444328
O YES! Of course, main thing you helped me further. I got some valuable hints and tips from you! All them are more worth than points;)

aspnet_regiis -i -->'aspnet_regiis -i' is not recognized as an internal or external command, operatable programm or batch file.
isreset --> IIS restarted successfully!

I run this commands on my local machine (should I do them somewhere else?).

Now I granted the full promission to ASPNET and also everyone to the whole e-commerce folder. I don't know what else could be set?
Now it is set as an application, is a virtual directory and there is full promission. What else could be set there?

0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16444360
aspnet_regiis -i needs to be run from inside the framework folder. Sorry should have specified that

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

You are using v2 right?

Make sure that in IIS under properties for your virtual directory that there is a tab called ASP.NET and that v2 is selected.
0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16444380
Hey congrats, what was the problem in the end? I see the error now?
0
 

Author Comment

by:Gitti
ID: 16444390
YEEEES!!!!!!!!!!! that was it! The net version on the server for this directory was 1.1! I changes it to v2.0.50727!

Now I can see the error cause.
Many many ..., thanks for your kind help.
Wish you a very great day and thanks again!

Regards
0
 
LVL 15

Expert Comment

by:GavinMannion
ID: 16444461
No problem, I'm glad I found it because I like to earn my points :)...

If you don't get the next error fixed just post a new question and we can work on it again....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Screencast - Getting to Know the Pipeline
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question