Custom web.config Intellisense

(This is a part of my series Visual Studio Tips and Tricks – III )

There are at times when you would like to have intellisense support for you custom providers like the ones Microsoft provides.

In this post, I will be guiding you on the way how to create a basic intellisense for your BlogEngine.NET provider model for web.config.

You can open your BlogEngine.NET sourcecode or any of your websites to try it. But in this tutorial I will be sticking with BlogEngine.NET source code.

<BlogEngine>
  <blogProvider defaultProvider="XmlBlogProvider">
	<providers>
<add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
<add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
	</providers>
  </blogProvider>
</BlogEngine>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="blogengine"
targetNamespace=
"http://schemas.prabir.me/blogengine/2009/5"
elementFormDefault="qualified"
xmlns="http://tempuri.org/blogengine.xsd"
xmlns:mstns="http://tempuri.org/blogengine.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:element name="BlogEngine">
  <xs:complexType>
  <xs:sequence>
  <xs:element name="blogProvider" minOccurs="1">
  <xs:complexType>
  <xs:sequence>
  <xs:element name="providers" minOccurs="1" maxOccurs="unbounded">
  <xs:complexType>
  <xs:sequence>
  <xs:element name="add" minOccurs="1" maxOccurs="unbounded">
  <xs:complexType>
  <xs:attribute name="name" type="xs:string" use="required" />
  <xs:attribute name="type" type="xs:string" use="required" />

  <xs:attribute name="connectionStringName" type="xs:string" use="optional" />

  </xs:complexType>
  </xs:element>
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:sequence>
  <xs:attribute name="defaultProvider" type="xs:string"/>
  </xs:complexType>
  </xs:element>
  </xs:sequence>
  </xs:complexType>
  </xs:element>
</xs:schema>
<BlogEngine xmlns="http://schemas.prabir.me/blogengine/2009/5">

custom_webconfig_intellisense.zip (3.65 kb)