<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Joshua Flanagan - ProfileView</title>
    <link>http://flimflan.com/blog/</link>
    <description>A .NET Software Developer</description>
    <language>en-us</language>
    <copyright>josh</copyright>
    <lastBuildDate>Sat, 24 Jun 2006 16:47:41 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8209.14743</generator>
    <managingEditor>josh@flimflan.com</managingEditor>
    <webMaster>josh@flimflan.com</webMaster>
    <item>
      <trackback:ping>http://flimflan.com/blog/Trackback.aspx?guid=f7354ebb-9d2f-43a4-8b5d-4795e3046f4c</trackback:ping>
      <pingback:server>http://flimflan.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://flimflan.com/blog/PermaLink,guid,f7354ebb-9d2f-43a4-8b5d-4795e3046f4c.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://flimflan.com/blog/CommentView,guid,f7354ebb-9d2f-43a4-8b5d-4795e3046f4c.aspx</wfw:comment>
      <wfw:commentRss>http://flimflan.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f7354ebb-9d2f-43a4-8b5d-4795e3046f4c</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">By far, the most common feature request
for my <a href="http://flimflan.com/blog/ProfileView.aspx">ProfileView</a> control
was the ability to edit the profile of any user in the system. Until now, the control
could only be used by the current user to edit their own profile. I thought it was
a limitation of the Profile provider framework, until I discovered ProfileBase.Create().
I apologize to everyone that has been waiting for this much needed feature for so
long.<br /><br />
Just set the UserName property on the control to edit a different user. The property
is null by default, which loads the current user.<br /><br />
Example usage in a WebForm used to edit a profile:<br /><br /><!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20     \cf2 protected\cf0  \cf2 void\cf0  Page_Load(\cf2 object\cf0  sender, \cf10 EventArgs\cf0  e)\par ??    \{\par ??        \cf2 if\cf0  (!Page.IsPostBack)\par ??        \{\par ??            \cf2 string\cf0  userName = Request.QueryString[\cf13 "username"\cf0 ];\par ??            \cf2 if\cf0  (!\cf10 String\cf0 .IsNullOrEmpty(userName))\par ??            \{\par ??                ProfileView1.UserName = userName;\par ??            \}\par ??        \}\par ??    \}}
--><div style="background: white none repeat scroll 0%; font-family: Consolas; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><p style="margin: 0px;">
    <span style="color: blue;">protected</span><span style="color: blue;">void</span> Page_Load(<span style="color: blue;">object</span> sender, <span style="color: teal;">EventArgs</span> e)
</p><p style="margin: 0px;">
    {
</p><p style="margin: 0px;">
        <span style="color: blue;">if</span> (!Page.IsPostBack)
</p><p style="margin: 0px;">
        {
</p><p style="margin: 0px;">
            <span style="color: blue;">string</span> userName
= Request.QueryString[<span style="color: maroon;">"username"</span>];
</p><p style="margin: 0px;">
            <span style="color: blue;">if</span> (!<span style="color: teal;">String</span>.IsNullOrEmpty(userName))
</p><p style="margin: 0px;">
            {
</p><p style="margin: 0px;">
                ProfileView1.UserName = userName;
</p><p style="margin: 0px;">
            }
</p><p style="margin: 0px;">
        }
</p><p style="margin: 0px;">
    }
</p></div><br /><br />
Download the latest code from the <a href="http://flimflan.com/blog/ProfileView.aspx">ProfileView</a> project
page.<img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=f7354ebb-9d2f-43a4-8b5d-4795e3046f4c" /></body>
      <title>ProfileView can now be used for user administration</title>
      <guid isPermaLink="false">http://flimflan.com/blog/PermaLink,guid,f7354ebb-9d2f-43a4-8b5d-4795e3046f4c.aspx</guid>
      <link>http://flimflan.com/blog/ProfileViewCanNowBeUsedForUserAdministration.aspx</link>
      <pubDate>Sat, 24 Jun 2006 16:47:41 GMT</pubDate>
      <description>By far, the most common feature request for my &lt;a href="http://flimflan.com/blog/ProfileView.aspx"&gt;ProfileView&lt;/a&gt; control
