<?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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>Brian Mishler on .Net - Asp.Net Providers</title>
    <link>http://mishler.net/</link>
    <description />
    <language>en-us</language>
    <copyright>Brian Mishler</copyright>
    <lastBuildDate>Sun, 04 Feb 2007 03:51:37 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>bmishler@qualitydata.com</managingEditor>
    <webMaster>bmishler@qualitydata.com</webMaster>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=28ae2bcd-5ef7-4c12-bd73-06b7d6b77158</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=28ae2bcd-5ef7-4c12-bd73-06b7d6b77158</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>How to implement a Custom Provider in a WinForms Application</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</guid>
      <link>http://mishler.net/2007/02/04/HowToImplementACustomProviderInAWinFormsApplication.aspx</link>
      <pubDate>Sun, 04 Feb 2007 03:51:37 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Since we always see the “Provider Model”
used in the context of Asp.Net applications (Membership Provider, Roles Provider,
Etc.) we often think of this as something that is available only in the Asp.Net world.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It
was recently mentioned to me that there are no good source code examples for custom
providers in the Winforms space and that the Asp.Net examples utilize the System.Web.Configuration.ProvidersHelper
class to instantiate the provider.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;While there are several other blogs that
talk about bits and pieces of this subject, I thought I might create a start-to-finish
Windows Forms Application that illustrates how one can effectively use the provider
model.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I wrote the solution in Vb.Net
and have included it in the attached zip file.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Advance disclaimer: When I started into
this, I thought to myself “of course you can do this without any of the System.Web
classes” and, in fact, you totally can with just a little bit more work than I put
into this. I cheated a bit by dropping in a reference to System.Web in order to gain
access to System.Web.Configuration.ProvidersHelper to deserialize my provider elements,
but this is only because I am lazy and was copying code from another project. That
class is doing nothing fancier than standard deserialization of XML into an instance
of a class.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Besides: Who says you can’t
reference System.web from a Winforms app?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;So, consider this scenario:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;You develop a Winforms Application and
have some standard functionality, business rules, etc. For example, your application
calls a method that returns a standard report. Knowing that down the road, each one
of your customers is going to want to change the way that report works, you decide
to build the reporting class using the provider model.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
way, you can later build a custom DLL that implements the same interface as the reporting
class (but with unique functionality) and can be installed by simply copying the DLL
to the application folder and then making a change to the application configuration
file (myapp.exe.config.)&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Every customer
can get his/her own unique reporting DLL and the main application never needs to be
modified.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;In a nutshell, this is how you
do it for an existing class:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Step 1: Create a base “mustInherit” class
which has the methods (but no code implementation) of your current class. In the COM
world, this is analogous to an Interface.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Now,
modify your class to inherit from this new base class.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Step 2: Create classes that will be used
to deserialize information in your app.exe.config.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;These
will derive from classes in the System.Configuration namespace and will include one
for your configuration section, one for a collection of provider settings and one
for the provider settings itself.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Doing
this will result in a strongly typed system for referring to your list of configured
providers and their respective settings at runtime.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Step 3: Modify your main application
so that rather than instantiating that existing class as you might have done before,
you instead ask the configuration manager to use the information in yourapp.exe.config
to load up your custom section and give you back an instance of the provider which
has been dubbed as “the one to use.”&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Calibri size=3&gt;&lt;font face="Courier New" size=2&gt;To illustrate
this process, I have whipped up a very simple base provider “MyProviderBase” that
exposes a single method:&lt;/font&gt; “&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;GetProviderSpecificMessage()”.
I then have two separate implementations: “MyFirstProvider” and “MySecondProvider”,
each of which handles GetProviderSpecificMessage() in its own way.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;(While
all of this is pretty basic stuff, the interesting part is where you enable selective
usage of one or the other implementations through settings in the configuration file.)
A tiny winform application, consisting of a button on a form does nothing more than
load the appropriate provider and call its “GetProviderSpecificMessage” method.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;With
the configuration file set up to use the first provider, the output is as shown in
the following message box. (Notice that defaultProvider=”MyFirstProvider” in the application
configuration file shown below.) 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;
&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;
&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;
&lt;v:formulas&gt;
&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;
&lt;/v:formulas&gt;
&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;
&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;
&lt;/v:shapetype&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;img src="http://mishler.net/content/binary/WinProvider1.jpg" border=0&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;em&gt;Big
note: In your solution, the file called app.config will be deployed as yourapplicationname.exe.config
when you build.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;When you distribute the
application, just drop this config file into the same folder as the exe.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Now,
do nothing more than change the configuration file to set defaultProvider=”MySecondProvider”
and you get a totally different result when you run the program.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;img src="http://mishler.net/content/binary/WinProvider2.jpg" border=0&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;For
a top-down look at the implementation, I will first talk about the winForm app (which
I wrote last) and then about the provider implementation.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As
you can see, the solution is very basic.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;img src="http://mishler.net/content/binary/WinProvider3.jpg" border=0&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;strong&gt;The
WinForm Application:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Start
a new Winform project and drop in a button control. In the button’s click event, get
the implemented provider, call its GetProviderSpecificMessage method, and display
its result in a MessageBox.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Here is the
code:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; QualityData&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Configuration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Web.Configuration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; Form1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Button1_Click(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; sender &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Object, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; e &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.EventArgs) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Handles&lt;/span&gt;&lt;font color=#000000&gt; Button1.Click&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; provider &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase
= GetProvider()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(provider) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; MsgBox(provider.GetProviderSpecificMessage)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProvider() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
get reference to configuration section for our provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; section &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderSection
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(ConfigurationManager.GetSection(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"myProvider"&lt;/span&gt;&lt;font color=#000000&gt;),
MyProviderSection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(section) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
load registered providers and get reference to default provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; providers &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; MyProviderCollection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.Web.Configuration.ProvidersHelper.InstantiateProviders(section.Providers,
providers, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;GetType&lt;/span&gt;&lt;font color=#000000&gt;(MyProviderBase))&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(providers(section.DefaultProvider),
MyProviderBase)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Else&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Nothing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;End&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;em&gt;Another
big note: This is the place where I used the shared ProvidersHelper.InstantiateProviders
method in the System.Web.Configuration namespace to walk through my section and instantiate
each of the listed providers. I don’t know why Microsoft did not put the ProvidersHelper
class into the System.Configuration assembly but it is really not such a big deal
to have to get to it in System.Web. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;If
I get around to it, I might go for extra credit and write my own InstantiateProviders
method by enumerating the elements and instantiating each provider based on its type.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;strong&gt;The
Application .config file&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Here
is the application’s config file (mine is called WinformProviderSample.exe.config.)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;xml&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;version&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;1.0&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;encoding&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;utf-8&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; ?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configuration&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; ConfigSections
section MUST be first section in app.config &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configSections&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;section&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;myProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;QualityData.MyProviderSection,MyProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configSections&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; This
is the custom provider section which gets loaded into the QualityData.MyProviderSection
Class &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;myProvider&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;defaultProvider&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;MySecondProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="COLOR: green"&gt; Change
this to swap providers &lt;/span&gt;&lt;span style="COLOR: blue"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;providers&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;clear&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Here
are one or more providers, each defined by its type "Class Name, DLL Name" 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;and
each with settings.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Within the class,
MyProviderSection, these get loaded into&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;and
are accessed by "Providers" property &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;add&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;MyFirstProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;QualityData.MyFirstProvider,MyProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TheCustomSetting&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;This
is the first provider setting value in app.config&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;add&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;MySecondProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;QualityData.MySecondProvider,MyProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TheCustomSetting&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;This
is the second provider's setting value in app.config&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TheExtraMessage&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;..And
here is some extra information to configure the second provider!!!!&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;providers&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;myProvider&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configuration&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Notice
that I have listed two providers: MyFirstProvider and MySecondProvider. As illustrated,
the configuration file is set up to use the second.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Each
of the provider elements has a name as well as a type attribute. The latter is structured
as “ClassName,Assembly” where “ClassName” (QualityData.MyFirstProvider) is the fully
qualified class name including the namespace and “Assembly” is the name of the assembly
(MyProvider.dll) without the “.dll”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You
can tell that both classes are contained in the same assembly in this example.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Notice
also that each provider section can have its own set of attributes. In “MySecondProvider”,
for example, the attribute “TheExtraMessage” is optionally used to pass in extra configuration
information that may be used by this particular implementation.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Hopefully
you will agree that this is a fairly convenient and simple deployment story.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;strong&gt;The
Provider Classes&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Now
let’s talk about the provider. The project: MyProvider consists of several classes
which I put into a single file for brevity.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Here
is the code in its entirety:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Configuration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; system.Configuration.Provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; QualityData&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This is the base class that defines the required methods of any implementation&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;MustInherit&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; ProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
For simplicity, we will have a single method that gets implemented 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
differently based on the chosen provider.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;MustOverride&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProviderSpecificMessage() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
The following two classes are "providers" that implement the base in different ways&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
Ordinarily, each of these two classes would be in its own DLL since much of the idea
of the&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
Provider model is to be able to ship new behavior that can be "dropped in" without
replacing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
the rest of the application&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; myFirstProvider
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Initialize(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; name &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; config &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Collections.Specialized.NameValueCollection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
Override the method of Configuration.Provider.ProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
default provider name if missing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(name) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; name
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"MyFirstProvider"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
initialize base and get custom settings&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(config) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;&lt;font color=#000000&gt;.Initialize(name,
config)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
get the setting from config file&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;_myUniqueMessage
= config(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"TheCustomSetting"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
default setting to something uniquely from this provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(_myUniqueMessage) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage&amp;nbsp;=&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;&amp;nbsp;"FIRST
PROVIDER WAS HERE!!"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProviderSpecificMessage() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
return string that has provider-specific prefix as well as data from config&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"The
First Provider says: "&lt;/span&gt;&lt;font color=#000000&gt; &amp;amp; _myUniqueMessage&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; mySecondProvider
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; _anExtraMessage &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Initialize(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; name &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; config &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Collections.Specialized.NameValueCollection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
Override the method of Configuration.Provider.ProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
default provider name if missing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(name) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; name
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"MySecondProvider"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
initialize base and get custom settings&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(config) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;&lt;font color=#000000&gt;.Initialize(name,
config)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
get the setting from config file&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;_myUniqueMessage
= config(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"TheCustomSetting"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
this second provider can have its own extra settings&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;_anExtraMessage
= config(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"TheExtraMessage"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
default setting to something uniquely from this provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(_myUniqueMessage) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"#2 PROVIDER WAS HERE!!"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProviderSpecificMessage() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
build up a return string that is specialized for this provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; sb &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; System.Text.StringBuilder&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sb.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"The
Second provider does it differently: "&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sb.Append(_myUniqueMessage)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(_anExtraMessage) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; sb.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"
"&lt;/span&gt;&lt;font color=#000000&gt; &amp;amp; _anExtraMessage)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; sb.ToString&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
We will be swapping out providers through simple changes to the app's .config file&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This can go quite deep to give you a lot more control but here are the basics:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
1) MyProviderSection, defines a configuration section for app.config&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
2) MyProviderCollection, defines the collection of providers listed within our section
of .config&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This class lets the configuration manager create a strongly-typed instance of our&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
section based on the information listed in the application's .config file.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; MyProviderSection
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; ConfigurationSection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;ConfigurationProperty(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"providers"&lt;/span&gt;&lt;font color=#000000&gt;)&amp;gt;
_&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ReadOnly&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; Providers() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; ProviderSettingsCollection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"providers"&lt;/span&gt;&lt;font color=#000000&gt;),
ProviderSettingsCollection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;StringValidator(minLength:=1),
ConfigurationProperty(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"defaultProvider"&lt;/span&gt;&lt;font color=#000000&gt;,
defaultvalue:=&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"MyFirstProvider"&lt;/span&gt;&lt;font color=#000000&gt;)&amp;gt;
_&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; DefaultProvider() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CStr&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"defaultProvider"&lt;/span&gt;&lt;font color=#000000&gt;))&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Set&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; value &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"defaultProvider"&lt;/span&gt;&lt;font color=#000000&gt;)
= value&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Set&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This class lets the configuration manager create a strongly-typed collection of&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
providers based on the information listed within the section for our custom provider.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; MyProviderCollection
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; ProviderCollection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ReadOnly&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; name &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; o &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;&lt;font color=#000000&gt; = &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(name)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; o &lt;/font&gt;&lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(o,
MyProviderBase) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Else&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Nothing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Add(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; provider &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Configuration.Provider.ProviderBase)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
check for valid type (ie, make sure the listed provider inherits from our base)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(provider) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Throw&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; ArgumentNullException(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"provider"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;TypeOf&lt;/span&gt;&lt;font color=#000000&gt; provider &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Throw&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; ArgumentException(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"Invalid
provider type"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"provider"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
add&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;&lt;font color=#000000&gt;.Add(provider)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;End&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Namespace&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Most
of this is self explanatory and hopefully the code comments will help to make it clear.
Notice that we have a (mustinherit) base class that inherits System.Configuration.Provider.ProviderBase
and defines the single required method “GetProviderSpecificMessage”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;We
have two classes that inherit from that base and override the Initialize method to
load in the configuration goodies that are passed in as a NameValueCollection. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;We
also have a custom ConfigurationSection class that minimally extends its base by setting
the defaultProvider’s defaultValue property to “MyFirstProvider”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Finally,
we implement “MyProviderCollection” which inherits from System.Configuration.ProviderCollection
and contains a list of providers that derive from our custom provider base (MyProviderBase.)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Download,
run and extend the source in the project and let me know if any of this is useful
to you.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;a name=_MailAutoSig&gt;&lt;span style="COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-no-proof: yes; mso-themecolor: dark2"&gt;
&lt;o:p&gt;
&lt;font face=Calibri size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-bookmark: _MailAutoSig"&gt;&lt;span style="COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-no-proof: yes; mso-themecolor: dark2"&gt;&lt;font size=3&gt;&lt;font face=Calibri&gt;Brian
Mishler&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;a href="http://mishler.net/content/binary/WinformProviderSample.zip"&gt;WinformProviderSample.zip
(99.86 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=28ae2bcd-5ef7-4c12-bd73-06b7d6b77158" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</comments>
      <category>.Net</category>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=754bd904-454a-478e-8b34-fe2b6e30608c</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=754bd904-454a-478e-8b34-fe2b6e30608c</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In an Asp.Net application, if you
check the properties of the various Asp.Net providers at runtime, you will get a value
that is something of a hybrid between default and custom settings. Similarly, if you
check a property such as </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ConfigurationManager.ConnectionStrings(“LocalSqlServer”).ConnectionString</span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">,
you will get a value that may originate in web.config or result from a default setting.</span>
        </p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Why is this?</span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When an Asp.Net 2.0 application
is loaded, the attributes (and behavior) of the various Asp.Net providers (membership,
roleManager, profile and others) are retrieved from sections in machine.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.) 
If the web application includes a web.config file, the configuration sections contained
therein may supplement or override the default behavior.</span>
        </p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">So how do you programmatically
determine if a provider is getting its configuration from the default (machine.config)
file or from an application-specific (web.config) file? </span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I recently had to deal with this
issue in testing for various potential user problems with the <a title="http://www.qualitydata.com/products/aspnet-membership/default.aspx" href="http://www.qualitydata.com/products/aspnet-membership/default.aspx"><font color="#800080">Membership
Manager Control</font></a>.  I was simulating a fairly common scenario where
users might configure their AspNetSqlMembershipProvider to store passwords in an encrypted
format but forget to provide a machineKey section.  The machineKey section defines
how to encrypt/decrypt various types of information and, if not defined in web.config,
will produce autogenerated values. Anyone who has tried to go with an encrypted rather
than hashed passwordFormat will have undoubtedly encountered the following message
when they attempt to run the web application:</span>
        </p>
        <p class="MsoNormal" style="MARGIN-LEFT: 0.5in">
          <i>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">You must specify a non-autogenerated
machine key to store passwords in the encrypted format. Either specify a different
passwordFormat, or change the machineKey configuration to use a non-autogenerated
decryption key.</span>
          </i>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This exception is thrown by the
AspNetSQLMembershipProvider to force the web application developer to provide a machineKey
section in web.config.  This requirement is well documented and several excellent
resources are available on the Internet to help you generate the elements needed to
create your own custom machineKey configuration section.</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So in my situation, I wanted to
prevent users from changing an individual member’s passwordFormat to Encrypted if
the machineKey was not specified in web.config. I would need a way to determine this
at runtime.  </span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Well, it’s easy enough to get a
strongly typed MachineKeySection object. The following VB.Net method illustrates how
to get an instance of the machineKeySection class for the current web project:</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Public</span><span style="COLOR: blue">Shared</span><span style="COLOR: blue">Function</span> GetMachineKeySection() <span style="COLOR: blue">As</span> System.Web.Configuration.MachineKeySection</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">Static</span> section <span style="COLOR: blue">As</span> MachineKeySection<br /></span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">If</span> section <span style="COLOR: blue">Is</span><span style="COLOR: blue">Nothing</span><span style="COLOR: blue">Then</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">               
section = <span style="COLOR: blue">CType</span>(System.Web.Configuration.WebConfigurationManager.GetSection(<span style="COLOR: maroon">"system.web/machineKey"</span>),
MachineKeySection)</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">End</span><span style="COLOR: blue">If<br /></span></span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">Return</span> section</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">End</span><span style="COLOR: blue">Function</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">(Note that </span>
          <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">"system.web/machineKey"</span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> is
case sensitive)</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And when you check the resulting
instance, you will get information in fields such as decryption, decryptionKey, validation
and validationKey – whether or not a machineKey section exists in web.config.  </span>
        </p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span>
          </b> 
</p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So how can you programmatically
tell if machineKey contains a non-autogenerated decryption key?</span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The <em>ElementInformation</em> class
is typically available as a property of sections such as machineKey and can tell you
if a particular element is a collection, if it can be modified and even the line number
where it is defined in its configuration file. And, of course, Microsoft gives us
the IsPresent property which tells us whether or not the element actually exists in
the configuration file. ElementInformation.IsPresent returns a Boolean and is easy
to use as shown in the VB.Net method listed below.</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Public</span><span style="COLOR: blue">Shared</span><span style="COLOR: blue">Function</span> HaveMachineKey() <span style="COLOR: blue">As</span><span style="COLOR: blue">Boolean</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">Dim</span> section<span style="COLOR: blue"> As</span> MachineKeySection
= GetMachineKeySection() ' see above </span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">If</span><span style="COLOR: blue">Not</span> section<span style="COLOR: blue"> Is</span><span style="COLOR: blue">Nothing</span><span style="COLOR: blue">Then</span> <br />
               </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">section.ElementInformation.IsPresent<br /></span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <font color="#0000ff">End
If</font></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">End</span><span style="COLOR: blue">Function</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The model for strongly typed configuration
classes has been around since .Net 1.0 and is available for WinForms as well as WebForms
applications. Custom configuration classes are relatively easy to create and provide
a big step up from INI files.  In the 2.0 .Net Framework, configuration classes
are even easier to create and provide lots of great new capabilities. This ability
to inherit and override configuration settings does a great job in supporting the
provider model and features such as the <strong>ElementInformation</strong> class
give the programmer all the information he/she needs to determine the source of any
particular configuration section.</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
          </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
          </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
          </span> 
</p>
        <div>
          <p class="MsoAutoSig">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <p class="MsoAutoSig">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <a title="http://www.qualitydata.com/" href="http://www.qualitydata.com/">
                <font color="#800080">http://www.qualitydata.com</font>
              </a>
            </span>
          </p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=754bd904-454a-478e-8b34-fe2b6e30608c" />
      </body>
      <title>How to determine where a provider is configured</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</guid>
      <link>http://mishler.net/2006/04/27/HowToDetermineWhereAProviderIsConfigured.aspx</link>
      <pubDate>Thu, 27 Apr 2006 12:28:52 GMT</pubDate>
      <description>&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In an Asp.Net application, if you
check the properties of the various Asp.Net providers at runtime, you will get a value
that is something of a hybrid between default and custom settings. Similarly, if you
check a property such as &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;ConfigurationManager.ConnectionStrings(“LocalSqlServer”).ConnectionString&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;,
you will get a value that may originate in web.config or result from a default setting.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Why is this?&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;When an Asp.Net 2.0 application
is loaded, the attributes (and behavior) of the various Asp.Net providers (membership,
roleManager, profile and others) are retrieved from sections in machine.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.)&amp;nbsp;
If the web application includes a web.config file, the configuration sections contained
therein may supplement or override the default behavior.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"&gt;So how do you programmatically
determine if a provider is getting its configuration from the default (machine.config)
file or from an application-specific (web.config) file? &lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I recently had to deal with this
issue in testing for various potential user problems with the &lt;a title=http://www.qualitydata.com/products/aspnet-membership/default.aspx href="http://www.qualitydata.com/products/aspnet-membership/default.aspx"&gt;&lt;font color=#800080&gt;Membership
Manager Control&lt;/font&gt;&lt;/a&gt;.&amp;nbsp; I was simulating a fairly common scenario where
users might configure their AspNetSqlMembershipProvider to store passwords in an encrypted
format but forget to provide a machineKey section.&amp;nbsp; The machineKey section defines
how to encrypt/decrypt various types of information and, if not defined in web.config,
will produce autogenerated values. Anyone who has tried to go with an encrypted rather
than hashed passwordFormat will have undoubtedly encountered the following message
when they attempt to run the web application:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You must specify a non-autogenerated
machine key to store passwords in the encrypted format. Either specify a different
passwordFormat, or change the machineKey configuration to use a non-autogenerated
decryption key.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This exception is thrown by the
AspNetSQLMembershipProvider to force the web application developer to provide a machineKey
section in web.config. &amp;nbsp;This requirement is well documented and several excellent
resources are available on the Internet to help you generate the elements needed to
create your own custom machineKey configuration section.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So in my situation, I wanted to
prevent users from changing an individual member’s passwordFormat to Encrypted if
the machineKey was not specified in web.config. I would need a way to determine this
at runtime.&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Well, it’s easy enough to get a
strongly typed MachineKeySection object. The following VB.Net method illustrates how
to get an instance of the machineKeySection class for the current web project:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Shared&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; GetMachineKeySection() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.Web.Configuration.MachineKeySection&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Static&lt;/span&gt; section &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; MachineKeySection&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; section &lt;span style="COLOR: blue"&gt;Is&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
section = &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(System.Web.Configuration.WebConfigurationManager.GetSection(&lt;span style="COLOR: maroon"&gt;"system.web/machineKey"&lt;/span&gt;),
MachineKeySection)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; section&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;(Note that &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;"system.web/machineKey"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; is
case sensitive)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;And when you check the resulting
instance, you will get information in fields such as decryption, decryptionKey, validation
and validationKey – whether or not a machineKey section exists in web.config.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So how can you programmatically
tell if machineKey contains a non-autogenerated decryption key?&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The &lt;em&gt;ElementInformation&lt;/em&gt; class
is typically available as a property of sections such as machineKey and can tell you
if a particular element is a collection, if it can be modified and even the line number
where it is defined in its configuration file. And, of course, Microsoft gives us
the IsPresent property which tells us whether or not the element actually exists in
the configuration file. ElementInformation.IsPresent returns a Boolean and is easy
to use as shown in the VB.Net method listed below.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Shared&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; HaveMachineKey() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Boolean&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; section&lt;span style="COLOR: blue"&gt; As&lt;/span&gt; MachineKeySection
= GetMachineKeySection() ' see above &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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: blue"&gt;Not&lt;/span&gt; section&lt;span style="COLOR: blue"&gt; Is&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;section.ElementInformation.IsPresent&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=#0000ff&gt;End
If&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The model for strongly typed configuration
classes has been around since .Net 1.0 and is available for WinForms as well as WebForms
applications. Custom configuration classes are relatively easy to create and provide
a big step up from INI files. &amp;nbsp;In the 2.0 .Net Framework, configuration classes
are even easier to create and provide lots of great new capabilities. This ability
to inherit and override configuration settings does a great job in supporting the
provider model and features such as the &lt;strong&gt;ElementInformation&lt;/strong&gt; class
give the programmer all the information he/she needs to determine the source of any
particular configuration section.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a title=http://www.qualitydata.com/ href="http://www.qualitydata.com/"&gt;&lt;font color=#800080&gt;http://www.qualitydata.com&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=754bd904-454a-478e-8b34-fe2b6e30608c" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</comments>
      <category>.Net</category>
      <category>Asp.Net</category>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=ea65afc0-2970-46f1-9412-4b57bbd906f4</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=ea65afc0-2970-46f1-9412-4b57bbd906f4</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
The Asp.net membership provider was designed to allow for self-service password management
but through an understanding of the configuration options as well as a combined use
certain provider methods, web site administrators can effectively manage member passwords. 
This article briefly summarizes the various settings and methods which can be combined
to administratively manage passwords in an Asp.Net membership system based on the
default SQLMembershipProvider.
</p>
          <p class="MsoNormal">
The following (web.config) configuration options define how the AspNetSqlMembershipProvider
behaves:
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>enablePasswordRetrieval</b> – Enables/disables the membership provider’s GetPassword
method. Note that GetPassword will always throw an exception if the user’s password
is hashed. Default value is <i>false</i>.  Requires the password answer unless
“requiresQuestionAndAnswer” in web.config is set to false.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>enablePasswordReset</b> – Enables/disables the membership provider’s ResetPassword
method, which can be used to produce a randomly generated password. Default value
is <i>true</i>.  ResetPassword requires the user’s passwordAnswer unless “requiresQuestionAndAnswer”
in web.config is set to <i>false</i>.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>requiresQuestionAndAnswer</b> – Alters the behavior of the GetPassword and ResetPassword
methods to require or not require the password answer parameter. Default value is <i>true</i>.
This method is the key for administrative management of passwords since, by turning
it off, administrators can retrieve or reset passwords.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>passwordFormat</b> – Defines how passwords will be stored when membership records
are created. Note that once a membership record has been created, functions such as
ChangePassword and ResetPassword will continue to store the credentials in the original
passwordFormat, even if web.config is changed to use a different password format. 
</p>
          <p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%">
Clear             the
password and password answer are stored in clear text. The passwordSalt field (in
the database) is left blank.
</p>
          <p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%">
Encrypted      the password, password answer and passwordSalt
are stored in an encrypted format within the database using the key information supplied
in the machineKey element of web.config
</p>
          <p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%">
Hashed          the password and password
answer are hashed using a one-way hash algorithm and a randomly generated passwordSalt
value.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Microsoft set the default value of passwordFormat to Hashed in order to promote their
secure web initiative but for many applications, this level of security is overkill
and can create inconveniences in managing passwords.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Given the above information, there are a number of approaches that can be taken to
administratively manage membership passwords. Note that “administrative” management
implies that the administrator does not know the member’s password or password answer.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Retrieving a member’s password</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
The GetPassword method may be used to retrieve a member’s password and, at first glance,
appears to require the password answer. By setting “requiresQuestionAndAnswer” to <i>false</i> in
web.config, the GetPassword method can be called with an empty password answer and
therefore can be effectively used to administratively retrieve a member’s password.
Note that “enablePasswordRetrieval” must be set to <i>true</i> in web.config to enable
the GetPassword method:
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
 If password is:
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Clear text         Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Encrypted         Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Hashed             Not
possible, however the password may be reset as described below.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In Visual Basic, you can call the shared GetPassword method as illustrated below.
Note that the second parameter would be for the password answer if “requiresQuestionAndAnswer”
were <i>true</i> in web.config.
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Dim</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> password <span style="COLOR: blue">As</span><span style="COLOR: blue">String</span> =
Membership.Provider.GetPassword(userName, <span style="COLOR: blue">String</span>.Empty)</span>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Resetting a member’s password</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
The ResetPassword method may be used to generate a new, randomly generated password
and, at first glance, appears to require the user’s password answer. By setting “requiresQuestionAndAnswer”
to <i>false</i> in web.config, the ResetPassword method can be called with an empty
password answer to set a user’s password to some new randomly generated value. 
ResetPassword works with all password formats (clear, encrypted, hashed).
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In Visual Basic, you can call the shared ResetPassword method as illustrated below.
Note that you can pass <i>Nothing</i> for the second parameter, passwordAnswer.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'">Dim</span>
            <span style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'"> newPassword <span style="COLOR: blue">As</span><span style="COLOR: blue">String</span> =
Membership.Provider.ResetPassword(username, <span style="COLOR: blue">Nothing</span>)</span>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Changing a member’s password</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In some organizations, a Customer Service department may wish to change a user’s password
to a new known value, perhaps in response to a customer request. The ChangePassword
method, which appears to handle this need, unfortunately requires the original user
password which is usually unavailable to the site administrator. By setting “requiresQuestionAndAnswer”
to <i>false</i>, “enablePasswordRetrieval” to <i>true</i> and “enablePasswordReset”
to <i>true</i> in web.config, the ResetPassword and ChangePassword methods can be
used to change a user’s password to a known value, regardless of the password format:
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Clear text         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value.
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Encrypted         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Hashed             Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePassword to set the password to a desired value
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>
            </b> 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Changing a member’s Password Question and Password Answer</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In some situations, the Customer Service department may wish to modify a member’s
Password Question and Password Answer. This is easily accomplished if passwords are
encrypted or maintained in clear text. For hashed passwords, however, a password-reset
is also required since the provider method, ChangePasswordQuestionAndAnswer, requires
the member’s password which is not retrievable. By setting “requiresQuestionAndAnswer”
to <i>false</i>, “enablePasswordRetrieval” to <i>true</i> and “enablePasswordReset”
to <i>true</i> in web.config, the member’s Password Question and Password Answer may
be reset:
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Clear text         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Encrypted         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Hashed             Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePasswordQuestionAndAnswer to set the Password Question and Password Answer to
a desired value. Optionally call ChangePassword to set the password to a more user-friendly
value.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Changing the password format</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
As web sites mature, website administrators sometimes regret their original (sometimes
unintended) choice in passwordFormat when using the AspNetSqlMembershipProvider. That
is, membership passwords may be clear text when a hashed format is desired or vice
versa. Microsoft’s decision to implement hashing in the default AspNetSqlMembershipProvider
was wise and conservative but for many web sites with minimal security requirements,
the password system can become cumbersome.  By directly calling a couple of the
AspNet stored procedures, it is possible to change the password format:
</p>
          <p dir="ltr" style="MARGIN-BOTTOM: 7.5pt; MARGIN-LEFT: 1in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; MARGIN-RIGHT: 0.5in">
Note: If the passwordFormat is initially “Clear” or “Encrypted”, use the membership.provider.GetPassword
method to cache the original password before calling the stored procedures.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
1.<span style="FONT: 7pt 'Times New Roman'">      </span>Use
the stored procedure aspnet Membership GetPasswordWithFormat to retrieve the current
passwordSalt.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
2.<span style="FONT: 7pt 'Times New Roman'">      </span>Use
the stored procedure aspnet Membership ResetPassword to set the passwordFormat to
its intended (integer) value. The stored procedure requires readily available parameter
values including passwordSalt (retrieved earlier), password (empty string) and passwordAnswer
(Null).
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
At this point, the membership record has been placed into an initialized (unusable)
state and the PasswordAnswer has been lost. If the original password was hashed, then
it too will be unrecoverable.  The provider methods listed below and described
in previous sections allow for resetting the credentials and, as they are used, the
password and password answer will be stored in the new password format (clear, encrypted,
hashed.)
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
1.<span style="FONT: 7pt 'Times New Roman'">      </span>Call
the ResetPassword method to generate and retrieve a new random Password. Remember
that the second parameter (answer) is not required if “requiresQuestionAndAnswer”
is set to false in web.config.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
2.<span style="FONT: 7pt 'Times New Roman'">      </span>Call
the ChangePassword method, using the now-current password retrieved in the previous
step, to set the password to a desired value.  If the original password was saved
at the start of the procedure, it may be restored at this point. 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
For originally un-hashed passwords, the preceding steps allow for a change of passwordFormat
with complete restoration of the original password. 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
The Password Answer could have easily been retrieved from the database at the outset
if it was stored in clear text. In the case of an encrypted Password Answer, a more
complicated approach which involves the provider’s protected DecryptPassword method
could have been used to cache the original Password Answer.  If the original
Password Answer were available, it could be restored with a call to the ChangePasswordQuestionAndAnswer
provider method.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
So, what can be done if the Password and/or Password Answer had to be sacrificed in
favor of a new passwordFormat?  One solution might be to reset everyone’s credentials
then send them by Email. Another solution might be to place a notice onto the web
site that informs users and provides further instructions. Either way, the web site
should leverage the self-service membership controls which allow the member to reset
his/her own credentials.  The following outlines a series of steps that can be
taken:
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
1.<span style="FONT: 7pt 'Times New Roman'">      </span>A
new arbitrary password can be assigned using either the ResetPassword or ChangePassword
provider method. Similarly, a new arbitrary Password Question and Password Answer
can be assigned using the ChangePasswordQuestionAndAnswer provider method.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
2.<span style="FONT: 7pt 'Times New Roman'">      </span>Since
the user will not know his/her new credentials, ensure the Login Control includes
the necessary properties (PasswordRecoveryText and PasswordRecoveryURL) to link the
user to a page that includes a PasswordRecovery Control.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
3.<span style="FONT: 7pt 'Times New Roman'">      </span>Recall
that the PasswordRecovery Control is driven by the provider settings in web.config.
In particular, ensure that “requiresQuestionAndAnswer” is set to false so the PasswordRecovery
Control does not prompt the user for a Password Answer. Also, ensure that the SMTP
setting is specified in web.config so that the Email will be sent. If the membership
record uses a hashed password format then a new (random) password will be sent, otherwise
the password you assigned in the previous step will be sent.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Conclusion</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Armed with a little knowledge, it is possible to use the membership provider methods
to perform basic administrative functions for an otherwise self-service web site.
It is possible (although probably undesirable) to have a mix of clear, encrypted and
hashed passwords in the same database. Depending on the passwordFormat for a particular
record, varying levels of administrative control are available. For the AspNetSqlMembershipProvider,
it is possible to change the passwordFormat for a particular record using a combination
of built-in stored procedure calls and membership provider methods. 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Microsoft has done a good job in engineering the membership provider system and has
really left no security holes. The procedures outlined here utilize a combination
of built-in stored procedures as well as standard provider methods to accomplish certain
activities that are routinely required of site administrators.
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=ea65afc0-2970-46f1-9412-4b57bbd906f4" />
      </body>
      <title>Asp.Net Membership Password Administration</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</guid>
      <link>http://mishler.net/2006/04/18/AspNetMembershipPasswordAdministration.aspx</link>
      <pubDate>Tue, 18 Apr 2006 01:47:20 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
The Asp.net membership provider was designed to allow for self-service password management
but through an understanding of the configuration options as well as a combined use
certain provider methods, web site administrators can effectively manage member passwords.&amp;nbsp;
This article briefly summarizes the various settings and methods which can be combined
to administratively manage passwords in an Asp.Net membership system based on the
default SQLMembershipProvider.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
The following (web.config) configuration options define how&amp;nbsp;the AspNetSqlMembershipProvider
behaves:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;enablePasswordRetrieval&lt;/b&gt; – Enables/disables the membership provider’s GetPassword
method. Note that GetPassword will always throw an exception if the user’s password
is hashed. Default value is &lt;i&gt;false&lt;/i&gt;.&amp;nbsp; Requires the password answer unless
“requiresQuestionAndAnswer” in web.config is set to false.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;enablePasswordReset&lt;/b&gt; – Enables/disables the membership provider’s ResetPassword
method, which can be used to produce a randomly generated password. Default value
is &lt;i&gt;true&lt;/i&gt;.&amp;nbsp; ResetPassword requires the user’s passwordAnswer unless “requiresQuestionAndAnswer”
in web.config is set to &lt;i&gt;false&lt;/i&gt;.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;requiresQuestionAndAnswer&lt;/b&gt; – Alters the behavior of the GetPassword and ResetPassword
methods to require or not require the password answer parameter. Default value is &lt;i&gt;true&lt;/i&gt;.
This method is the key for administrative management of passwords since, by turning
it off, administrators can retrieve or reset passwords.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;passwordFormat&lt;/b&gt; – Defines how passwords will be stored when membership records
are created. Note that once a membership record has been created, functions such as
ChangePassword and ResetPassword will continue to store the credentials in the original
passwordFormat, even if web.config is changed to use a different password format. 
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%"&gt;
Clear&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the
password and password answer are stored in clear text. The passwordSalt field (in
the database) is left blank.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%"&gt;
Encrypted &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the password, password answer and passwordSalt
are stored in an encrypted format within the database using the key information supplied
in the machineKey element of web.config
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the password and password
answer are hashed using a one-way hash algorithm and a randomly generated passwordSalt
value.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Microsoft set the default value of passwordFormat to Hashed in order to promote their
secure web initiative but for many applications, this level of security is overkill
and can create inconveniences in managing passwords.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Given the above information, there are a number of approaches that can be taken to
administratively manage membership passwords. Note that “administrative” management
implies that the administrator does not know the member’s password or password answer.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Retrieving a member’s password&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
The GetPassword method may be used to retrieve a member’s password and, at first glance,
appears to require the password answer. By setting “requiresQuestionAndAnswer” to &lt;i&gt;false&lt;/i&gt; in
web.config, the GetPassword method can be called with an empty password answer and
therefore can be effectively used to administratively retrieve a member’s password.
Note that “enablePasswordRetrieval” must be set to &lt;i&gt;true&lt;/i&gt; in web.config to enable
the GetPassword method:
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&amp;nbsp;If password is:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Clear text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Encrypted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not
possible, however the password may be reset as described below.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In Visual Basic, you can call the shared GetPassword method as illustrated below.
Note that the second parameter would be for the password answer if “requiresQuestionAndAnswer”
were &lt;i&gt;true&lt;/i&gt; in web.config.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; password &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; =
Membership.Provider.GetPassword(userName, &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty)&lt;/span&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Resetting a member’s password&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
The ResetPassword method may be used to generate a new, randomly generated password
and, at first glance, appears to require the user’s password answer. By setting “requiresQuestionAndAnswer”
to &lt;i&gt;false&lt;/i&gt; in web.config, the ResetPassword method can be called with an empty
password answer to set a user’s password to some new randomly generated value.&amp;nbsp;
ResetPassword works with all password formats (clear, encrypted, hashed).
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In Visual Basic, you can call the shared ResetPassword method as illustrated below.
Note that you can pass &lt;i&gt;Nothing&lt;/i&gt; for the second parameter, passwordAnswer.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'"&gt; newPassword &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; =
Membership.Provider.ResetPassword(username, &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Changing a member’s password&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In some organizations, a Customer Service department may wish to change a user’s password
to a new known value, perhaps in response to a customer request. The ChangePassword
method, which appears to handle this need, unfortunately requires the original user
password which is usually unavailable to the site administrator. By setting “requiresQuestionAndAnswer”
to &lt;i&gt;false&lt;/i&gt;, “enablePasswordRetrieval” to &lt;i&gt;true&lt;/i&gt; and “enablePasswordReset”
to &lt;i&gt;true&lt;/i&gt; in web.config, the ResetPassword and ChangePassword methods can be
used to change a user’s password to a known value, regardless of the password format:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Clear text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Encrypted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePassword to set the password to a desired value
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;&lt;/b&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Changing a member’s Password Question and Password Answer&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In some situations, the Customer Service department may wish to modify a member’s
Password Question and Password Answer. This is easily accomplished if passwords are
encrypted or maintained in clear text. For hashed passwords, however, a password-reset
is also required since the provider method, ChangePasswordQuestionAndAnswer, requires
the member’s password which is not retrievable. By setting “requiresQuestionAndAnswer”
to &lt;i&gt;false&lt;/i&gt;, “enablePasswordRetrieval” to &lt;i&gt;true&lt;/i&gt; and “enablePasswordReset”
to &lt;i&gt;true&lt;/i&gt; in web.config, the member’s Password Question and Password Answer may
be reset:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Clear text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Encrypted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePasswordQuestionAndAnswer to set the Password Question and Password Answer to
a desired value. Optionally call ChangePassword to set the password to a more user-friendly
value.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Changing the password format&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
As web sites mature, website administrators sometimes regret their original (sometimes
unintended) choice in passwordFormat when using the AspNetSqlMembershipProvider. That
is, membership passwords may be clear text when a hashed format is desired or vice
versa. Microsoft’s decision to implement hashing in the default AspNetSqlMembershipProvider
was wise and conservative but for many web sites with minimal security requirements,
the password system can become cumbersome. &amp;nbsp;By directly calling a couple of the
AspNet stored procedures, it is possible to change the password format:
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-BOTTOM: 7.5pt; MARGIN-LEFT: 1in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; MARGIN-RIGHT: 0.5in"&gt;
Note: If the passwordFormat is initially “Clear” or “Encrypted”, use the membership.provider.GetPassword
method to cache the original password before calling the stored procedures.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use
the stored procedure aspnet Membership GetPasswordWithFormat to retrieve the current
passwordSalt.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use
the stored procedure aspnet Membership ResetPassword to set the passwordFormat to
its intended (integer) value. The stored procedure requires readily available parameter
values including passwordSalt (retrieved earlier), password (empty string) and passwordAnswer
(Null).
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
At this point, the membership record has been placed into an initialized (unusable)
state and the PasswordAnswer has been lost. If the original password was hashed, then
it too will be unrecoverable.&amp;nbsp; The provider methods listed below and described
in previous sections allow for resetting the credentials and, as they are used, the
password and password answer will be stored in the new password format (clear, encrypted,
hashed.)
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Call
the ResetPassword method to generate and retrieve a new random Password. Remember
that the second parameter (answer) is not required if “requiresQuestionAndAnswer”
is set to false in web.config.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Call
the ChangePassword method, using the now-current password retrieved in the previous
step, to set the password to a desired value.&amp;nbsp; If the original password was saved
at the start of the procedure, it may be restored at this point. 
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
For originally un-hashed passwords, the preceding steps allow for a change of passwordFormat
with complete restoration of the original password. 
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
The Password Answer could have easily been retrieved from the database at the outset
if it was stored in clear text. In the case of an encrypted Password Answer, a more
complicated approach which involves the provider’s protected DecryptPassword method
could have been used to cache the original Password Answer.&amp;nbsp; If the original
Password Answer were available, it could be restored with a call to the ChangePasswordQuestionAndAnswer
provider method.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
So, what can be done if the Password and/or Password Answer had to be sacrificed in
favor of a new passwordFormat?&amp;nbsp; One solution might be to reset everyone’s credentials
then send them by Email. Another solution might be to place a notice onto the web
site that informs users and provides further instructions. Either way, the web site
should leverage the self-service membership controls which allow the member to reset
his/her own credentials.&amp;nbsp; The following outlines a series of steps that can be
taken:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;A
new arbitrary password can be assigned using either the ResetPassword or ChangePassword
provider method. Similarly, a new arbitrary Password Question and Password Answer
can be assigned using the ChangePasswordQuestionAndAnswer provider method.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Since
the user will not know his/her new credentials, ensure the Login Control includes
the necessary properties (PasswordRecoveryText and PasswordRecoveryURL) to link the
user to a page that includes a PasswordRecovery Control.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
3.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Recall
that the PasswordRecovery Control is driven by the provider settings in web.config.
In particular, ensure that “requiresQuestionAndAnswer” is set to false so the PasswordRecovery
Control does not prompt the user for a Password Answer. Also, ensure that the SMTP
setting is specified in web.config so that the Email will be sent. If the membership
record uses a hashed password format then a new (random) password will be sent, otherwise
the password you assigned in the previous step will be sent.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Conclusion&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Armed with a little knowledge, it is possible to use the membership provider methods
to perform basic administrative functions for an otherwise self-service web site.
It is possible (although probably undesirable) to have a mix of clear, encrypted and
hashed passwords in the same database. Depending on the passwordFormat for a particular
record, varying levels of administrative control are available. For the AspNetSqlMembershipProvider,
it is possible to change the passwordFormat for a particular record using a combination
of built-in stored procedure calls and membership provider methods. 
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Microsoft has done a good job in engineering the membership provider system and has
really left no security holes. The procedures outlined here utilize a combination
of built-in stored procedures as well as standard provider methods to accomplish certain
activities that are routinely required of site administrators.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=ea65afc0-2970-46f1-9412-4b57bbd906f4" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</comments>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=98a72720-e617-4117-9ce7-db3482617e31</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=98a72720-e617-4117-9ce7-db3482617e31</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">As an Independent Software Vendor
(ISV), I make my living writing a software program and (hopefully) selling it many
times. For the most part, the application meets the customer’s requirements right
“out of the box” and if there is a gap, the customer is usually able to work around
it.  Every now and then, a potential customer will dangle the carrot out there,
that if certain features are added then they’ll buy a lot of copies. Or, they would
buy it if it could be integrated with their existing XYZ-system.  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Now I’m not talking about the practice
of accepting customer suggestions for a systematic improvement of a maturing product.
I’m talking about adding appendages where they just don’t belong. Over the years,
I’ve occasionally succumbed to these pressures and in some cases, the products were
better off for it. Other times, the extra features were like anchors around our feet
as now had customer-specific business rules in our mainstream product.</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The Provider Model</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m sure the Provider Model has
been around for a while but I first heard the term “Provider” back when Microsoft
was introducing its “Universal Data Access” strategy (I seem to recall this was all
part of the transition to MDAC.)  For the next few years, of course, we all used
the “ODBC Provider” or the “SQL Server Provider” in our database applications and
(at least I) did not think much more of it. </span>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 1in">
            <i>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In general, the provider model
is a design pattern that allows, through configuration, an alternate provider of application
functionality to be substituted with requiring modification to the primary application.</span>
            </i>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 1in">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">(There’s probably a better text-book
definition for this but my definition suits me just fine)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">A few years back, I read a couple
of articles on MSDN about “Providers” and proceeded to build my own for one of our
products, the <a href="http://www.pocketforms.net/enterprise/Default.aspx">PocketForms
Web Service</a>. I was intrigued about the idea of letting customers easily override
the default implementation of any of my web methods and figured this might provide
a nice “catch all” for the occasional special-requirements customer.  Back then,
there was no base provider class in the .Net Framework but several good examples were
available for guidance.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I found that most of the work was
actually in setting up various configuration classes that would be used to manage
optional user settings. The application, itself, required some fairly straight-forward
design changes, mainly in creating a new “MustInherit” base class that defined the
interfaces that my existing class already implemented.  All-in-all, it took just
a couple of days to retrofit my existing application with this new design pattern.</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Fantastic Return on Investment</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I must say that the investment in
learning about and implementing the Provider Model has been one of the best decisions
I have ever made professionally. As it turns out, <i>most</i> of our customers take
advantage of this in one way or another. Some have custom authentication requirements,
some want to do special handling with posted data and others just want to log certain
activities. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Last year, we released our <a href="http://www.qualitydata.com/solutions/pocket-pc-sharepoint.aspx">Sharepoint
Bridge</a> which is a “shrink wrapped” provider to make our product work with Sharepoint
Portal Server and Windows Sharepoint Services and have attracted a lot of attention
from organizations that wanted an easy way to push mobile data into their existing
Sharepoint-based intranet. This extra capability can be customized and improved on
its own product cycle without ever affecting the functionality of the primary product.
And, as we upgrade our web service with additional features, our custom providers
continue to work.</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Now easier than ever</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">With the release of the .Net Framework
2.0, Microsoft included a base provider class in the framework itself.  We were
able to dump all of our plumbing code and simply inherit our base classes from the
new </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">System.Configuration.Provider.ProviderBase </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">class. 
The various configuration (ConfigurationSection, ProviderCollection, etc.) classes
have also been simplified, so we cleaned up our existing configuration code as well.</span>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 1in">
            <i>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">There are plenty of articles
on MSDN and elsewhere on using the provider model, so it would be redundant for me
to go through all that here. In a future post, I plan provide a real working example
in case anyone wants a nice starter project.</span>
            </i>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Not just for Asp.Net</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">With the release of Visual Studio
2005, Microsoft showed off the new Asp.Net Membership System in just about every presentation
they gave. Everyone was impressed with the instant login and user creation controls
and when Microsoft was asked the question “what if we want to change the implementation”,
they were able to point to the provider-based implementation of their Membership System.
Since there is such a high adoption rate of the Asp.Net Membership System, many folks
associate the term “provider” with the Role, Membership and Profile providers in Asp.Net.
Many programmers will go on to assume that this means the “AspNetSqlRoleProvider”,
“AspNetSqlMembershipProvider” and “AspNetProfileProvider” and lose sight of the fact
that these are just the default (if not the most common) implementations of the base
provider classes.  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">More and more ISV’s are recognizing
that this model is not only useful for supporting unplanned circumstances but will
also become more in demand with the increased adoption rate of Microsoft’s development
platforms.  The investment is minimal and the potential rewards are significant.
As I evaluate new applications, I have gotten into the habit of reading the configuration
files and lately have seen an increased number of “shrink wrap” programs that have
some form of provider-based implementation. One good example is <a href="http://communityserver.org/">Telligent’s
Community Server</a> that appears to have largely been built on base provider classes.
I have not seen much documentation on this but I would assume that Telligent built
it this way so that organizations could swap out some of the implementation. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The provider model works well for
Asp.Net (web) applications since the appropriate provider is loaded once and based
on the settings in Web.Config. It also works well for WinForms applications, although
a change in the application’s configuration file does not automatically cause a running
application to restart and reload a different provider. </span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">From one ISV to another…</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So, if you are an ISV building solutions
on the Microsoft .Net platform, you owe it to yourself to consider a provider-based
implementation of your application. You’ll find you are able to satisfy many unexpected
requirements and not have to saddle your application with extra features that will
need to be optionally disabled in future releases.  Another big benefit is the
additional revenue stream you open up with new add-on products like your “Oracle Provider”
or “SAP Provider”.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I love this subject and, while I
have had a lot of success in actually using it, keep finding there is more to learn.
Your comments are welcome.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=98a72720-e617-4117-9ce7-db3482617e31" />
      </body>
      <title>Why the Provider Model is so important to ISV's</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</guid>
      <link>http://mishler.net/2006/04/14/WhyTheProviderModelIsSoImportantToISVs.aspx</link>
      <pubDate>Fri, 14 Apr 2006 16:25:26 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;As an Independent Software Vendor
(ISV), I make my living writing a software program and (hopefully) selling it many
times. For the most part, the application meets the customer’s requirements right
“out of the box” and if there is a gap, the customer is usually able to work around
it.&amp;nbsp; Every now and then, a potential customer will dangle the carrot out there,
that if certain features are added then they’ll buy a lot of copies. Or, they would
buy it if it could be integrated with their existing XYZ-system.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Now I’m not talking about the practice
of accepting customer suggestions for a systematic improvement of a maturing product.
I’m talking about adding appendages where they just don’t belong. Over the years,
I’ve occasionally succumbed to these pressures and in some cases, the products were
better off for it. Other times, the extra features were like anchors around our feet
as now had customer-specific business rules in our mainstream product.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The Provider Model&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I’m sure the Provider Model has
been around for a while but I first heard the term “Provider” back when Microsoft
was introducing its “Universal Data Access” strategy (I seem to recall this was all
part of the transition to MDAC.)&amp;nbsp; For the next few years, of course, we all used
the “ODBC Provider” or the “SQL Server Provider” in our database applications and
(at least I) did not think much more of it. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 1in"&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In general, the provider model
is a design pattern that allows, through configuration, an alternate provider of application
functionality to be substituted with requiring modification to the primary application.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 1in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;(There’s probably a better text-book
definition for this but my definition suits me just fine)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;A few years back, I read a couple
of articles on MSDN about “Providers” and proceeded to build my own for one of our
products, the &lt;a href="http://www.pocketforms.net/enterprise/Default.aspx"&gt;PocketForms
Web Service&lt;/a&gt;. I was intrigued about the idea of letting customers easily override
the default implementation of any of my web methods and figured this might provide
a nice “catch all” for the occasional special-requirements customer.&amp;nbsp; Back then,
there was no base provider class in the .Net Framework but several good examples were
available for guidance.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I found that most of the work was
actually in setting up various configuration classes that would be used to manage
optional user settings. The application, itself, required some fairly straight-forward
design changes, mainly in creating a new “MustInherit” base class that defined the
interfaces that my existing class already implemented.&amp;nbsp; All-in-all, it took just
a couple of days to retrofit my existing application with this new design pattern.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Fantastic Return on Investment&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I must say that the investment in
learning about and implementing the Provider Model has been one of the best decisions
I have ever made professionally. As it turns out, &lt;i&gt;most&lt;/i&gt; of our customers take
advantage of this in one way or another. Some have custom authentication requirements,
some want to do special handling with posted data and others just want to log certain
activities. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Last year, we released our &lt;a href="http://www.qualitydata.com/solutions/pocket-pc-sharepoint.aspx"&gt;Sharepoint
Bridge&lt;/a&gt; which is a “shrink wrapped” provider to make our product work with Sharepoint
Portal Server and Windows Sharepoint Services and have attracted a lot of attention
from organizations that wanted an easy way to push mobile data into their existing
Sharepoint-based intranet. This extra capability can be customized and improved on
its own product cycle without ever affecting the functionality of the primary product.
And, as we upgrade our web service with additional features, our custom providers
continue to work.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Now easier than ever&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;With the release of the .Net Framework
2.0, Microsoft included a base provider class in the framework itself. &amp;nbsp;We were
able to dump all of our plumbing code and simply inherit our base classes from the
new &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;System.Configuration.Provider.ProviderBase &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;class.&amp;nbsp;
The various configuration (ConfigurationSection, ProviderCollection, etc.) classes
have also been simplified, so we cleaned up our existing configuration code as well.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 1in"&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;There are plenty of articles
on MSDN and elsewhere on using the provider model, so it would be redundant for me
to go through all that here. In a future post, I plan provide a real working example
in case anyone wants a nice starter project.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Not just for Asp.Net&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;With the release of Visual Studio
2005, Microsoft showed off the new Asp.Net Membership System in just about every presentation
they gave. Everyone was impressed with the instant login and user creation controls
and when Microsoft was asked the question “what if we want to change the implementation”,
they were able to point to the provider-based implementation of their Membership System.
Since there is such a high adoption rate of the Asp.Net Membership System, many folks
associate the term “provider” with the Role, Membership and Profile providers in Asp.Net.
Many programmers will go on to assume that this means the “AspNetSqlRoleProvider”,
“AspNetSqlMembershipProvider” and “AspNetProfileProvider” and lose sight of the fact
that these are just the default (if not the most common) implementations of the base
provider classes.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;More and more ISV’s are recognizing
that this model is not only useful for supporting unplanned circumstances but will
also become more in demand with the increased adoption rate of Microsoft’s development
platforms.&amp;nbsp; The investment is minimal and the potential rewards are significant.
As I evaluate new applications, I have gotten into the habit of reading the configuration
files and lately have seen an increased number of “shrink wrap” programs that have
some form of provider-based implementation. One good example is &lt;a href="http://communityserver.org/"&gt;Telligent’s
Community Server&lt;/a&gt; that appears to have largely been built on base provider classes.
I have not seen much documentation on this but I would assume that Telligent built
it this way so that organizations could swap out some of the implementation. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The provider model works well for
Asp.Net (web) applications since the appropriate provider is loaded once and based
on the settings in Web.Config. It also works well for WinForms applications, although
a change in the application’s configuration file does not automatically cause a running
application to restart and reload a different provider. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;From one ISV to another…&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So, if you are an ISV building solutions
on the Microsoft .Net platform, you owe it to yourself to consider a provider-based
implementation of your application. You’ll find you are able to satisfy many unexpected
requirements and not have to saddle your application with extra features that will
need to be optionally disabled in future releases.&amp;nbsp; Another big benefit is the
additional revenue stream you open up with new add-on products like your “Oracle Provider”
or “SAP Provider”.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I love this subject and, while I
have had a lot of success in actually using it, keep finding there is more to learn.
Your comments are welcome.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=98a72720-e617-4117-9ce7-db3482617e31" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</comments>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=afe7b0da-3996-4607-9b07-e6eb913a1471</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=afe7b0da-3996-4607-9b07-e6eb913a1471</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p>
            <span style="FONT-SIZE: 10pt">One of the great things about the Asp.Net Membership
System is that it was designed to snap into many types of enterprise and off-the-shelf
applications to provide a consistent model for common tasks such as authenticating
users.  Several of the database tables (AspNet Users, AspNet Membership and AspNet
Roles) include an “ApplicationID” column, which allows for more than one application
to utilize a single database. Therefore, it is possible for two different users of
two separate applications to have the same username without experiencing a conflict
since the combined ApplicationID &amp; UserName would be distinct.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">A master table, AspNet Applications, includes a list
of the distinct ApplicationID’s which may be in use by the various membership tables. 
Since this field is a “uniqueidentifier” (GUID), a separate string field called “ApplicationName”
is available for looking up the ApplicationID.  The following figure illustrates
a record in the AspNet Applications table that maps an ApplicationName “/” to the
globally unique ApplicationID.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">
              <img height="69" src="http://brian.mishler.net/content/binary/image001.gif" width="402" border="0" />
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The ApplicationName can be nearly any string (up to
256 characters) and is originally defined, not in the database, but as an attribute
of each of the SQL Server providers (AspNetSqlMembershipProvider , AspNetSqlProfileProvider
, AspNetSqlRoleProvider.)  </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The default attributes for each of the AspNet SQL Providers
are defined in machine.config, which is generally stored in c:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config. 
This is an important file that should never be modified so Asp.Net lets you override
any of its settings by simply placing sections of the file into a web.config file
within your web site.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The following is an excerpt from the &lt;system.web&gt;
section of machine.config, which defines the System.Web.Security.SqlMembership provider
as the default provider for handling membership. Notice that one of its attributes,
applicationName, is set to a backslash. </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: black">&lt;system.web&gt;<br />
…<br />
&lt;membership&gt;<br />
 &lt;providers&gt;<br />
&lt;clear /&gt;<br />
&lt;add connectionStringName="LocalSqlServer" 
<br />
enablePasswordRetrieval="false"<br />
enablePasswordReset="true" 
<br />
requiresQuestionAndAnswer="true"<br /></span>
            <strong>applicationName="/"</strong>
            <span style="FONT-SIZE: 10pt">
              <span style="COLOR: black">
                <br />
requiresUniqueEmail="false"<br />
passwordFormat="Hashed" 
<br />
maxInvalidPasswordAttempts="5" 
<br />
minRequiredPasswordLength="7" 
<br />
minRequiredNonalphanumericCharacters="1" 
<br />
passwordAttemptWindow="10" 
<br />
passwordStrengthRegularExpression="" 
<br />
name="AspNetSqlMembershipProvider" 
<br />
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&gt;<br />
&lt;/providers&gt;<br />
&lt;/membership&gt;<br />
…<br />
&lt;/system.web&gt;</span>
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">If you wanted to store data for more than one application
within a single database or if you desired some control over the applicationName which
is used in the AspNet Applications table, you can create a web.config file, in the
root folder of your web site, to override the applicationName that is specified in
machine.config (shown above.)</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The following is an excerpt from web.config. Notice
that &lt;clear /&gt; is used to remove any default providers (such as the one in machine.config)
from memory and that the applicationName has now been set to something more interesting.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: black">&lt;membership&gt;<br />
 &lt;providers&gt;<br />
 &lt;clear /&gt;<br />
 &lt;add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" <br />
enablePasswordReset="true" 
<br />
requiresQuestionAndAnswer="true"<br /></span>
            <strong>applicationName="myCustomApp" </strong>
            <b>
              <span style="FONT-SIZE: 10pt">
                <br />
              </span>
            </b>
            <span style="FONT-SIZE: 10pt; COLOR: black">requiresUniqueEmail="false" 
<br />
passwordFormat="Hashed" 
<br />
maxInvalidPasswordAttempts="5" 
<br />
minRequiredPasswordLength="7" 
<br />
minRequiredNonalphanumericCharacters="1" 
<br />
passwordAttemptWindow="10" 
<br />
passwordStrengthRegularExpression="" 
<br />
name="AspNetSqlMembershipProvider" 
<br />
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&gt;<br />
 &lt;/providers&gt;<br />
 &lt;/membership&gt;</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Assuming you have already been running the web application,
there is likely a pre-existing record in the AspNet Applications table as well as
records in the other membership (AspNet Membership, AspNet Users, AspNet Roles) tables
that correspond to the ApplicationID for “/”.  So guess what happens in the database
the first time the application is run after changing the ApplicationName in web.config?</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">
              <img height="88" src="http://brian.mishler.net/content/binary/image002.gif" width="403" border="0" />
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">As shown here, a new record, along with a new ApplicationID,
has been generated by the provider. All of your existing data including membership,
users and roles is still stamped with the original ApplicationID and therefore inaccessible
by your provider. This is not a flaw in the system or an oversight on the part of
Microsoft. It is simply something you must understand if you intend to modify the
applicationName attribute on your provider configuration settings.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Let’s say you have some existing membership records
and wish to associate them with the new ApplicationName/ApplicationID. This is very
simple to accomplish by issuing the following statements in SQL Server:</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: gray">UPDATE AspNet Membership SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: gray">UPDATE AspNet Users SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: gray">UPDATE AspNet Roles SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">(Please substitute the appropriate GUID for “new-application-id”
and “old-application-id”)</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The SQLMembership provider’s foreign-key constraints
will prevent you from deleting the original AspNet Applications record for “/” until
you have successfully modified the ApplicationID values in each of the membership
tables.  Assuming that you performed the suggested updates then successfully
deleted the record in AspNet Applications for “/”, can you see how a new record, again
with a backslash “/” in the ApplicationName field, might be re-created the next time
you run the web application?</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Other providers, such as the AspNetSqlRoleProvider and
the AspNetSqlProfileProvider also define default behaviors in machine.config and therein,
the attribute for applicationName is “/” by default.  If you use roles or profiles
in your web application, be sure to override the default implementation for all three
AspNet providers in web.config as appropriate for your solution.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=afe7b0da-3996-4607-9b07-e6eb913a1471" />
      </body>
      <title>Asp.Net Provider Model: ApplicationNames and the ApplicationID</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</guid>
      <link>http://mishler.net/2006/04/06/AspNetProviderModelApplicationNamesAndTheApplicationID.aspx</link>
      <pubDate>Thu, 06 Apr 2006 02:04:54 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;One of the great things about the Asp.Net Membership
System is that it was designed to snap into many types of enterprise and off-the-shelf
applications to provide a consistent model for common tasks such as authenticating
users.&amp;nbsp; Several of the database tables (AspNet Users, AspNet Membership and AspNet
Roles) include an “ApplicationID” column, which allows for more than one application
to utilize a single database. Therefore, it is possible for two different users of
two separate applications to have the same username without experiencing a conflict
since the combined ApplicationID &amp;amp; UserName would be distinct.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;A master table, AspNet Applications, includes a list
of the distinct ApplicationID’s which may be in use by the various membership tables.&amp;nbsp;
Since this field is a “uniqueidentifier” (GUID), a separate string field called “ApplicationName”
is available for looking up the ApplicationID.&amp;nbsp; The following figure illustrates
a record in the AspNet Applications table that maps an ApplicationName “/” to the
globally unique ApplicationID.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=69 src="http://brian.mishler.net/content/binary/image001.gif" width=402 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The ApplicationName can be nearly any string (up to
256 characters) and is originally defined, not in the database, but as an attribute
of each of the SQL Server providers (AspNetSqlMembershipProvider , AspNetSqlProfileProvider
, AspNetSqlRoleProvider.)&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The default attributes for each of the AspNet SQL Providers
are defined in machine.config, which is generally stored in c:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.&amp;nbsp;
This is an important file that should never be modified so Asp.Net lets you override
any of its settings by simply placing sections of the file into a web.config file
within your web site.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The following is an excerpt from the &amp;lt;system.web&amp;gt;
section of machine.config, which defines the System.Web.Security.SqlMembership provider
as the default provider for handling membership. Notice that one of its attributes,
applicationName, is set to a backslash. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black"&gt;&amp;lt;system.web&amp;gt;&lt;br&gt;
…&lt;br&gt;
&amp;lt;membership&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;providers&amp;gt;&lt;br&gt;
&amp;lt;clear /&amp;gt;&lt;br&gt;
&amp;lt;add connectionStringName="LocalSqlServer" 
&lt;br&gt;
enablePasswordRetrieval="false"&lt;br&gt;
enablePasswordReset="true" 
&lt;br&gt;
requiresQuestionAndAnswer="true"&lt;br&gt;
&lt;/span&gt;&lt;strong&gt;applicationName="/"&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: black"&gt;
&lt;br&gt;
requiresUniqueEmail="false"&lt;br&gt;
passwordFormat="Hashed" 
&lt;br&gt;
maxInvalidPasswordAttempts="5" 
&lt;br&gt;
minRequiredPasswordLength="7" 
&lt;br&gt;
minRequiredNonalphanumericCharacters="1" 
&lt;br&gt;
passwordAttemptWindow="10" 
&lt;br&gt;
passwordStrengthRegularExpression="" 
&lt;br&gt;
name="AspNetSqlMembershipProvider" 
&lt;br&gt;
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&amp;gt;&lt;br&gt;
&amp;lt;/providers&amp;gt;&lt;br&gt;
&amp;lt;/membership&amp;gt;&lt;br&gt;
…&lt;br&gt;
&amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;If you wanted to store data for more than one application
within a single database or if you desired some control over the applicationName which
is used in the AspNet Applications table, you can create a web.config file, in the
root folder of your web site, to override the applicationName that is specified in
machine.config (shown above.)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The following is an excerpt from web.config. Notice
that &amp;lt;clear /&amp;gt; is used to remove any default providers (such as the one in machine.config)
from memory and that the applicationName has now been set to something more interesting.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black"&gt;&amp;lt;membership&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;providers&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;clear /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"&amp;nbsp;&lt;br&gt;
enablePasswordReset="true" 
&lt;br&gt;
requiresQuestionAndAnswer="true"&lt;br&gt;
&lt;/span&gt;&lt;strong&gt;applicationName="myCustomApp" &lt;/strong&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt"&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black"&gt;requiresUniqueEmail="false" 
&lt;br&gt;
passwordFormat="Hashed" 
&lt;br&gt;
maxInvalidPasswordAttempts="5" 
&lt;br&gt;
minRequiredPasswordLength="7" 
&lt;br&gt;
minRequiredNonalphanumericCharacters="1" 
&lt;br&gt;
passwordAttemptWindow="10" 
&lt;br&gt;
passwordStrengthRegularExpression="" 
&lt;br&gt;
name="AspNetSqlMembershipProvider" 
&lt;br&gt;
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;/providers&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;/membership&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Assuming you have already been running the web application,
there is likely a pre-existing record in the AspNet Applications table as well as
records in the other membership (AspNet Membership, AspNet Users, AspNet Roles) tables
that correspond to the ApplicationID for “/”.&amp;nbsp; So guess what happens in the database
the first time the application is run after changing the ApplicationName in web.config?&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=88 src="http://brian.mishler.net/content/binary/image002.gif" width=403 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;As shown here, a new record, along with a new ApplicationID,
has been generated by the provider. All of your existing data including membership,
users and roles is still stamped with the original ApplicationID and therefore inaccessible
by your provider. This is not a flaw in the system or an oversight on the part of
Microsoft. It is simply something you must understand if you intend to modify the
applicationName attribute on your provider configuration settings.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Let’s say you have some existing membership records
and wish to associate them with the new ApplicationName/ApplicationID. This is very
simple to accomplish by issuing the following statements in SQL Server:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray"&gt;UPDATE AspNet Membership SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray"&gt;UPDATE AspNet Users SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray"&gt;UPDATE AspNet Roles SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;(Please substitute the appropriate GUID for “new-application-id”
and “old-application-id”)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The SQLMembership provider’s foreign-key constraints
will prevent you from deleting the original AspNet Applications record for “/” until
you have successfully modified the ApplicationID values in each of the membership
tables.&amp;nbsp; Assuming that you performed the suggested updates then successfully
deleted the record in AspNet Applications for “/”, can you see how a new record, again
with a backslash “/” in the ApplicationName field, might be re-created the next time
you run the web application?&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Other providers, such as the AspNetSqlRoleProvider and
the AspNetSqlProfileProvider also define default behaviors in machine.config and therein,
the attribute for applicationName is “/” by default.&amp;nbsp; If you use roles or profiles
in your web application, be sure to override the default implementation for all three
AspNet providers in web.config as appropriate for your solution.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=afe7b0da-3996-4607-9b07-e6eb913a1471" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</comments>
      <category>Asp.Net Providers</category>
    </item>
  </channel>
</rss>