Web Profile Builder for Web Application Projects

Files can be downloaded from the Web Profile Builder project page.

If you use Web Application Projects, you have probably run into the issue of not being
able to access the Profile at design time.

Thankfully, some nice people created an Add-In for Visual Studio 2005 that will generate
a wrapper class as a workaround.  That project can be found here.  I wanted to contribute
to the Web Profile Generator project, but my emails went unanswered.  I decided to start
a new project.

This project picks up where that one left off and is based on their source code.  I started
out rebuilding that project as it stood to add support for Visual Studio 2008.  I got it to
work, but I wanted to do more. 

I decided to go ahead and address the issues listed on the original project site.

Here is a summary of the changes made.

  • First of all, this is no longer an Add-In.  Instead, it is a Build Task.
  • Works for Visual Studio 2005 and 2008.
  • Added ability to set the file name.
  • Added ability to set the directory the file gets created in.
  • Added ability to set the class name.
  • Added ability to set the name space.
  • Added an extra method as requested here.

Usage:

  1. Run the installer.
  2. Add this Import statement to your project file.  (see special notes below)
    <Import Project="$(MSBuildExtensionsPath)\WebProfileBuilder\WebProfileBuilder.targets" />
  3. Done.

The profile will get generated every time you build the project.

Special Notes:

After you modify the project file by adding the import statement, you will get this security
warning when the project loads.  Choose the "Load project normally" option and press OK.
image 

Extended Usage:

If you want to customize the web profile, you can add the following sections to your web.config.

This section needs to be at the top of the file just under the opening configuration tag.
<configSections>
   
<sectionGroup name="robo.webProfile">
       
<section name="webProfileSettings"
         
type="WebProfileBuilder.WebProfileConfigurationSection, WebProfileBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=01d50f1f82943b0c"
         
allowLocation="true"
         
allowDefinition="Everywhere"/>
   
</sectionGroup>
</configSections>

This section can be anywhere under the configuration section.
<robo.webProfile>
   
<webProfileSettings className="MyWebProfile"
                       
nameSpace="CustomNameSpace" 
                       
directory="CodeFiles"
                       
fileName="MyWebProfile" />
</robo.webProfile>

The directory name is not a virtual directory, but is in reference to the root of the Web Application.
The fileName is just the name of the file and should not include an extension.
The className and nameSpace are as you would expect.
None of these settings are required.  You don't even need to define this section at all.

If you would like to use Web Profile Builder, it can be downloaded here.
Also available is the complete source code and examples in VB and C#.

Thanks
-Joe

Published Sunday, February 3, 2008 3:21 AM by robolize

Comments

# re: Web Profile Builder for Web Application Projects

Friday, February 22, 2008 8:42 AM by Joe

Thanks man!

Works like a charm!

# re: Web Profile Builder for Web Application Projects

Wednesday, February 27, 2008 12:08 PM by Chris

Why does this require .NET 3.5 to install under studio 2005?

# re: Web Profile Builder for Web Application Projects

Wednesday, February 27, 2008 4:10 PM by robolize

Chris,

Good question.  I didn’t intend for .NET 3.5 to be required.

I built this using Visual Studio 2008.  I must have inadvertently made a reference to the 3.5 framework.  I will post an update to fix this in the next few days.

Thanks
-Joe

# re: Web Profile Builder for Web Application Projects

Wednesday, February 27, 2008 8:53 PM by robolize

I just updated the installer and source files.  WebProfileBuilder now only requires .NET 2.0

Thanks
-Joe

# re: Web Profile Builder for Web Application Projects

Thursday, February 28, 2008 8:42 AM by GrZeCh

Hello!

Thanks for this project. But how can I update profiles other users than current (for example after registration set some default values)?

Thanks in advance

# re: Web Profile Builder for Web Application Projects

Thursday, February 28, 2008 2:07 PM by robolize

GrZeCh,

Sorry, I don't understand your question.

# re: Web Profile Builder for Web Application Projects

Thursday, February 28, 2008 2:24 PM by GrZeCh

Sorry .. I'm always bad at describing my problems :)

Lets say I'm administrator of some page and I want to change on field in my users profile (City for example). How can I do this from codebehind?

WebProfile.Current.GetProfile("User").City = "New city";

something like this should work?

# re: Web Profile Builder for Web Application Projects

Thursday, February 28, 2008 3:15 PM by GrZeCh

ok .. I found solution for my problem.

           var user = new WebProfile().GetProfile("User");

           user.City = "New city";

           user.Save();