was the ability to edit the profile of any user in the system. Until now, the control
could only be used by the current user to edit their own profile. I thought it was
a limitation of the Profile provider framework, until I discovered ProfileBase.Create().
I apologize to everyone that has been waiting for this much needed feature for so
long.&lt;br /&gt;
&lt;br /&gt;
Just set the UserName property on the control to edit a different user. The property
is null by default, which loads the current user.&lt;br /&gt;
&lt;br /&gt;
Example usage in a WebForm used to edit a profile:&lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0??;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;??\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;??\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;??\red192\green192\blue192;}??\fs20     \cf2 protected\cf0  \cf2 void\cf0  Page_Load(\cf2 object\cf0  sender, \cf10 EventArgs\cf0  e)\par ??    \{\par ??        \cf2 if\cf0  (!Page.IsPostBack)\par ??        \{\par ??            \cf2 string\cf0  userName = Request.QueryString[\cf13 "username"\cf0 ];\par ??            \cf2 if\cf0  (!\cf10 String\cf0 .IsNullOrEmpty(userName))\par ??            \{\par ??                ProfileView1.UserName = userName;\par ??            \}\par ??        \}\par ??    \}}
--&gt;
&lt;div style="background: white none repeat scroll 0%; font-family: Consolas; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: teal;"&gt;EventArgs&lt;/span&gt; e)
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!Page.IsPostBack)
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; userName
= Request.QueryString[&lt;span style="color: maroon;"&gt;&amp;quot;username&amp;quot;&lt;/span&gt;];
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!&lt;span style="color: teal;"&gt;String&lt;/span&gt;.IsNullOrEmpty(userName))
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ProfileView1.UserName = userName;
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;
&amp;nbsp; &amp;nbsp; }
&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Download the latest code from the &lt;a href="http://flimflan.com/blog/ProfileView.aspx"&gt;ProfileView&lt;/a&gt; project
page.&lt;img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=f7354ebb-9d2f-43a4-8b5d-4795e3046f4c" /&gt;</description>
      <comments>http://flimflan.com/blog/CommentView,guid,f7354ebb-9d2f-43a4-8b5d-4795e3046f4c.aspx</comments>
      <category>.NET</category>
      <category>ProfileView</category>
    </item>
    <item>
      <trackback:ping>http://flimflan.com/blog/Trackback.aspx?guid=7a21f40a-7b66-4fd7-8188-21271749e5c7</trackback:ping>
      <pingback:server>http://flimflan.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://flimflan.com/blog/PermaLink,guid,7a21f40a-7b66-4fd7-8188-21271749e5c7.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://flimflan.com/blog/CommentView,guid,7a21f40a-7b66-4fd7-8188-21271749e5c7.aspx</wfw:comment>
      <wfw:commentRss>http://flimflan.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7a21f40a-7b66-4fd7-8188-21271749e5c7</wfw:commentRss>
      <slash:comments>7</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I've posted the source and binary for the
latest release of my <a href="http://flimflan.com/blog/ProfileView.aspx">ProfileView
ASP.NET server control</a>. I was finally able to address the much requested fix to
make the order of the properties displayed at runtime reflect the order they are declared
in the web.config. Here are the release notes:<br /><ul><li>
Properties now display in the order they are listed in web.config<br /></li><li>
Design-time view now uses same rendering method as runtime</li><li>
Fixed design-time bug that caused it to fail when a profile property type was not
specified</li><li>
Design-time view now has a Smart Tag to allow you to preview an anonymous user's profile<br /></li></ul><img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=7a21f40a-7b66-4fd7-8188-21271749e5c7" /></body>
      <title>New release of ProfileView</title>
      <guid isPermaLink="false">http://flimflan.com/blog/PermaLink,guid,7a21f40a-7b66-4fd7-8188-21271749e5c7.aspx</guid>
      <link>http://flimflan.com/blog/NewReleaseOfProfileView.aspx</link>
      <pubDate>Mon, 09 Jan 2006 02:46:49 GMT</pubDate>
      <description>I've posted the source and binary for the latest release of my &lt;a href="http://flimflan.com/blog/ProfileView.aspx"&gt;ProfileView
