Learn how to a build a cloud-first strategyRegister Now

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

Convert web.config from Framework Ver 2.0 to Framework Ver 1.1

Hi,

The web.config file below working under Framework Ver 2.0, now I got problem when migrate it to a server that has Framework Ver 1.1.

Can anyone here try to convert the web.config file below to Ver 1.1 compatible? Many thanks.





<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
      <appSettings/>

  <!--
         
  <connectionStrings>
  <add name="eventsConnectionString" connectionString="DATABASE=events;DSN=eventsReg;OPTION=0;PORT=0;UID=root"
   providerName="System.Data.Odbc" />
 </connectionStrings>
 -->
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" strict="false" explicit="true"/>
            <pages>
                  <namespaces>
                        <clear/>
                        <add namespace="System"/>
                        <add namespace="System.Collections"/>
                        <add namespace="System.Collections.Specialized"/>
                        <add namespace="System.Configuration"/>
                        <add namespace="System.Text"/>
                        <add namespace="System.Text.RegularExpressions"/>
                        <add namespace="System.Web"/>
                        <add namespace="System.Web.Caching"/>
                        <add namespace="System.Web.SessionState"/>
                        <add namespace="System.Web.Security"/>
                        <add namespace="System.Web.Profile"/>
                        <add namespace="System.Web.UI"/>
                        <add namespace="System.Web.UI.WebControls"/>
                        <add namespace="System.Web.UI.WebControls.WebParts"/>
                        <add namespace="System.Web.UI.HtmlControls"/>
                  </namespaces>
            </pages>
            <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
            <authentication mode="Windows"/>
            <!--
            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>
        -->
      </system.web>
</configuration>
0
Ryan Chong
Asked:
Ryan Chong
  • 5
  • 4
3 Solutions
 
vincent_figoCommented:
It looks Version 1.1 compatible to me...

Do you get some sort of error message ?
0
 
Ryan ChongAuthor Commented:
hi there, this is what i get:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Child nodes are not allowed.

Source Error:


Line 22:     <compilation debug="true" strict="false" explicit="true"/>
Line 23:             <pages>
Line 24:                   <namespaces>
Line 25:                         <clear/>
Line 26:                         <add namespace="System"/>
 

Source File: C:\Inetpub\vhosts\epitome.com.sg\httpdocs\myfolder\web.config    Line: 24


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
0
 
vincent_figoCommented:
Try removing the <pages> section...
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Ryan ChongAuthor Commented:
thks.. but now i encountered problem on my codes:



Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type System.Web.UI.WebControls.SqlDataSource from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

Source Error:


Line 31: <!-- ImageReady Slices (TEMPALTE_SG_eclise_flatten.psd) -->
Line 32: <form id="registration" runat="server">
Line 33:     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="
Line 34:                 <%$ ConnectionStrings:eventsConnectionString %>"
Line 35:                 SelectCommand="SELECT registration.* FROM registration"
 

Source File: C:\Inetpub\vhosts\epitome.com.sg\httpdocs\myfolder\registration.aspx    Line: 33


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300


Can help give me some clues? thks
0
 
vincent_figoCommented:
Take this example from Micorsoft... This describes the use of the compilation section... Maybe this can help you add the namespaces...

--------------------------------

    <compilation defaultLanguage="VB" debug="true" numRecompilesBeforeAppRestart="15">
         <compilers>
            <compiler language="VB;VBScript" extension=".cls" type="Microsoft.VisualBasic.VBCodeProvider,system, Version=1.0.5000.0,  Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <compiler language="C#;Csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,system, Version=1.0.5000.0,  Culture=neutral, PublicKeyToken=b77a5c561934e089" />
         </compilers>

         <assemblies>
""            <add assembly="ADODB" />
            <add assembly="*" />
         </assemblies>

         <namespaces>
            <add namespace="System.Web" />
            <add namespace="System.Web.UI" />
            <add namespace="System.Web.UI.WebControls" />
            <add namespace="System.Web.UI.HtmlControls" />
         </namespaces>

      </compilation>
0
 
vincent_figoCommented:
So maybe in your case:

<compilation defaultLanguage="VB" debug="true">

         <namespaces>
                    <add namespace="System"/>
                    <add namespace="System.Collections"/>
                    <add namespace="System.Collections.Specialized"/>
                    <add namespace="System.Configuration"/>
                    <add namespace="System.Text"/>
                    <add namespace="System.Text.RegularExpressions"/>
                    <add namespace="System.Web"/>
                    <add namespace="System.Web.Caching"/>
                    <add namespace="System.Web.SessionState"/>
                    <add namespace="System.Web.Security"/>
                    <add namespace="System.Web.Profile"/>
                    <add namespace="System.Web.UI"/>
                    <add namespace="System.Web.UI.WebControls"/>
                    <add namespace="System.Web.UI.WebControls.WebParts"/>
                    <add namespace="System.Web.UI.HtmlControls"/>
         </namespaces>

</compilation>
0
 
Sammy AgeilCommented:
<add namespace="System.Web.UI.WebControls.WebParts"/>
 <add namespace="System.Web.Profile"/>
Dont exist in 1.1 both are 2.0 only
0
 
Ryan ChongAuthor Commented:
Now i got:

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
      <appSettings/>

  <!--
         
  <connectionStrings>
  <add name="eventsConnectionString" connectionString="DATABASE=events;DSN=eventsReg;OPTION=0;PORT=0;UID=root"
   providerName="System.Data.Odbc" />
 </connectionStrings>
 -->
  <system.web>
    <customErrors mode="Off"/>
    <compilation defaultLanguage="VB" debug="true" numRecompilesBeforeAppRestart="15">
             <compilers>
                <compiler language="VB;VBScript" extension=".cls" type="Microsoft.VisualBasic.VBCodeProvider,system, Version=1.0.5000.0,  Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                <compiler language="C#;Csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,system, Version=1.0.5000.0,  Culture=neutral, PublicKeyToken=b77a5c561934e089" />
             </compilers>
   
             <assemblies>
                <add assembly="ADODB" />
                <add assembly="*" />
             </assemblies>
   
             <namespaces>
                <add namespace="System.Web" />
                <add namespace="System.Web.UI" />
                <add namespace="System.Web.UI.WebControls" />
                <add namespace="System.Web.UI.HtmlControls" />
             </namespaces>
   
      </compilation>
     
     
            
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
              -->
            <authentication mode="Windows"/>
            <!--
            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>
        -->
      </system.web>
</configuration>


and the error is:


Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized element

Source Error:


Line 38:              </namespaces>
Line 39:    
Line 40:       </compilation>
Line 41:      
Line 42:      
 

Source File: C:\Inetpub\vhosts\epitome.com.sg\httpdocs\myfolder\web.config    Line: 40


Anyone can help here?
0
 
vincent_figoCommented:
     </compilation>
     
     
         
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
             -->

MUST BE :

      </compilation>
     
     
           <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
             -->

You forgot to put the text below in comment
0
 
Ryan ChongAuthor Commented:
Hi guys,

Sorry for the late reply, the problem has been resolved, after upgrading the web server from .NET Framework 1.1 to .NET Framework 2.0.

The original problem was caused by my friend's freelancer that using .NET Framework 2.0 where my friend's web server only have .NET Framework 1.1 , now my friend upgrading the server to .NET Framework 2.0 and I just realised that the script is running well now.

Thanks guys for the speedy response! Will close this question now....  cheers.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now