thanks again for this profile builder

# re: Web Profile Builder for Web Application Projects

Friday, February 29, 2008 3:52 PM by Kalle

when using source control, it's quite annoying to have to keep WebProfile.cs checked out at all times or to check it out every time before compile. Is there a workaround for this?

# re: Web Profile Builder for Web Application Projects

Saturday, March 1, 2008 10:03 AM by robolize

Kalle,

I bet that it annoying.  I use a source control model that doesn’t require files to be checked out so this is something I didn’t think of.  I am planning to make an update that will address this issue.  Thanks for your feedback.

-Joe

# re: Web Profile Builder for Web Application Projects

Friday, March 7, 2008 12:35 PM by robolize

Martin,
Another good point.  I will address this in the next update.  Basically, I will identify if changes were made to the profile section in the web.config and only regenerate the profile class if there were changes.  I’m crazy busy with my real job right now, but I plan to have this update out in the next few weeks.  
Thanks for your feedback and patients.

-Joe

# re: Web Profile Builder for Web Application Projects

Friday, March 7, 2008 2:43 PM by Ben

FYI - I update the source on the copy I download to only attempt to overwrite the source file when the source file is writable.

private void SaveWebProfile(string code)

       {

           // Write the code to disk

           string fullName = Path.Combine(ProfileDirectory, ProfileFileName);

           bool isReadOnly;

           isReadOnly = new FileInfo(fullName).IsReadOnly;

           if (!isReadOnly)

           {

               using (StreamWriter sw = File.CreateText(fullName))

               {

                   sw.Write(code);

               }

           }

       }

# re: Web Profile Builder for Web Application Projects

Friday, March 7, 2008 3:18 PM by robolize

Ah, very nice.  I’ll incorporate this into the next release.

Thanks Ben.

# re: Web Profile Builder for Web Application Projects

Monday, March 10, 2008 8:23 PM by effpath

Really great! I'm developing my first projects in asp.net and I lost some hours before discovering that web applications don't have access to strong typed profile's properties. I was resigning myself to writing a boring wrapper for the ProfileBase when I found your work... Thank you!

# re: Web Profile Builder for Web Application Projects

Friday, March 28, 2008 5:38 AM by Steele

Thanks for filling in an important hole, this was making me crazy trying to understand the difference after converting from a WebSite Project.

Why does this REQUIRE a RootNamespace

Frequently in VB I leave it blank.

Perhaps, this is bad form, but there are many valid reasons to do so in VB.Net.

# re: Web Profile Builder for Web Application Projects

Thursday, April 3, 2008 6:36 PM by Jason

I'm fairly new to the .NET framework, and I'm having a hard time with step 2 in your install instructions.

Under my project, there is a project file called "My Project", but it is not an XML-formatted file.  It has a GUI menu with options that include "references", etc. and I don't understand where to put the <import project /> line to include into the project.  

Using this will help me greatly in dealing with my user profiles on the back-end and I am anxious to getting it working, but I am stuck.

# re: Web Profile Builder for Web Application Projects

Sunday, April 6, 2008 10:39 AM by Arino

Unfortunately did not work in VS2005 although I followed all the instructions...

# re: Web Profile Builder for Web Application Projects

Friday, April 11, 2008 10:30 AM by Gary Davis

I installed the setup file, inserted the statement into the csproj file, loaded the project and this error displayed:

Warning 1 The "BuildWebProfile" task failed unexpectedly.

System.NullReferenceException: Object reference not set to an instance of an object.

  at WebProfileBuilder.Builder.LoadProfileFromWebConfig(String path)

  at WebProfileBuilder.Builder.GenerateWebProfile(BuildWebProfile buildWebProfile)

  at WebProfileBuilder.BuildWebProfile.Execute()

  at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) theStore24

Most of my references are now marked with the yellow yield icon. Attempting build of the solution then adds these warnings:

Warning 2 The referenced component 'AjaxPro.2' could not be found.

Warning 3 The referenced component 'CMPCDotNet' could not be found.

Warning 4 The referenced component 'ICSharpCode.SharpZipLib' could not be found.

  :

  :

Removing the statement from the csproj file fixes everytlhing.

This is using the 1.1.0.0 release with VS2008 on Win Server 2003 SP2.

Any ideas on this?

# re: Web Profile Builder for Web Application Projects

Tuesday, April 15, 2008 6:44 AM by marco

i have the same problem !

# re: Web Profile Builder for Web Application Projects

Saturday, April 26, 2008 2:39 AM by Stacy

