Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts,

I am doing an asp.net 4.5 project.. When i add the below code in web.config and run the project. then i got the Error..


HTML
<configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
  </configSections>


  <dataConfiguration defaultDatabase="SM_Connection_String" />

  <connectionStrings>
    <add name="SM_Connection_String" connectionString="Data Source=Server-PC;Initial Catalog=db_School_Adm;Persist Security Info=True;User ID=sa;Password=abc_123456" providerName="System.Data.SqlClient" />
  </connectionStrings>  


Here is the Full Code of web.config File..

XML
<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>

    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />

      <authentication mode="Forms">
        <forms loginUrl="~/Default.aspx"
           protection="All"
           path="/"
           requireSSL="false"
           timeout="30"
           name=".ASPXAUTH"
           slidingExpiration="false"
           defaultUrl="../../SessionExpired.aspx"
           cookieless="UseDeviceProfile"
           enableCrossAppRedirects="false" />
      </authentication>


      <authorization>
        <deny users="?" />
      </authorization>
      
      
    </system.web>


  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
  </configSections>


  <dataConfiguration defaultDatabase="SM_Connection_String" />

  <connectionStrings>
    <add name="SM_Connection_String" connectionString="Data Source=Server-PC;Initial Catalog=db_School_Adm;Persist Security Info=True;User ID=sa;Password=abc_123456" providerName="System.Data.SqlClient" />
  </connectionStrings>  
  
</configuration>


Click here to View the Error that i am facing..

Please Help me to Solve this

Thanks and Regards,

Dileep

unnecessary code block removed
Posted
Updated 4-Jan-14 2:35am
v2

1 solution

Hi Dilzz,

I think the error description that you shared with your question itself gives you a solution,
You are trying to run .Net framework 3.5 application in Framework 4 in the more information section may help you to resolve the issue I believe.
In deployed server try to change the Default app pool[^] to mentioned Framework. This may the problem.

Hope this helps you a bit.

By the way, nice way to share snapshot here ;-)

Regards,
RK
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900