Web Profile Builder 2.0.0.0
It's been over five years since I've made any updates to this project. I had basically
left it for dead because I personally no longer have a need for it. I know a lot of
people do still rely on it though. I had some free time recently so I decided to give
the project a little bump to make it easier to use and more accessible to those who do
still use it.
What's changed?
- Most importantly, this is no longer required to be installed in the GAC.
- There is no installer at all anymore!
- Now it can be included in the project source control and referenced
locally.
- Added support to install using NuGet.
- PM> Install-Package WebProfileBuilder
- Simplified the configuration.
- Support for configuration via Web.config has been removed. This was
more of a "nice to have" feature and added unneeded complexity to
the code base. - All configurable options are still supported, but now it has to be
configured in the web project file. See below for a complete
example of the configuration.
- Support for configuration via Web.config has been removed. This was
- Moved project home to CodePlex.
- Added build automation to the source code using NAnt.
IMPORTANT NOTES:
- The core code base has not been changed. I didn't want to introduce any bugs, so
I only changed the code necessary to achieve my goal. All code changes were
related to configuration. - If you are new to WebProfileBuilder, know the following:
- The generated profile class does not get automatically included into the
project. You must use the Solution Explorer to show all files, then
manually include the generated class into your project. You only
need to do this once. - You also must create the "Profile" property in your Page class. See
below for an example.
- The generated profile class does not get automatically included into the
Example web project file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ... other project content ... -->
<!--WebProfileBuilder setup.-->
<UsingTask TaskName="BuildWebProfile"
AssemblyFile="..\packages\WebProfileBuilder.2.0.0.0\tools\
WebProfileBuilder.dll" />
<Target Name="BeforeBuild">
<!--WebSiteRoot, RootNamespace, and Language are required.-->
<!--ClassName, Directory, and FileName are optional for additional customization.-->
<BuildWebProfile WebSiteRoot="$(ProjectDir)"
RootNamespace="$(RootNamespace)"
Language="$(Language)"
ClassName="MyWebProfile"
Directory="CodeFiles"
FileName="MyWebProfile" />
</Target>
<!-- ... other project content ... -->
</Project>
Example page class:
using System;
using System.Collections.Generic;
using System.Web.UI;
namespace CsExample {
public partial class _Default : Page {
//... other class content ...
public static MyWebProfile Profile {
get { return MyWebProfile.Current; }
}
//... other class content ...
}
}