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!
 
GittiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GavinMannionCommented:
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....
GittiAuthor Commented:
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
GavinMannionCommented:
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.
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

GittiAuthor Commented:
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

GavinMannionCommented:
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.
GavinMannionCommented:
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...
GittiAuthor Commented:
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 ....:(
GavinMannionCommented:
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?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GittiAuthor Commented:
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,


GavinMannionCommented:
So is it still not working?

GittiAuthor Commented:
Unfortunately NO! I hope I will find the error of the application and will get ride of this mystique error page.
Regards
GavinMannionCommented:
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
GittiAuthor Commented:
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?

GavinMannionCommented:
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.
GavinMannionCommented:
Hey congrats, what was the problem in the end? I see the error now?
GittiAuthor Commented:
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
GavinMannionCommented:
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....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.