"This property cannot be set for anonymous users"

I get this error when accesing a property during signup in the CreateUserWizard1_CreatedUser method. My code is:

// Create an empty Profile for the newly created user

MyWebProfile p = new MyWebProfile();

p.GetProfile(CreateUserWizard1.UserName, true);

p.FirstName = "Bob";

webProfileSettings tag in config correctly generates the MyWebProfile  class with all my properties.

In my previous website project, I used this code that works fine:

ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);

p.FirstName = "Bob";

Can someone please help me with this convert to WAP?

I thought GetProfile created a new user profile like ProfileCommon.Create, but I get the error above.

# re: Web Profile Builder for Web Application Projects

Monday, April 28, 2008 12:42 PM by Stacy

I switched to ver 1.2 and the problem went away.

I used the new static method to create a new profile:

MyWebProfile p = MyWebProfile.GetProfile(CreateUserWizard1.UserName, true);

# re: Web Profile Builder for Web Application Projects

Thursday, May 1, 2008 5:16 PM by pshaffer

Liked the tool very much.  However, there is a bug in v1.2.

When you optimized the WebProfile.Current property, you made it into a singleton.  This means that the first user profile accessed via this property is now used by every request until the workspace is recycled in IIS.  I've entered a bug issue on it.

Great work on the whole thing.  We all appreciate it very much.

# re: Web Profile Builder for Web Application Projects

Thursday, May 15, 2008 12:20 PM by simon

I get the following error when i try to build

Error 1 The "BuildWebProfile" task failed unexpectedly.

System.ArgumentNullException: String reference not set to an instance of a String.

Parameter name: s

  at System.Text.Encoding.GetBytes(String s)

  at WebProfileBuilder.Builder.IsProfileSame()

  at WebProfileBuilder.Builder.GenerateWebProfile(BuildWebProfile buildWebProfile)

  at WebProfileBuilder.BuildWebProfile.Execute()

  at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) Web

Cheers,

Simon

# re: Web Profile Builder for Web Application Projects

Friday, May 16, 2008 2:17 PM by Valentin

Hi,

I got the same error

Thanks,

Val

# re: Web Profile Builder for Web Application Projects

Tuesday, May 27, 2008 5:38 PM by Kurt

This rocks!  Thanks a ton!

# re: Web Profile Builder for Web Application Projects

Wednesday, May 28, 2008 10:09 AM by Tony

Simon,

You error is generally casued by the profile section not being declared with in the web.config.

I get the following error when i try to build

Error 1 The "BuildWebProfile" task failed unexpectedly.

System.ArgumentNullException: String reference not set to an instance of a String.

Parameter name: s

 at System.Text.Encoding.GetBytes(String s)

 at WebProfileBuilder.Builder.IsProfileSame()

 at WebProfileBuilder.Builder.GenerateWebProfile(BuildWebProfile buildWebProfile)

 at WebProfileBuilder.BuildWebProfile.Execute()

 at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) Web

Cheers,

Simon

# re: Web Profile Builder for Web Application Projects

Tuesday, July 8, 2008 10:35 PM by Vanja

Hey,

Great tool! Took me some time to finally get it working with my system but its runs really well now.

Only qualm I have with this is that it sometimes fails silently - build will succeed but the profile won't be regenerated. This happened to me when I had a "serializeas" tag in one of my profile parameters (instead of "serializeAs").

Thanks again for the great tool!

Vanja.

Ps. It would be incredibly useful if you could add support for nested type specifiers though. For some reason the code generator does not like something like "List`1[ KeyValuePair`2[Int, Int] ]"

# re: Web Profile Builder for Web Application Projects

Wednesday, August 6, 2008 12:22 PM by helpin out

I figured out the problem of when you get the rror 101 The "BuildWebProfile" task failed unexpectedly error.

You need to have this line in your web.config:

<profile configSource="ProfileSection.config"/>

And you need to have the ProfileSection.config file in your project.  You can find it in the sample application.

# re: Web Profile Builder for Web Application Projects

Friday, August 8, 2008 2:06 PM by wookie

I only just stumbled upon this problem now as I have traditionally stayed away from the Profile object in asp.net 2.0 because it is a bit "twitchy". Very nice little tool and did the job as expected first time.

# re: Web Profile Builder for Web Application Projects

Monday, August 11, 2008 1:58 PM by Sean Mackey

The Extended Usage steps above strictly use version 1.0.0.0 in the web.config markup. I only have the latest 1.3.0.0 version so the WebProfileBuilder assembly was not found in the GAC.

