Well, I found a solution that appears to work. I haven't tested this in a production application so this is a 'use at your own risk' thing.
What I'm using is WebProfileBuilder
To get it working, you'll want to download and install the .msi file from the link above. When that's installed, do the following.
1) Start a new Web Application. (Example: WebApplication1) When created, close Visual Studio.
2) Go to your application path and open the WebApplication1 Visual Basic Project file
in Notepad. (The guide on the link above is going to tell you to do some unloading and crap to open the file, but in VS2008 Professional, this wasn't an option for me.)
3) Do a find on Import Project="$
4) Add the following to the Import Project
<Import Project="$(MSBuildExtensionsPath)\WebProfileBuilder\WebProfileBuilder.targets" />
5) Save the file.
6) Open Visual Studio 2008 and reload your project. There will be a dialog box that is popped up. Select Load Project Normally
and hit OK
...Half way there! Now we need to create the class and load it manually.
7) In your Solution Explorer, hit the Show All Files
button at the top.
8) Press the Refresh
...Now you should see two files in the root of your application: WebProfile.vb
9) Right-click WebProfile.vb
and select Include in Project
Now, jump into your web.config and add the following in <configSections>
<section name="webProfileSettings" type="WebProfileBuilder.WebProfileConfigurationSection, WebProfileBuilder, Version=126.96.36.199, Culture=neutral, PublicKeyToken=01d50f1f82943b0c" allowLocation="true" allowDefinition="Everywhere"/>
Note: This will be it's own SectionGroup.
Lastly, if you want to modify the settings of the class that is created, drop the following block in the web.config - somewhere as a child of <configuration>
, but after the <sectionGroup>
you previously added.
Note: This is just for personalizing the class. Not all the attributes are needed, either. If you only want to change the directory then just add that attribute.
Now, when you do your normal manipulation to the <Profile>
section of your web.config, you'll notice that the class will rebuild itself to include a property for that personalization profile property.
To get the Intellisense to work on your .aspx page, you'll need to add a property on the page to get the class object.
Partial Public Class _Default
Public ReadOnly Property Profile() As WebApplication1.WebProfile
Return New WebApplication1.WebProfile(HttpContext.Current.Profile)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Now we can use intellisense
Profile.Whatever = "Something"
Hope this helps. Reply back if you're confused.
(Credit to robolize
for creating this method.)