ASP.NET server control&lt;/a&gt;. I was finally able to address the much requested fix to
make the order of the properties displayed at runtime reflect the order they are declared
in the web.config. Here are the release notes:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Properties now display in the order they are listed in web.config&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Design-time view now uses same rendering method as runtime&lt;/li&gt;
&lt;li&gt;
Fixed design-time bug that caused it to fail when a profile property type was not
specified&lt;/li&gt;
&lt;li&gt;
Design-time view now has a Smart Tag to allow you to preview an anonymous user's profile&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=7a21f40a-7b66-4fd7-8188-21271749e5c7" /&gt;</description>
      <comments>http://flimflan.com/blog/CommentView,guid,7a21f40a-7b66-4fd7-8188-21271749e5c7.aspx</comments>
      <category>.NET</category>
      <category>ProfileView</category>
    </item>
    <item>
      <trackback:ping>http://flimflan.com/blog/Trackback.aspx?guid=0ff1619b-d1e7-4a4c-813d-16ecc677d53b</trackback:ping>
      <pingback:server>http://flimflan.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://flimflan.com/blog/PermaLink,guid,0ff1619b-d1e7-4a4c-813d-16ecc677d53b.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://flimflan.com/blog/CommentView,guid,0ff1619b-d1e7-4a4c-813d-16ecc677d53b.aspx</wfw:comment>
      <wfw:commentRss>http://flimflan.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0ff1619b-d1e7-4a4c-813d-16ecc677d53b</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
When creating a designer for an ASP.NET server control, it is often very useful to
read settings from the user's web.config file. In previous versions of the .NET Framework,
you had to <a href="http://blogs.msdn.com/mszcool/archive/2004/06/30/169793.aspx">jump
through hoops</a> to access the web.config file at design time. I was very thankful
for this solution <a href="http://flimflan.com/blog/SignificantUpdateToProfileView.aspx">when
I needed it</a>, but I'm happy to move on. The dependency on EnvDTE felt wrong, and
the fact that it used COM interop with the VS.NET IDE meant it probably would not
work with any other tool.
</p>
        <p>
Thankfully, in .NET 2.0, it is much simpler. If you want to get the full path to web.config
(useful for parsing the XML manually), it has been reduced to:
</p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <font face="Verdana" color="#003300" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Web.UI.Design;<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//...</span><br />
IWebApplication webApp <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (IWebApplication)Component.Site.GetService(<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">typeof</span>(IWebApplication)
);<br />
IProjectItem item <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> webApp.GetProjectItemFromUrl(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"~/web.config"</span>);<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span> webConfigPath <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> item.PhysicalPath;</span>
            </p>
          </font>
        </span>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="1">Note:
you will want to check for nulls and handle appropriately. The call to GetService
could return null if the design tool hosting your control does not support this service
(something other than VS.NET). And of course the call to GetProjectItemFromUrl could
fail if there is no web.config in the project.</font>
          </span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">Even
better, instead of parsing web.config yourself, you can get strongly-typed access
to the configuration using the new classes in the System.Configuration namespace.
For example, in my <a href="http://flimflan.com/blog/ProfileView.aspx">ProfileView</a> control,
I use code similar (more null checking) to the following to discover information about
the configured profile properties:</font>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <font face="Verdana" color="#003300" size="2">
            <p>
              <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
                <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Configuration;<br /><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Web.Configuration;<br /></span></span>using</span> System.Web.UI.Design;<br /></span>//...</span><br />
