Link to home
Start Free TrialLog in
Avatar of Gitti
Gitti

asked on

Custom errors

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!
 
Avatar of GavinMannion
GavinMannion

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....
Avatar of Gitti

ASKER

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
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.
Avatar of Gitti

ASKER

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

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.
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...
Avatar of Gitti

ASKER

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 ....:(
ASKER CERTIFIED SOLUTION
Avatar of GavinMannion
GavinMannion

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gitti

ASKER

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,


So is it still not working?

Avatar of Gitti

ASKER

Unfortunately NO! I hope I will find the error of the application and will get ride of this mystique error page.
Regards
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
Avatar of Gitti

ASKER

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?

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.
Hey congrats, what was the problem in the end? I see the error now?
Avatar of Gitti

ASKER

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