You should add a note to update the web.config markup to the correct version.

This is the solution to the issue barnchick posted July 17, 2008 2:58 PM.

# re: Web Profile Builder for Web Application Projects

Tuesday, August 12, 2008 2:37 AM by ReenaCutie

I installed vs2005, got the following error

The "Message" task could not be loaded from the assembly Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Could not load file or assembly 'Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.

Can anybody help?

# re: Web Profile Builder for Web Application Projects

Tuesday, September 2, 2008 2:54 PM by Matt

I am unable to save the profile information.  It says it saves but it never shows up in the DB.

Membership.CreateUser(this.txtUserName.Text, this.txtPassword.Text, this.txtEmail.Text);

               setMessage("User added", false);

               //Profile prof = .Create(this.txtUserName.Text);

               MyWebProfile p = MyWebProfile.GetProfile(this.txtUserName.Text,true);

               p.ClientID = ddlClients.SelectedValue;

               p.Save();

# re: Web Profile Builder for Web Application Projects

Tuesday, September 2, 2008 3:42 PM by Matt

Everything appears to be correct.  The database connection is correct and the class is being generated properly.  There are no compile time errors and no run time errors.  The record is just not being written.

Could this be related to Ajax?

# re: Web Profile Builder for Web Application Projects

Tuesday, September 2, 2008 3:48 PM by Matt

I removed all Ajax code so that is not causing the problem.

# re: Web Profile Builder for Web Application Projects

Tuesday, September 9, 2008 10:51 AM by Krisztian

Hi Matt!

Did you solve your problem? I have the same.

Thanks, Krisztian

# re: Web Profile Builder for Web Application Projects

Sunday, October 5, 2008 11:54 AM by Steve

I was using the old addin for VS2005 - thank god you've done something for VS2008 as I use the Membership API a lot and in particular user profiles. Nice one matey.

# re: Web Profile Builder for Web Application Projects

Friday, October 10, 2008 1:21 PM by Sreeni

Added the Import tag to project file. i am using to build a FBA user management  with some custom properties. any help of how to use?

# re: Web Profile Builder for Web Application Projects

Thursday, October 30, 2008 8:30 AM by C

I don't have a csproj file for my web app, presumably because it's from HTTP rather than filesystem.

# re: Web Profile Builder for Web Application Projects

Thursday, December 4, 2008 10:51 AM by Ruben

Awesome!  Had it up and running in a custom directory and namespace in 5 minutes.  Thanks!

# re: Web Profile Builder for Web Application Projects

Tuesday, December 23, 2008 12:31 AM by apostle

getting this message. everything builds fine.

Could not find schema information for the element 'robo.webProfile'.

any ideas?

# re: Web Profile Builder for Web Application Projects

Monday, December 29, 2008 2:12 PM by Luiz Antonio - Brasil

How do I save, I do not think that the class ProfileCommon as I save this method since error happens on the line and marked as I solve this error

I'm using VS2005 Pro Edition and WebProfileBuilder 1.3.0.0

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using CustomNameSpace;

using System.Web.Profile;

namespace MeuWebProfile

{

   public partial class Novo : System.Web.UI.Page

   {

       protected void Page_Load(object sender, EventArgs e)

       {

       }

       protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)

       {

           //Pesquisa/Recupera dados dos IDs de Controles do CreateUserWizard

           CheckBox chk = (CheckBox)CreateUserWizard1.FindControl("chkCrianca");

           TextBox txtTel = (TextBox)CreateUserWizard1.FindControl("txtTel");

           TextBox txtEnd = (TextBox)CreateUserWizard1.FindControl("txtEnd");

           //Cria o Profile baseado na Class MyWebProfile do WebProfileBuilder

           MyWebProfile prof = MyWebProfile.Create(CreateUserWizard1.UserName);//The error appears in this line

           //Repassa os dados inseridos nos controles

           //para as propriedades(campos) dos perfis

           //do profile criado

           prof.Crianca = chk.Checked;

           prof.Endereco = txtEnd.Text;

           prof.Telefone = txtTel.Text;

           //chama o método Save para salvar

           //os perfis de meu usuário na Base

           //AspNetDb ou do ProfileProvider criada

           prof.Save();

       }

       public static MyWebProfile Profile

       {

           //get { return new MyWebProfile(HttpContext.Current.Profile); }

           get { return MyWebProfile.Current; }

       }

   }

}

# re: Web Profile Builder for Web Application Projects

Friday, January 2, 2009 11:33 AM by grrrrrrr

