Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.NET Personalization Error

Posted on 2010-08-25
7
Medium Priority
?
1,163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

609 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