Solved

ASP.NET Personalization Error

Posted on 2010-08-25
7
1,098 Views
Last Modified: 2013-11-07
In development I just added some elements to the profile object that I'm trying to associate with my users.  It works great in dev, with this code in my web.config:

            <profile>
                  <properties>
                        <add name="Nickname" defaultValue="default"/>
                        <add name="Initials" defaultValue="default"/>
                        <add name="PRO" defaultValue="default"/>
                        <add name="Phone" defaultValue="default"/>
                  </properties>
            </profile>


When I add that to my web.config in Prod, I get this error for my entire web app:
This application was precompiled with personalization turned off, but it appears to have been turned on after the precompilation, which is not supported.

How do I turn on personalization?  I tried putting the following in my Prod web.config, but still got the error:
            <webParts>
                  <personalization defaultProvider="MyAspNetSqlPersonalizationProvider">
                        <providers>
                              <add connectionStringName="LocalSqlServer" name="MyAspNetSqlPersonalizationProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
                        </providers>
                  </personalization>
            </webParts>
0
Comment
Question by:JT_SIRO
  • 4
  • 3
7 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 33526736
Have you recompiled and re-deployed the app or have you literally just added those elements to the config on your live site? If it's the latter then you need to re-build and re-deploy the site.
0
 

Author Comment

by:JT_SIRO
ID: 33527222
Yea, I just added the profile code to the web.config on my server.  When you say re-deploy, what does that mean exactly?  My app consists of dozens of aspx pages.  Do they all need to be copied over?  I guess I don't know how the production server is to know that the app has been recomplied, unless it was in the web config.  Please advise.  Thanks,

Justin
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 33529148
When you compile your site the compiler takes the profile information and dynamically generates a class to strongly-type your profile values. Which means you can't just add profile information to your live site without recompiling the site.

If none of your aspx pages have changed then you may be able to get away with simply recompiling and deploying just the updated dll.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:JT_SIRO
ID: 33534222
I use single page assemblies when I compile, so there's a dll for every page in my site (about 40).  Do I need to compile and move them all over then?  I'm guessing that I do, because every page I try to navigate to produces the error.  That's where my confusion was.  If the web.config can't fix it, I think I'd need to replace them all.  Why is that not just a web.config setting?  That seems strange.  thx -
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 250 total points
ID: 33534340
The web.config values purely serve as a way to define what values you want to store in the profile. The app needs to be compiled because it needs to create a strongly-typed class based on the values in the config file. Basically so that it is able to correctly serialize the values to and from the underlying membership database.
0
 

Author Comment

by:JT_SIRO
ID: 33534626
I recompiled, then moved one pages aspx and dll over to my prod server.  
I then manually added the profile tag to my prod web.config.
When I navigated to that page, I got the error message again.

My web.config code is below.
		<httpRuntime executionTimeout="1000"  maxRequestLength="1000000" />

		<membership>

			<providers>

				<remove name="AspNetSqlMembershipProvider"/>

				<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer"  enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="7" maxInvalidPasswordAttempts="5" />

			</providers>

		</membership>



		<webParts>

			<personalization defaultProvider="MyAspNetSqlPersonalizationProvider">

				<providers>

					<add connectionStringName="LocalSqlServer" name="MyAspNetSqlPersonalizationProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

				</providers>

			</personalization>

		</webParts>



		<profile>

			<properties>

				<add name="Nickname" defaultValue="default"/>

				<add name="Initials" defaultValue="default"/>

				<add name="PRO" defaultValue="default"/>

				<add name="Phone" defaultValue="default"/>

			</properties>

		</profile>

Open in new window

0
 

Author Comment

by:JT_SIRO
ID: 33535124
I've got it working now.  I seemed to have forgotten to copy my app code dll over.  Brilliant...  
Thanks a ton for your help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now