How do you get this to work with the default profile or do you HAVE to create a custom profile class and then define every property in the class? I followed all the instructions and am still getting "[Property] is not a member of 'Profile'" errors every time I access my profile. It would really suck if I have to go and make a whole new class that defines all of my properties (again - they are in the web.config file). Please advise.

Thanks!

# re: Web Profile Builder for Web Application Projects

Saturday, January 17, 2009 1:25 AM by Mehdi

Hi,

Thanks , I using your solution it . but I have a problem.

I put profile update on sign up page and will update profile every time user loggined.

The problem is profile information just after 2 times update, can be used on other page( after first login , all profile information was empty and when I re-try and login again profiles retun correct value) what is wrong?

Thanks

# re: Web Profile Builder for Web Application Projects

Friday, January 23, 2009 4:42 PM by Luiz Antonio - Brazil (Country)

Hello researching and testing the blog via WebProfileGenerator1.3 by Visual Studio 2005 and below could save the custom profile

protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)

       {

           //Pesquisa/Recupera dados dos IDs de Controles do CreateUserWizard

           CheckBox chk = (CheckBox)CreateUserWizard1.FindControl("chkCrianca");

           TextBox txtTel = (TextBox)CreateUserWizard1.FindControl("txtTel");

           TextBox txtEnd = (TextBox)CreateUserWizard1.FindControl("txtEnd");

           //Cria o Profile baseado na Class MyWebProfile do WebProfileGenerator3.1

           string username;

           username = CreateUserWizard1.UserName;

           //Maneira Errada com o WebProfileGenerator

           //WebProfile prof = WebProfile.Create(username);

           //Maneira Correta com o WebProfile Generator

           WebProfile prof = new WebProfile().GetProfile(username);

           //Repassa os dados inseridos nos controles

           //para as propriedades(campos) dos perfis

           //do profile criado

           prof.Crianca = chk.Checked;

           prof.Endereco = txtEnd.Text;

           prof.Telefone = txtTel.Text;

           //chama o método Save para salvar

           //os perfis de meu usuário na Base

           //AspNetDb ou do ProfileProvider criada

           prof.Save();

       }

       private WebProfile Profile

       {

           get { return new WebProfile(Context.Profile); }

       }

but as I understand it by WebProfileGenerator can only be used in VisualStudio2005 and not in VisualStudio2008, how it would be the same code or using the above action with the webprofilebuilder 1.3.0.0 that at least in reading is recognized in Visual Studio but the rescue the profiles do not yet have not found the method. getprofile as in the example above using the WebProfileGenerator above, as I could finally reap the same result but the above code with the WebProfileBuilder 1.3.0.0 what I have to add or modify the code to be accepted the rescue

I look at now and I thank

Translated from Portuguese into English by Google

# re: Web Profile Builder for Web Application Projects

Tuesday, January 27, 2009 2:48 AM by Mark Jones

For anyone else having trouble with Team Build try this:

<Target Name="BeforeCompile">

   <Exec WorkingDirectory="$(SolutionRoot)" Command="$(TF) checkout  /noprompt $(BuildProjectFolderPath)/../../<project name>//WebProfileBuilder.user"/>

</Target>

<Target Name="AfterCompile">

   <Exec WorkingDirectory="$(SolutionRoot)" Command="$(TF) undo /noprompt  $(BuildProjectFolderPath)/../../<project name>/WebProfileBuilder.user"/>

</Target>

Add this to the TFSBuild.proj file in Source Control Explorer. Make sure you replace <project name> with the correct path to your project.

# re: Web Profile Builder for Web Application Projects

Tuesday, March 24, 2009 11:30 AM by Katherine Labbe

Hi,

I'm new in Web Application and I don't seems to get it right.  I have this build error :

"BuildWebProfile" task failed unexpectedly.

System.ArgumentNullException: String reference not set to an instance of a String.

Parameter name: s

  at System.Text.Encoding.GetBytes(String s)

  at WebProfileBuilder.Builder.IsProfileSame()

  at WebProfileBuilder.Builder.GenerateWebProfile(BuildWebProfile buildWebProfile)

  at WebProfileBuilder.BuildWebProfile.Execute()

  at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) WebPO

Thanks !

# re: Web Profile Builder for Web Application Projects

Thursday, April 16, 2009 11:30 AM by Jason

For those of you having trouble with Mark's team build directions, you will need to add:

<TF>&quot;$(TeamBuildRefPath)\..\tf.exe&quot;</TF>