IWebApplication webApp <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (IWebApplication)Component.Site.GetService(<br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">typeof</span>(IWebApplication)
);<br />
Configuration config <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> webApp.OpenWebConfiguration(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">true</span>);<br />
ConfigurationSectionGroup systemWeb <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> config.GetSectionGroup(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"system.web"</span>);<br />
ProfileSection profileSection <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> (ProfileSection)systemWeb.Sections[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"profile"</span>];<br /><br /><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span> (ProfilePropertySettings
configProperty <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> profileSection.PropertySettings)<br />
{ <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//
read the settings in each configProperty }</span></span>
            </p>
          </font>
        </span>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" color="#003300" size="2">Once
you get the Configuration object as demonstrated above, reading a value out of the
appSettings section is as easy as:</font>
          </span>
        </p>
        <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          <p>
            <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">config.AppSettings.Settings[<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"maxRetries"</span>].Value</span>
          </p>
        </span>
        <img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=0ff1619b-d1e7-4a4c-813d-16ecc677d53b" />
      </body>
      <title>Accessing web.config at Design Time in .NET 2.0</title>
      <guid isPermaLink="false">http://flimflan.com/blog/PermaLink,guid,0ff1619b-d1e7-4a4c-813d-16ecc677d53b.aspx</guid>
      <link>http://flimflan.com/blog/AccessingWebconfigAtDesignTimeInNET20.aspx</link>
      <pubDate>Mon, 02 Jan 2006 18:23:51 GMT</pubDate>
      <description>&lt;p&gt;
When creating a designer for an ASP.NET server control, it is often very useful to
read settings from the user's web.config file. In previous versions of the .NET Framework,
you had to &lt;a href="http://blogs.msdn.com/mszcool/archive/2004/06/30/169793.aspx"&gt;jump
through hoops&lt;/a&gt; to access the web.config file at design time. I was very thankful
for this solution &lt;a href="http://flimflan.com/blog/SignificantUpdateToProfileView.aspx"&gt;when
I needed it&lt;/a&gt;, but I'm happy to move on. The dependency on EnvDTE felt wrong, and
the fact that it used COM interop with the VS.NET IDE meant it probably would not
work with any other tool.
&lt;/p&gt;
&lt;p&gt;
Thankfully, in .NET 2.0, it is much simpler. If you want to get the full path to web.config
(useful for parsing the XML manually), it has been reduced to:
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Web.UI.Design;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//...&lt;/span&gt;
&lt;br&gt;
IWebApplication webApp &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (IWebApplication)Component.Site.GetService(&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;typeof&lt;/span&gt;(IWebApplication)
);&lt;br&gt;
IProjectItem item &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; webApp.GetProjectItemFromUrl(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"~/web.config"&lt;/span&gt;);&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;string&lt;/span&gt; webConfigPath &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; item.PhysicalPath;&lt;/span&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=1&gt;Note:
you will want to check for nulls and handle appropriately. The call to GetService
could return null if the design tool hosting your control does not support this service
(something other than VS.NET). And of course the call to GetProjectItemFromUrl could
fail if there is no web.config in the project.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;Even
better, instead of parsing web.config yourself, you can get strongly-typed access
to the configuration using the new classes in the System.Configuration namespace.
For example, in my &lt;a href="http://flimflan.com/blog/ProfileView.aspx"&gt;ProfileView&lt;/a&gt; control,
I use code similar (more null checking) to the following to discover information about
the configured profile properties:&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Configuration;&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;using&lt;/span&gt; System.Web.Configuration;&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;using&lt;/span&gt; System.Web.UI.Design;&lt;br&gt;
&lt;/span&gt;//...&lt;/span&gt;
&lt;br&gt;
IWebApplication webApp &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (IWebApplication)Component.Site.GetService(&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;typeof&lt;/span&gt;(IWebApplication)
);&lt;br&gt;
Configuration config &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; webApp.OpenWebConfiguration(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;true&lt;/span&gt;);&lt;br&gt;
ConfigurationSectionGroup systemWeb &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; config.GetSectionGroup(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"system.web"&lt;/span&gt;);&lt;br&gt;
ProfileSection profileSection &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; (ProfileSection)systemWeb.Sections[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"profile"&lt;/span&gt;];&lt;br&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;foreach&lt;/span&gt; (ProfilePropertySettings
configProperty &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;in&lt;/span&gt; profileSection.PropertySettings)&lt;br&gt;
{ &lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//
read the settings in each configProperty }&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana color=#003300 size=2&gt;Once
you get the Configuration object as demonstrated above, reading a value out of the
appSettings section is as easy as:&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt; 
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;config.AppSettings.Settings[&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"maxRetries"&lt;/span&gt;].Value&lt;/span&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=0ff1619b-d1e7-4a4c-813d-16ecc677d53b" /&gt;</description>
      <comments>http://flimflan.com/blog/CommentView,guid,0ff1619b-d1e7-4a4c-813d-16ecc677d53b.aspx</comments>
      <category>.NET</category>
      <category>ProfileView</category>
    </item>
    <item>
      <trackback:ping>http://flimflan.com/blog/Trackback.aspx?guid=a89964f2-1443-43b1-83dc-4802d2e7eb99</trackback:ping>
      <pingback:server>http://flimflan.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://flimflan.com/blog/PermaLink,guid,a89964f2-1443-43b1-83dc-4802d2e7eb99.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://flimflan.com/blog/CommentView,guid,a89964f2-1443-43b1-83dc-4802d2e7eb99.aspx</wfw:comment>
      <wfw:commentRss>http://flimflan.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a89964f2-1443-43b1-83dc-4802d2e7eb99</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As <a href="http://flimflan.com/blog/IntroducingProfileViewForASPNET20.aspx">promised</a>,
with the recent release of Visual Studio 2005 Beta 1, I have created an updated version
of the ProfileView control.  The most noticeable new features:
</p>
        <ul>
          <li>
Much better WYSIWYG experience, as the control now renders your profile at design
time. (Eternal thanks to <a href="http://weblogs.asp.net/mszCool/archive/2004/06/30/169793.aspx">this
post</a> on accessing web.config at design-time - I searched high and low for this
information and came up empty - the newsgroups are littered with unanswered questions
on this.  I guess I got lucky that someone at TechEd Europe decided to talk about
it. <font color="#ff0000"><strong>UPDATE</strong></font>: I've found an even better
solution for <a href="http://flimflan.com/blog/AccessingWebconfigAtDesignTimeInNET20.aspx">accessing
web.config at design-time</a>.) 
</li>
          <li>
A new read-only mode that allows users to view their profile without being able to
edit it. 
</li>
          <li>
FREE SOURCE CODE</li>
        </ul>
        <p>
I've also created a new home for the ProfileView files.  Instead of creating
links to different versions in each blog post, each of my blog entries will now reference <a href="http://flimflan.com/blog/ProfileView.aspx">this
article</a>.  I will keep the article updated with all of the latest ProfileView
happenings.
</p>
        <p>
Go get <a href="http://flimflan.com/blog/ProfileView.aspx">FlimFlan.WebControls.ProfileView</a> and
tell me what you think.
</p>
        <img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=a89964f2-1443-43b1-83dc-4802d2e7eb99" />
      </body>
      <title>Significant update to ProfileView</title>
      <guid isPermaLink="false">http://flimflan.com/blog/PermaLink,guid,a89964f2-1443-43b1-83dc-4802d2e7eb99.aspx</guid>
      <link>http://flimflan.com/blog/SignificantUpdateToProfileView.aspx</link>
      <pubDate>Thu, 08 Jul 2004 01:07:00 GMT</pubDate>
      <description>&lt;p&gt;
As &lt;a href="http://flimflan.com/blog/IntroducingProfileViewForASPNET20.aspx"&gt;promised&lt;/a&gt;,
with the recent release of Visual Studio 2005 Beta 1, I have created an updated version
of the ProfileView control.&amp;nbsp; The most noticeable new features:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Much better WYSIWYG experience, as the control now renders your profile at design
time. (Eternal thanks to &lt;a href="http://weblogs.asp.net/mszCool/archive/2004/06/30/169793.aspx"&gt;this
post&lt;/a&gt; on accessing web.config at design-time - I searched high and low for this
information and came up empty - the newsgroups are littered with unanswered questions
on this.&amp;nbsp; I guess I got lucky that someone at TechEd Europe decided to talk about
it. &lt;font color=#ff0000&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/font&gt;: I've found an even better
solution for &lt;a href="http://flimflan.com/blog/AccessingWebconfigAtDesignTimeInNET20.aspx"&gt;accessing
web.config at design-time&lt;/a&gt;.) 
&lt;li&gt;
A new read-only mode that allows users to view their profile without being able to
edit it. 
&lt;li&gt;
FREE SOURCE CODE&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I've also created a new home for the ProfileView files.&amp;nbsp; Instead of creating
links to different versions in each blog post, each of my blog entries will now reference &lt;a href="http://flimflan.com/blog/ProfileView.aspx"&gt;this
article&lt;/a&gt;.&amp;nbsp; I will keep the article updated with all of the latest ProfileView
happenings.
&lt;/p&gt;
&lt;p&gt;
Go get &lt;a href="http://flimflan.com/blog/ProfileView.aspx"&gt;FlimFlan.WebControls.ProfileView&lt;/a&gt; and
tell me what you think.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://flimflan.com/blog/aggbug.ashx?id=a89964f2-1443-43b1-83dc-4802d2e7eb99" /&gt;</description>
      <comments>http://flimflan.com/blog/CommentView,guid,a89964f2-1443-43b1-83dc-4802d2e7eb99.aspx</comments>
      <category>ProfileView</category>
    </item>
  </channel>
</rss>