Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This the 1st webconfig that i want to put in the second web config
note: I have 2 projects

----1----
XML
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <connectionStrings>
        <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <authorization>
            <allow users="?"/>
            <allow roles="admin"/>
        </authorization>
        <roleManager enabled="true"/>
        <authentication mode="Forms"/>
        <!--
          Set compilation debug="true" to insert debugging
          symbols into the compiled page. Because this
          affects performance, set this value to true only
          during development.
    -->
        <compilation debug="true" targetFramework="4.0">
        </compilation>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    <system.web>
        <anonymousIdentification enabled="true"/>
        <profile enabled="true">
            <properties>
                <add name="SCart" serializeAs="Binary" type="ShoppingCartExample.Cart" allowAnonymous="true"/>
            </properties>
        </profile>
    </system.web>
</configuration>




----2----
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>
    <connectionStrings>
        <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
        <authentication mode="Forms">
            <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
        </authentication>
        <membership>
            <providers>
                <clear/>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
            </providers>
        </membership>
        <profile>
            <providers>
                <clear/>
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
            </providers>
        </profile>
        <roleManager enabled="false">
            <providers>
                <clear/>
                <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
                <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
            </providers>
        </roleManager>
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
</configuration>
Posted
Comments
ZurdoDev 4-Feb-14 11:50am    
Where are you stuck? Just copy and paste whatever you want between the two.
Member 10533469 4-Feb-14 11:54am    
I having this error,


Line 37: void Profile_OnMigrateAnonymous(object sender, ProfileMigrateEventArgs e)
Line 38: {
Line 39: ProfileCommon anonymousProfile = Profile.GetProfile(e.AnonymousID);
Line 40: if (anonymousProfile.SCart != null)
Line 41: {

and I want to copy this to the webconfig 2
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
<system.web>
<anonymousidentification enabled="true">
<profile enabled="true">
<properties>
<add name="SCart" serializeas="Binary" type="ShoppingCartExample.Cart" allowanonymous="true">
</properties>
</profile>

but above the error have been shown,
ZurdoDev 4-Feb-14 11:56am    
What error? I don't see an error.
Member 10533469 4-Feb-14 11:57am    
Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)
ZurdoDev 4-Feb-14 12:01pm    
This is not a web.config issue is it? It's your code that is failing because it does not know what ProfileCommon is. That is code that is probably in some dll that you have. You need to include that dll or project in this project as well.

1 solution

See here[^]
and here[^]
and here[^]

Hopefully this helps.
 
Share this answer
 

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