to your PropertyGroup so that it can evaluate $(TF) properly.

# re: Web Profile Builder for Web Application Projects

Thursday, April 16, 2009 12:10 PM by Jason

Another thing for people using Team Build.

I found that doing a local build became a problem when the WebProfileBuilder.user file was locked due to it being under source control. I would get an error saying that the BuildWebProfile task could not access the file.

I fixed this by adding

<Exec Command="attrib -r &quot;$(ProjectDir)\WebProfileBuilder.user&quot;"/> before the <BuildWebProfile> node in Program Files/MSBuild/WebProfileBuilder/WebProfileBuilder.targets.

I also added <Exec Command="attrib +r &quot;$(ProjectDir)\WebProfileBuilder.user&quot;"/> after the BuildWebProfile node to set the file to readonly again.

I found that before I fixed this my project could not resolve any references also. So if you have that problem this may help you.

# re: Web Profile Builder for Web Application Projects

Thursday, April 16, 2009 9:54 PM by Nuno

Everything works fine when testing in VS.net 2005 web server but when I deploy it to IIS 5.1 the data doesn't get saved and no errors occur. I checked the event view and don't see anything there either.

Nuno

# re: Web Profile Builder for Web Application Projects

Saturday, April 18, 2009 4:34 PM by Matt

You need to give an example of your explaination.

This is not good when all these people leave comments.

It is poor, sadly to say.

# re: Web Profile Builder for Web Application Projects

Sunday, April 19, 2009 12:38 AM by Cord Thomas

This is very helpful.  I also had the IO.FileSystem error and it was the version number.  Great resource.

# re: Web Profile Builder for Web Application Projects

Tuesday, April 21, 2009 1:58 PM by nunop

I have this at the top of my page:

   private WebProfile Profile

       {

           get { return new WebProfile(Context.Profile); }

       }

and in the ItemCommand event of my gridview I have a switch statement with this:

          case "AddToCart":

                   {

                       ShoppingCartItem newItem = DataLayer.GetProducts(Convert.ToInt32(e.CommandArgument));

                       Profile.ShoppingCart.AddItem(newItem);

                       break;

                   }

The cart saved succesfully when debugging in VS.net 2005 Web Server but when deployed to IIS the items don't get saved.

# re: Web Profile Builder for Web Application Projects

Friday, May 1, 2009 1:12 AM by Sayitfast

This is great!  Worked like a charm... The examples on the download page were very helpful.

# re: Web Profile Builder for Web Application Projects

Tuesday, May 12, 2009 10:31 PM by James

Got a problem.  HttpContext.Current.Profile is not being set by Login.aspx (asp:Login) with a valid user.  Remains the anonymous initial setting with the UserName as a guid.

Got any ideas?

# re: Web Profile Builder for Web Application Projects

Wednesday, June 17, 2009 5:41 AM by W Khattak

Hi,

Quite useful if using default provider. Just wanted to know if it works with custom providers or not?

thanks,

# re: Web Profile Builder for Web Application Projects

Wednesday, June 17, 2009 2:16 PM by Alex P.

Anyone else having problems getting this going make sure that version is 1.3.0.0 in the config section, as opposed to 1.0.0.0 as in the example here.

# re: Web Profile Builder for Web Application Projects

Monday, July 13, 2009 5:26 PM by Richard

"1.3.0.0"

Fantastic!!

Thank you so much!

Everything works fine with PostgreSQL provider!!

# re: Web Profile Builder for Web Application Projects

Friday, July 17, 2009 11:23 AM by Stylesie

You Saved my bacon dude.

I cannot believe that Microsoft did not fix this bug with VS 2008.

Thanks for keeping the project alive.

# re: Web Profile Builder for Web Application Projects

Wednesday, July 22, 2009 9:27 AM by symacord

Wow! after many weeks of struggle, I finally found solution.

Thanks Joe.

# re: Web Profile Builder for Web Application Projects

Tuesday, August 4, 2009 10:06 PM by sonna

I have error:

Error 1 The "BuildWebProfile" task failed unexpectedly.

System.ArgumentNullException: String reference not set to an instance of a String.

Parameter name: s

  at System.Text.Encoding.GetBytes(String s)

  at WebProfileBuilder.Builder.IsProfileSame()

  at WebProfileBuilder.Builder.GenerateWebProfile(BuildWebProfile buildWebProfile)

  at WebProfileBuilder.BuildWebProfile.Execute()

  at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) DTech.BussinessLogic

# re: Web Profile Builder for Web Application Projects

Sunday, August 23, 2009 7:20 AM by max

Hi, can I modify my project file (.csproj), if no .csproj being generated by asp.net web application??

thanx in advance

# re: Web Profile Builder for Web Application Projects

Tuesday, August 25, 2009 9:43 PM by techron

Thanks man. Pingback with my own instructions on my first try with this. Take a look max, I tried to explain that the csproj file may have its extension hidden. And just in case there was a misunderstanding, this is with a Web Application Project.

# re: Web Profile Builder for Web Application Projects

Tuesday, September 8, 2009 1:08 PM by livercool

Brillant stuff mate :)

# re: Web Profile Builder for Web Application Projects

Tuesday, September 8, 2009 2:03 PM by Mike

Good one. I had to use the config settings for it to work with ASP.Net mvc but it works great.

# re: Web Profile Builder for Web Application Projects

Friday, September 11, 2009 8:26 PM by Arley

Does this work with Visual WebGUI projects? I have tried it but not class is generated on the build.

# re: Web Profile Builder for Web Application Projects

Monday, September 21, 2009 12:36 PM by Keith

Awesome tool.  The only thing you might want to mention is that the WebProfile class file is generated into the root of the project by default, and that you will need to add the file into your project.  This may have been obvious, but I thought I would mention it.

# re: Web Profile Builder for Web Application Projects

Wednesday, October 14, 2009 7:05 AM by Jaco

Awesome tool. One problem. I have set up everything and it works well via vs2008 ide. But as soon as i publish to iis i get the folowing error.

The settings property 'ShoppingCart' was not found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.SettingsPropertyNotFoundException: The settings property 'ShoppingCart' was not found.

Source Error:

Line 127:        

Line 128:        public virtual object GetPropertyValue(string propertyName) {

Line 129:            return this._profileBase.GetPropertyValue(propertyName);

Line 130:        }

Line 131:        

Source File: D:\Development\Work\IconManiacs\IconManiacs\IconManiacs\WebProfile.cs    Line: 129

It works fine via the IDE

# re: Web Profile Builder for Web Application Projects

Monday, December 14, 2009 10:15 AM by Camcorder Reviews

Really annoying that Microsoft did not fix this themselves, but thanks for an awesome tool, it cost me several extra hours unfortunately.

# re: Web Profile Builder for Web Application Projects

Wednesday, December 30, 2009 10:56 AM by Stieven

Where to put the line mentioned in step2:

<Import Project="$(MSBuildExtensionsPath)\WebProfileBuilder\WebProfileBuilder.targets" />

In what file? web.config?

Thx!!

# re: Web Profile Builder for Web Application Projects

Monday, January 11, 2010 1:59 PM by Raul Juarez

I was able to create a user, recover password by email, and login. I would like to integrate this with my application basically I would like to be able to retrive UserID and use into my other aspx pages, wouls some one point me to the right direccion.?

Thanks

# re: Web Profile Builder for Web Application Projects

Tuesday, March 9, 2010 4:00 PM by Greger Olofsson

This is awesome. Thanks!

# re: Web Profile Builder for Web Application Projects

Monday, April 26, 2010 1:16 PM by Mohamed Hachem

Hello

I had same problem. I was using info path and I had forgotten to include security files to the project solution.

if you do so and still have the access denied,  the reason would surely be the Manifest.xsf

it is set to read-only hence the solution  can't change it when it builds put it in check out mode and build solution all should be fine.

Cheers

# re: Web Profile Builder for Web Application Projects

Sunday, May 2, 2010 2:49 PM by kunal

Hi !

I am using Visual Studio 2008 Team Edition with SP1.

I add the <import> tag as said above to "myProj.csproj", but when I open the project I am getting the following error

Unable to read the project file 'myProject.csproj'

D:\Projects\myProject\myProject.csproj(78,13): The imported project "C:Program Files\MSBuild\WebProfileBuilder\WebProfileBuilder.targets' was not found. Confirm that the path in the <import> declaration is correct, and that that file exists on disk.

After installing the WebProfileGenerator.msi file I tried searching  my  C: drive for .target files but I was not able to find "WebProfileBuilder.targets".

Could you please help me overcome this issue ?

Thanks

Kunal

# re: Web Profile Builder for Web Application Projects

Tuesday, June 1, 2010 8:58 AM by Radek

Could you clarify on where actually I should put

<Import Project="$(MSBuildExtensionsPath)... tag?

I followed your instructions, and Profile class in not

generated at all.

Are there any other steps to be taken in order this code

to work?

PS. I assumed, since you used "add" word, that the <import> tag should be at the end of the file just before </Project>

closing tag.

# re: Web Profile Builder for Web Application Projects

Sunday, June 6, 2010 2:57 AM by afshar

@Wroble:

I'm using VS2010 x64 on a MS Windows 2008 R2, x64 and WebProfile worked for me, thanks!

@LockTar:

thanks,

Your solution worked for me.

# re: Web Profile Builder for Web Application Projects

Wednesday, June 30, 2010 2:14 PM by Scott

I've been using your profile builder for quite a while, and it's been great!

I've recently started using it with VS 2010 and .NET 4.0 and I'm running into a strange problem.  Everything appears to be working correctly, but WebProfile.Current always returns the value of the first person logged into the site since the last reload of the web app in IIS.

This happens on a Windows 2008 server with IIS7 as well as on my Windows 7 workstation using the VS built-in web server.

Any ideas on this?

Thanks,

Scott

# re: Web Profile Builder for Web Application Projects

Sunday, July 4, 2010 6:21 AM by Terry

I'am sorry i don't know where to put the <Import Project="..>,who can help me?

# re: Web Profile Builder for Web Application Projects

Monday, July 5, 2010 8:57 PM by muybn

I'm with Terry. In which file do you actually put the ubiquitous <Import Project="..> ?

# re: Web Profile Builder for Web Application Projects

Friday, August 20, 2010 9:27 AM by KenHull

Hi Joe, thanks for all your work on this however,  I still have a problem.

After carefully following instructions I have the WebProfile.cs in place but I still get     "Error 4 The name 'Profile' does not exist in the current context "  for code like this:

"Firstname.Text = Profile.Firstname;"  

I guess the namespace is wrong but, being a relative amateur, I don't know what is should be.  Something like

Firstname.Text = MyProfile.Firstname;  ???

Ken

# re: Web Profile Builder for Web Application Projects

Thursday, September 30, 2010 9:33 AM by Charlie

In my situation using VS2010, after building the project the webprofile.vb class was not automatically included in the solution.  I had to show all files on the project, right click the webprofile.vb file and select include in project.  After this I was able to access the props and methods of the webprofile class.  This step seems to be missing from the instructions or is an issue related to vs2010.  I don't receive the "load project Normally" dialog.

# re: Web Profile Builder for Web Application Projects

Tuesday, December 7, 2010 6:19 PM by vbird2k

I downloaded the setup file, installed it, modified the project file, selected "Load project normally".

However, I still got the same error.

Any ideas? Thanks a lot!

BTW, I am using vs2008, asp.net 3.5

# re: Web Profile Builder for Web Application Projects

Friday, December 10, 2010 6:10 PM by gknierim

Has anyone got this to work with VS2010 c#?  I've installed the WebProfile Builder, added my properties to the web.config.  Did a build on the project.  No WebProfile.cs file.  What am I missing?  Someone who has think working could you help me out?

# re: Web Profile Builder for Web Application Projects

Thursday, November 17, 2011 8:31 AM by CraPo

Never mind, I'd overlooked specifying the Provider Proprties in the web.config!

# re: Web Profile Builder for Web Application Projects

Monday, December 19, 2011 12:34 PM by kingRauk

www.kps-fl.com/blog

Explains it pretty well, how the installation works in VS 2010.

Just put the <import ... just over </project>

# re: Web Profile Builder for Web Application Projects

Wednesday, December 12, 2012 11:19 AM by Gabriele Mezzetti

Hi joe,

we are upgrading our project to Visual Studio 2012. It seems that Web Profile Builder doesn't work in VS 2012, is it correct? Will there be an upgrade for Web Profile Builder to VS 2012?

Best Regards

# re: Web Profile Builder for Web Application Projects

Wednesday, April 10, 2013 9:19 AM by White

Great blog here! Also your site loads up very fast! What web host are you using?

Can I get your affiliate link to your host? I wish my website loaded

up as quickly as yours lol

# re: Web Profile Builder for Web Application Projects

Friday, January 24, 2014 2:35 AM by Macrossan

It's hard to find knowledgeable people about this topic,

however, you sound like you know what you're talking about!

Thanks

# re: Web Profile Builder for Web Application Projects

Wednesday, February 12, 2014 3:29 PM by Woodbury

Wow! In the end I got a web site from where I know how to truly

get valuable data regarding my study and knowledge.

Leave a Comment

(required) 
(required) 
(optional)
(required)