<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Visual Studio SharePoint Development Blog</title><subtitle type="html" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/vssharepointtoolsblog/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2010-06-17T12:29:00Z</updated><entry><title>Update Your Links - We’ve Moved!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2011/02/10/update-your-links-we-ve-moved.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2011/02/10/update-your-links-we-ve-moved.aspx</id><published>2011-02-10T19:15:19Z</published><updated>2011-02-10T19:15:19Z</updated><content type="html">&lt;p&gt;To make it easy for developers to make sure they're getting all the latest technical information around developing SharePoint solutions, the SharePoint, Visual Studio and Office User Assistance teams have decided to combine their blogging efforts into the new &lt;a href="http://blogs.msdn.com/sharepointdev/"&gt;&lt;span style="color:#0066dd"&gt;&lt;strong&gt;SharePoint Developer Team Blog&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;. Think of it as your one-stop shop for developer-centric SharePoint information, straight from the product teams and user assistance folk responsible for SharePoint Foundation, Server, SharePoint Online, and the SharePoint development tools in Visual Studio.
&lt;/p&gt;&lt;p&gt;Here's what you can expect from our new blog going forward:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Regular, detailed technical information on SharePoint development, such as walkthroughs and code samples, from the people who designed those product features and tools
&lt;/li&gt;&lt;li&gt;Early, first-look versions of content being prepared for publication to MSDN
&lt;/li&gt;&lt;li&gt;Cross-posts and pointers to SharePoint-centric developer content on other specialized blogs
&lt;/li&gt;&lt;li&gt;Announcements of interest to SharePoint developers, such as content updates, service releases, or developer events.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So we're hoping you'll subscribe, and pass the following easy-to-remember URL on to your SharePoint developer friends and colleagues:
&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/sharepointdev/"&gt;&lt;span style="color:#0066dd; font-size:16pt"&gt;&lt;strong&gt;http://blogs.msdn.com/sharepointdev/&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:16pt"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;And if there are particular things you'd like to see covered or discussed, by all means leave us a comment on our new consolidated blog!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10127573" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Even More Resources for SharePoint Developers</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/10/06/even-more-resources-for-sharepoint-developers.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/10/06/even-more-resources-for-sharepoint-developers.aspx</id><published>2010-10-06T21:30:30Z</published><updated>2010-10-06T21:30:30Z</updated><content type="html">&lt;p&gt;Kemp first shared a lengthy list of SharePoint developer resources at &lt;a title="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/12/resources-for-visual-studio-tools-for-sharepoint-developers.aspx" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/12/resources-for-visual-studio-tools-for-sharepoint-developers.aspx"&gt;http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/12/resources-for-visual-studio-tools-for-sharepoint-developers.aspx&lt;/a&gt;. In addition to these, there are articles and videos that are published in the &lt;a href="http://msdn.microsoft.com/en-us/library/ff598603.aspx"&gt;Technical Articles&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ff598601.aspx"&gt;Visual How Tos&lt;/a&gt; nodes. In addition to the documentation, technical articles, and visual how-tos, you can also read &lt;a href="http://msdn.microsoft.com/en-us/library/ff742317.aspx"&gt;Book Excerpts&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ff598602.aspx"&gt;Quick Notes&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here is a list of recent visual how-to videos that demonstrate how to use the SharePoint developer tools in Visual Studio. Click on the screenshot to view the visual how-to.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/gg131919.aspx"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/2664.image_5F00_4A2514D6.png" width="336" height="245" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://msdn.microsoft.com/en-us/library/gg241249.aspx"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/4130.image_5F00_62487F31.png" width="337" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/gg276355.aspx"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/6371.image_5F00_09169572.png" width="338" height="242" /&gt;&lt;/a&gt;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://msdn.microsoft.com/en-us/library/gg276356.aspx"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5707.image_5F00_33EEF984.png" width="340" height="245" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There are several more visual how-to articles and more posted each month, so be sure to check out the &lt;a href="http://msdn.microsoft.com/en-us/library/ff598603.aspx"&gt;Technical Articles&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ff598601.aspx"&gt;Visual How Tos&lt;/a&gt; nodes regularly. Alternatively, you can visit the &lt;a href="http://msdn.com/sharepoint"&gt;SharePoint Developer Center&lt;/a&gt; where there is an RSS feed called &lt;a href="http://www.microsoft.com/feeds/msdn/en-us/sharepoint/rss.xml"&gt;Recently Published Content&lt;/a&gt;, or even add the feed to your favorite RSS reader.&lt;/p&gt;    &lt;p&gt;Mary Lee, Programming Writer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10072448" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="VS2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/VS2010/" /><category term="Visual Studio 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+2010/" /><category term="VisualStudio2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/VisualStudio2010/" /><category term="Mary Lee" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Mary+Lee/" /></entry><entry><title>Check out the new SharePoint in Pictures blog</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/10/05/check-out-sharepoint-in-pictures.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/10/05/check-out-sharepoint-in-pictures.aspx</id><published>2010-10-06T00:44:45Z</published><updated>2010-10-06T00:44:45Z</updated><content type="html">&lt;p&gt;There is a new blog called &lt;a href="http://blogs.msdn.com/b/sharepointpictures/"&gt;SharePoint in Pictures&lt;/a&gt; that illustrates the platform and architecture of SharePoint Foundation 2010 and SharePoint Server 2010.&amp;#160; The blog is to be updated on a weekly basis with new diagrams, so feel free to check it out and leave feedback about what you’d like to see in the near future.&lt;/p&gt;  &lt;p&gt;Mary Lee, Programming Writer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10071969" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="SharePoint Server 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint+Server+2010/" /><category term="SharePoint2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint2010/" /><category term="Mary Lee" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Mary+Lee/" /></entry><entry><title>Resources for Visual Studio Tools for SharePoint Developers</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/12/resources-for-visual-studio-tools-for-sharepoint-developers.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/12/resources-for-visual-studio-tools-for-sharepoint-developers.aspx</id><published>2010-08-12T19:53:05Z</published><updated>2010-08-12T19:53:05Z</updated><content type="html">&lt;p class="MsoNormal" style="line-height: 13.5pt; margin: 0in 0in 10pt -10.5pt; padding-left: 30px; background: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;Nearly all of the tools for SharePoint development included in Visual Studio 2010 are new, so learning about them and&amp;nbsp;finding help and information can be a challenge. To help you in this quest, I&amp;rsquo;ve compiled a list of links to helpful resources, including product documentation, web sites, forums, and blogs. As new resources become available, I&amp;rsquo;ll add them to the list. If you know of any other sites you think others would find useful, feel free to add them to the comments and I&amp;rsquo;ll periodically update the list.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 24.0pt; mso-font-kerning: 18.0pt"&gt;Learning&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-size: 24.0pt; mso-font-kerning: 18.0pt"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;For learning about the Visual Studio 2010 tools for SharePoint Development, check out the new Help topics. The portal page for these is: &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194450"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint Development in Visual Studio&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;V&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;isual Studio provides tools for developing SharePoint sites. To find out more about how SharePoint itself works, start at the portal page: &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194451"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint 2010&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp; For those who don&amp;rsquo;t know, there are two versions of SharePoint: &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194452"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint Foundation 2010&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; (formerly known as Windows SharePoint Services, or WSS) and &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194453"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint Server 2010&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; (formerly known as Microsoft Office SharePoint Server, or MOSS).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;To learn about extending the Visual Studio SharePoint tools, including how to create your own SharePoint project and project item templates, see &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194460"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Extending the SharePoint Tools in Visual Studio&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;For details about the Visual Studio SharePoint project system API, see &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194461"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Reference (SharePoint Tools Extensibility)&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Courier New'; COLOR: #333333; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-fareast-font-family: 'Courier New'; mso-bidi-font-size: 9.0pt"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://channel9.msdn.com/"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Channel 9&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; features videos relating to SharePoint and SharePoint tools, including a great comprehensive (and free!)&amp;nbsp;&lt;/span&gt;&lt;a href="http://channel9.msdn.com/learn/courses/SharePoint2010Developer/"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint 2010 Developer Training Course&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Courier New'; COLOR: #333333; FONT-SIZE: 10pt; mso-ansi-language: EN; mso-fareast-font-family: 'Courier New'; mso-bidi-font-size: 9.0pt"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;Because SharePoint sites are built on &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194454"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;ASP.NET&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; and &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194456"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;IIS&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;, having a deeper understanding of those technologies&amp;nbsp;is useful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt"&gt;Blogs&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;In addition to this blog (&lt;i&gt;Visual Studio SharePoint Development Blog&lt;/i&gt;), there is a blog for SharePoint called the &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194457"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Microsoft SharePoint Team Blog&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; that focuses on SharePoint development-related questions and issues.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;Although though the list is dated, many of the blogs in &lt;/span&gt;&lt;a href="http://www.sharepointjoel.com/Lists/Posts/Post.aspx?ID=31"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint Joel&amp;rsquo;s Top 100 SharePoint Blogs of Spring 2008&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; are still active and involved in SharePoint 2010 development.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt"&gt;Forums and Newsgroups&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;The official forum for Visual Studio SharePoint is located at &lt;/span&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vssharepointdevelopment/threads"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint Development with Visual Studio&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;The official forum for SharePoint 2010 is located at &lt;/span&gt;&lt;a href="http://social.technet.microsoft.com/Forums/en-US/category/sharepoint2010"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint 2010 Forum&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;The SharePoint Usenet groups are located at &lt;/span&gt;&lt;a href="http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.sharepoint"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Microsoft.Public.SharePoint&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt"&gt;Other Resources&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 14pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;The &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/bb964529.aspx"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;SharePoint 2010 Developer Resource Centers&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; page has a centralized list of resources for common tasks such as upgrading, best practices, and security.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;For code samples relating to SharePoint and SharePoint tools, see the &lt;/span&gt;&lt;a href="http://code.msdn.microsoft.com/"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;MSDN Code Gallery&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;Information about upgrading and migrating to SharePoint 2010 can be found at: &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ee514557.aspx"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Upgrade Resource Center | SharePoint 2010&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;For a large list of resources relating to earlier versions of SharePoint, see &lt;/span&gt;&lt;a href="http://heathersolomon.com/blog/articles/148.aspx#News"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;Heather Solomon&amp;rsquo;s SharePoint Resources&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt; page.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;/span&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;To query the Microsoft Knowledge Base about SharePoint and Visual Studio issues, see &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/aa570318.aspx"&gt;&lt;b&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #0066dd; FONT-SIZE: 9pt; TEXT-DECORATION: none; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'; text-underline: none"&gt;MSDN Troubleshooting and Support&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt; BACKGROUND: white; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-line-height-alt: 13.5pt; mso-outline-level: 1"&gt;&lt;span lang="EN" style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #333333; FONT-SIZE: 9pt; mso-ansi-language: EN; mso-fareast-font-family: 'Times New Roman'"&gt;Kemp Brown &lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10049538" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="General" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/General/" /><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="Visual Studio 10" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+10/" /><category term="VS2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/VS2010/" /><category term="SharePoint Server 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint+Server+2010/" /><category term="Visual Studio 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+2010/" /><category term="resources" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/resources/" /><category term="learning" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/learning/" /><category term="blogs" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/blogs/" /></entry><entry><title>Walkthrough of creating association between Sharepoint BDC entities using Visual Studio 2010</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/02/walkthrough-of-creating-association-between-sharepoint-bdc-entities-using-visual-studio-2010.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/02/walkthrough-of-creating-association-between-sharepoint-bdc-entities-using-visual-studio-2010.aspx</id><published>2010-08-03T02:17:02Z</published><updated>2010-08-03T02:17:02Z</updated><content type="html">&lt;p&gt;Up till now, we have published two blogs in this series about SharePoint 2010 external list, &lt;a href="http://blogs.msdn.com/sharepoint/archive/2009/12/03/walkthrough-of-creating-a-sharepoint-2010-external-list-using-visual-studio-2010-beta.aspx"&gt;Walkthrough of creating a SharePoint 2010 external list using Visual Studio 2010 Beta&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/sharepoint/archive/2010/03/01/walkthrough-of-enabling-crud-for-sharepoint-2010-external-lists-using-visual-studio-2010.aspx"&gt;Walkthrough of enabling CRUD for SharePoint 2010 external lists using Visual Studio 2010&lt;/a&gt;. Now you are able to create external list and add basic CRUD functions. In this blog we will show how to create Association between Sharepoint BDC entities using Visual Studio 2010 and use Business Data Web Parts to display the data and the association in SharePoint page.&lt;/p&gt;  &lt;p&gt;The same as our second blog, we will use “Northwind” database as external data source, so if you do not have an existing “Northwind” database available, please download it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;amp;displaylang=en"&gt;here&lt;/a&gt; and install the sample database following the instruction of the installed package or our last blog &lt;a href="http://blogs.msdn.com/sharepoint/archive/2010/03/01/walkthrough-of-enabling-crud-for-sharepoint-2010-external-lists-using-visual-studio-2010.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you have not read the first two blog entries, we recommend you read them before going through the following content, since this article is highly relevant with previous ones. The first several parts are very similar with the last &lt;a href="http://blogs.msdn.com/sharepoint/archive/2010/03/01/walkthrough-of-enabling-crud-for-sharepoint-2010-external-lists-using-visual-studio-2010.aspx"&gt;blog&lt;/a&gt;, so they are simplified to only contain useful information. Please refer to the previous articles for any ambiguity.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;Create BDC Project&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;First of all, let’s create a new &lt;b&gt;C# BDC Model project &lt;/b&gt;and rename it “&lt;b&gt;BdcAssociationSample&lt;/b&gt;”&lt;b&gt;.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;Connect to external data source&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Add a &lt;a href="http://msdn.microsoft.com/en-us/library/bb386976.aspx"&gt;LINQ to SQL&lt;/a&gt; model and drag-and-drop both &lt;b&gt;Customers&lt;/b&gt; and &lt;b&gt;Orders&lt;/b&gt; tables of &lt;b&gt;Northwind&lt;/b&gt; database from the &lt;b&gt;Server Explorer&lt;/b&gt;. Right click on the LINQ to SQL item and click &lt;b&gt;View Code&lt;/b&gt;, and insert the following code.&lt;/p&gt;  &lt;p&gt;C#:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:281eb06c-9d6e-43b2-a0c9-e1b4dda0e296" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 650px; height: 150px;background-color:White;overflow: auto;"&gt;&lt;div&gt;&lt;!--

code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt; 1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;partial&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 2&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 3&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; ConnectionString &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;@&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Data Source=localhost\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;Pooling=False&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 4&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 5&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomerDataContext() :
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 6&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;base&lt;/span&gt;&lt;span style="color: #000000;"&gt;(ConnectionString, mappingSource)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 7&lt;/span&gt; &lt;span style="color: #000000;"&gt;    {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 8&lt;/span&gt; &lt;span style="color: #000000;"&gt;        OnCreated();
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 9&lt;/span&gt; &lt;span style="color: #000000;"&gt;    }
&lt;/span&gt;&lt;span style="color: #008080;"&gt;10&lt;/span&gt; &lt;span style="color: #000000;"&gt;}&lt;/span&gt;&lt;/!--

code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/!--&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;p&gt;VB:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:e66e236e-fe45-4758-a207-0d8d8a95d9b4" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 650px; height: 150px;background-color:White;overflow: auto;"&gt;&lt;div&gt;&lt;!--

code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt;1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;Partial&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Class&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Const&lt;/span&gt;&lt;span style="color: #000000;"&gt; ConnectionString &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;String&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Data Source=localhost\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;Pooling=False&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;3&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Sub&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt;()
&lt;/span&gt;&lt;span style="color: #008080;"&gt;4&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;MyBase&lt;/span&gt;&lt;span style="color: #000000;"&gt;.New(ConnectionString, mappingSource)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;5&lt;/span&gt; &lt;span style="color: #000000;"&gt;        OnCreated()
&lt;/span&gt;&lt;span style="color: #008080;"&gt;6&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Sub&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;7&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Class&lt;/span&gt;&lt;/!--

code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/!--&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Design BDC Model&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Design the &lt;b&gt;Customer&lt;/b&gt; and &lt;b&gt;Order&lt;/b&gt; entities according to the &lt;a href="http://msdn.microsoft.com/en-us/library/bb386976.aspx"&gt;LINQ to SQL&lt;/a&gt; model. To simply the problem, we only define &lt;b&gt;Specific Finder&lt;/b&gt; method and &lt;b&gt;Finder&lt;/b&gt; method for both of the entities.&lt;/p&gt;

&lt;p&gt;After this step, we get two entities as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/6445.clip_5F00_image001_5F00_51432394.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/4863.clip_5F00_image001_5F00_thumb_5F00_1DD73A6B.png" width="416" height="172" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;b&gt;TypeDescriptors&lt;/b&gt; in BDC Explorer are like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/3660.clip_5F00_image002_5F00_7952D4B9.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="clip_image002" border="0" alt="clip_image002" align="left" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/8055.clip_5F00_image002_5F00_thumb_5F00_22E69FED.png" width="215" height="288" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/0636.clip_5F00_image003_5F00_7A67BDD8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5822.clip_5F00_image003_5F00_thumb_5F00_589BE547.png" width="217" height="336" /&gt;&lt;/a&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Add Association between Customer and Order&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Now we can create an association by selecting &lt;b&gt;Association&lt;/b&gt; tool in the Visual Studio &lt;b&gt;Toolbox&lt;/b&gt;, clicking the first entity &lt;b&gt;Customer&lt;/b&gt; (called the source entity) and then clicking the second entity &lt;b&gt;Order&lt;/b&gt; (called the destination entity). You can define the details of the association in the popped out &lt;b&gt;Association Editor&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;By default, the &lt;b&gt;Association Editor&lt;/b&gt; adds an Association Navigation method to the source and destination entities. An Association Navigation method in the source entity enables consumers to retrieve a list of destination entities. An Association Navigation method in the destination entity enables consumers to retrieve the source entity that relates to a destination entity. &lt;/p&gt;

&lt;p&gt;You can create two types of associations in the BDC designer: &lt;b&gt;foreign key-based associations&lt;/b&gt; and &lt;b&gt;foreign keyless associations&lt;/b&gt;. For detailed information, check out &lt;a href="http://msdn.microsoft.com/en-us/library/ee348596(VS.100).aspx"&gt;this&lt;/a&gt; on MSDN.&lt;/p&gt;

&lt;p&gt;Now we are creating a foreign key-based associations. So check&lt;b&gt; Is Foreign Key Association &lt;/b&gt;checkbox and find &lt;b&gt;ReadItem.order.Order.CustomerID&lt;/b&gt; in the left column of the Identifier Mapping gird, and then select &lt;b&gt;CustomerID&lt;/b&gt; from the Source ID column on the right to map the identifier. Now the dialog looks like below: &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/8561.clip_5F00_image004_5F00_450E85A6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5305.clip_5F00_image004_5F00_thumb_5F00_73385B93.png" width="572" height="591" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;b&gt;OK&lt;/b&gt; to finish the association creation. On the design surface we get an association &lt;b&gt;CustomerToOrderAssociation&lt;/b&gt; which connects two entities with a dotted line.&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5327.clip_5F00_image005_5F00_2627EBFB.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/4331.clip_5F00_image005_5F00_thumb_5F00_64AD39A1.png" width="535" height="179" /&gt;&lt;/a&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Add code behind to access external data source&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;In &lt;b&gt;Solution Explorer&lt;/b&gt;, find and open &lt;b&gt;CustomerService.cs (.vb)&lt;/b&gt;, and then replace the implementation with the following code snippet:&lt;/p&gt;

&lt;p&gt;C#:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:f97a37b4-abb8-4351-9fda-06173298139b" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 650px; height: 275px;background-color:White;overflow: auto;"&gt;&lt;div&gt;&lt;!--

code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt; 1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; Customer ReadItem(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 2&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 3&lt;/span&gt; &lt;span style="color: #000000;"&gt;    CustomersAndOrdersDataContext context &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext ();
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 4&lt;/span&gt; &lt;span style="color: #000000;"&gt;    Customer cust &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Customers.Single(c &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; c.CustomerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 5&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 6&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; cust;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 7&lt;/span&gt; &lt;span style="color: #000000;"&gt;}
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 8&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 9&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Customer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; ReadList()
&lt;/span&gt;&lt;span style="color: #008080;"&gt;10&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt;11&lt;/span&gt; &lt;span style="color: #000000;"&gt;    CustomersAndOrdersDataContext context &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext ();
&lt;/span&gt;&lt;span style="color: #008080;"&gt;12&lt;/span&gt; &lt;span style="color: #000000;"&gt;    IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Customer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; custList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Customers;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;13&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; custList;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;14&lt;/span&gt; &lt;span style="color: #000000;"&gt;}
&lt;/span&gt;&lt;span style="color: #008080;"&gt;15&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;16&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Order&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomerToOrder(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;17&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt;18&lt;/span&gt; &lt;span style="color: #000000;"&gt;    CustomersAndOrdersDataContext context &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext();
&lt;/span&gt;&lt;span style="color: #008080;"&gt;19&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;20&lt;/span&gt; &lt;span style="color: #000000;"&gt;    IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Order&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders.Where(o &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; o.CustomerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;21&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;22&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderList;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;23&lt;/span&gt; &lt;span style="color: #000000;"&gt;}&lt;/span&gt;&lt;/!--

code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/!--&gt;&lt;/div&gt;

&lt;p&gt;VB:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:a6694078-e54f-410f-a43e-a0e4543cbcb7" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 650px; height: 275px;background-color:White;overflow: auto;"&gt;&lt;div&gt;&lt;!--

code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt; 1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Shared&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt;&lt;span style="color: #000000;"&gt; ReadItem(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;ByVal&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;String&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; Customer
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 2&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; context &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 3&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 4&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; cust &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (From c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;In&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Customers _
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 5&lt;/span&gt; &lt;span style="color: #000000;"&gt;               Where c.CustomerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID _
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 6&lt;/span&gt; &lt;span style="color: #000000;"&gt;               &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Select&lt;/span&gt;&lt;span style="color: #000000;"&gt; c).Single()
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 7&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Return&lt;/span&gt;&lt;span style="color: #000000;"&gt; cust
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 8&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Function&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 9&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;10&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Shared&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt;&lt;span style="color: #000000;"&gt; ReadList() &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Of&lt;/span&gt;&lt;span style="color: #000000;"&gt; Customer)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;11&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; context &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt;12&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;13&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Return&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Customers
&lt;/span&gt;&lt;span style="color: #008080;"&gt;14&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Function&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;15&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;16&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Shared&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomerToOrder(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;ByVal&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;String&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Of&lt;/span&gt;&lt;span style="color: #000000;"&gt; Order)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;17&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; context &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt;18&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;19&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; From o &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;In&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders _
&lt;/span&gt;&lt;span style="color: #008080;"&gt;20&lt;/span&gt; &lt;span style="color: #000000;"&gt;                    Where o.CustomerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID _
&lt;/span&gt;&lt;span style="color: #008080;"&gt;21&lt;/span&gt; &lt;span style="color: #000000;"&gt;                    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Select&lt;/span&gt;&lt;span style="color: #000000;"&gt; o
&lt;/span&gt;&lt;span style="color: #008080;"&gt;22&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Return&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderList
&lt;/span&gt;&lt;span style="color: #008080;"&gt;23&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Function&lt;/span&gt;&lt;/!--

code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/!--&gt;&lt;/div&gt;

&lt;p&gt;Then open and do the same for &lt;b&gt;OrderService.cs (.vb).&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;C#:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:c5494f4c-4bfe-4d1d-a6e2-4cae768f9d62" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 650px; height: 275px;background-color:White;overflow: auto;"&gt;&lt;div&gt;&lt;!--

code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt; 1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; Order ReadItem(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 2&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 3&lt;/span&gt; &lt;span style="color: #000000;"&gt;    CustomersAndOrdersDataContext context &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext();
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 4&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 5&lt;/span&gt; &lt;span style="color: #000000;"&gt;    Order order &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders.Single(o &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; o.OrderID &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 6&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 7&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; order;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 8&lt;/span&gt; &lt;span style="color: #000000;"&gt;}
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 9&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;10&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Order&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; ReadList()
&lt;/span&gt;&lt;span style="color: #008080;"&gt;11&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt;12&lt;/span&gt; &lt;span style="color: #000000;"&gt;    CustomersAndOrdersDataContext context &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext();
&lt;/span&gt;&lt;span style="color: #008080;"&gt;13&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;14&lt;/span&gt; &lt;span style="color: #000000;"&gt;    IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Order&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;15&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;16&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderList;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;17&lt;/span&gt; &lt;span style="color: #000000;"&gt;}
&lt;/span&gt;&lt;span style="color: #008080;"&gt;18&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;19&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Customer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; OrderToCustomer(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;20&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt;21&lt;/span&gt; &lt;span style="color: #000000;"&gt;    CustomersAndOrdersDataContext context &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext();
&lt;/span&gt;&lt;span style="color: #008080;"&gt;22&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;23&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders.Single(o &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; o.OrderID &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID).CustomerID;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;24&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;25&lt;/span&gt; &lt;span style="color: #000000;"&gt;    IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Customer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; custList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Customers.Where(c &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; c.CustomerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;26&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;27&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; custList;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;28&lt;/span&gt; &lt;span style="color: #000000;"&gt;}&lt;/span&gt;&lt;/!--

code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/!--&gt;&lt;/div&gt;

&lt;p&gt;VB:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:53148261-472e-4863-9f9d-84ef970a4434" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 650px; height: 275px;background-color:White;overflow: auto;"&gt;&lt;div&gt;&lt;!--

code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt; 1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Shared&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt;&lt;span style="color: #000000;"&gt; ReadItem(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;ByVal&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Integer&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; Order
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 2&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; context &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 3&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 4&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; order &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (From o &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;In&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders _
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 5&lt;/span&gt; &lt;span style="color: #000000;"&gt;               Where o.OrderID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID _
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 6&lt;/span&gt; &lt;span style="color: #000000;"&gt;               &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Select&lt;/span&gt;&lt;span style="color: #000000;"&gt; o).Single()
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 7&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Return&lt;/span&gt;&lt;span style="color: #000000;"&gt; order
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 8&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Function&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 9&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;10&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Shared&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt;&lt;span style="color: #000000;"&gt; ReadList() &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Of&lt;/span&gt;&lt;span style="color: #000000;"&gt; Order)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;11&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; context &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt;12&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;13&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Return&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders
&lt;/span&gt;&lt;span style="color: #008080;"&gt;14&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Function&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;15&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;16&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Shared&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt;&lt;span style="color: #000000;"&gt; OrderToCustomer(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;ByVal&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Integer&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; IEnumerable(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Of&lt;/span&gt;&lt;span style="color: #000000;"&gt; Customer)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;17&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; context &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;As&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;New&lt;/span&gt;&lt;span style="color: #000000;"&gt; CustomersAndOrdersDataContext
&lt;/span&gt;&lt;span style="color: #008080;"&gt;18&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;19&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (From o &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;In&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Orders _
&lt;/span&gt;&lt;span style="color: #008080;"&gt;20&lt;/span&gt; &lt;span style="color: #000000;"&gt;               Where o.OrderID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; orderID _
&lt;/span&gt;&lt;span style="color: #008080;"&gt;21&lt;/span&gt; &lt;span style="color: #000000;"&gt;               &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Select&lt;/span&gt;&lt;span style="color: #000000;"&gt; o).Single().CustomerID
&lt;/span&gt;&lt;span style="color: #008080;"&gt;22&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;23&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Dim&lt;/span&gt;&lt;span style="color: #000000;"&gt; custList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; From c &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;In&lt;/span&gt;&lt;span style="color: #000000;"&gt; context.Customers _
&lt;/span&gt;&lt;span style="color: #008080;"&gt;24&lt;/span&gt; &lt;span style="color: #000000;"&gt;                    Where c.CustomerID &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; customerID _
&lt;/span&gt;&lt;span style="color: #008080;"&gt;25&lt;/span&gt; &lt;span style="color: #000000;"&gt;                    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Select&lt;/span&gt;&lt;span style="color: #000000;"&gt; c
&lt;/span&gt;&lt;span style="color: #008080;"&gt;26&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;Return&lt;/span&gt;&lt;span style="color: #000000;"&gt; custList
&lt;/span&gt;&lt;span style="color: #008080;"&gt;27&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;End Function&lt;/span&gt;&lt;/!--

code&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/!--&gt;&lt;/div&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Deploy the solution and create new page to see the associated data lists &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;1. Go to the homepage of your SharePoint site. Typically &lt;a href="http://localhost"&gt;http://localhost&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2. On the top left corner of the site, select &lt;b&gt;Site Actions -&amp;gt; New Page&lt;/b&gt;, name the new page&lt;b&gt; BdcAssociationSample&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;3. On the ribbon, select &lt;b&gt;Insert -&amp;gt; Web Part&lt;/b&gt;, and click on &lt;b&gt;Business Data&lt;/b&gt; from the &lt;b&gt;Categories &lt;/b&gt;panel, select &lt;b&gt;Business Data List&lt;/b&gt; from the &lt;b&gt;Web Parts&lt;/b&gt; panel. Click &lt;b&gt;Add&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5415.clip_5F00_image006_5F00_6A1BAA45.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/6087.clip_5F00_image006_5F00_thumb_5F00_32F21C4C.png" width="515" height="364" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4. Repeat the step above, select &lt;b&gt;Business Data Related List&lt;/b&gt; and click &lt;b&gt;Add&lt;/b&gt;. &lt;/p&gt;

&lt;p&gt;5. Click &lt;b&gt;Open the tool pane&lt;/b&gt; on Business Data List, then select &lt;b&gt;Customer&lt;/b&gt; from External Content Type picker and click &lt;b&gt;OK&lt;/b&gt;. Now you should able to see the customer information from the database is displayed in the list.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5822.clip_5F00_image007_5F00_697FC790.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/4331.clip_5F00_image007_5F00_thumb_5F00_4415D422.png" width="442" height="131" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/0216.clip_5F00_image008_5F00_356B283D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/1602.clip_5F00_image008_5F00_thumb_5F00_6DA99F55.png" width="229" height="284" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6. Repeat the step above, select &lt;b&gt;Order&lt;/b&gt; on Business Data Related List.&lt;/p&gt;

&lt;p&gt;7. On the top-right corner of the Business Data Related List, click on the drop down menu and select &lt;b&gt;Edit Web Part&lt;/b&gt;. After the page refreshed, from the same drop down menu, select &lt;b&gt;Connections -&amp;gt; Get Related Item From -&amp;gt; Customer&lt;/b&gt;. Click &lt;b&gt;OK&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/1682.clip_5F00_image009_5F00_6C650676.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/7633.clip_5F00_image009_5F00_thumb_5F00_6B8CA08C.png" width="173" height="132" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/8535.clip_5F00_image010_5F00_51B86A5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/2275.clip_5F00_image010_5F00_thumb_5F00_77AE1AB3.png" width="379" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;8. Click &lt;b&gt;Save &amp;amp; Close&lt;/b&gt; on the ribbon of the new page.&lt;/p&gt;

&lt;p&gt;Now you can see a list of Customers on the SharePoint page, when you select a row in the Customer table, a list of orders related with this customer will showed in the second table. &lt;/p&gt;

&lt;p&gt;Select CustomerID ALFKI by clicking the small icon in the front of each line.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/3348.clip_5F00_image011_5F00_4737963D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/0537.clip_5F00_image011_5F00_thumb_5F00_3A5D401F.png" width="544" height="190" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second list will display the corresponding orders.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5315.clip_5F00_image012_5F00_71C3514D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/7633.clip_5F00_image012_5F00_thumb_5F00_220A2604.png" width="539" height="277" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yanchen Wu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10045223" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="Visual Studio 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+2010/" /><category term="BCS" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/BCS/" /><category term="Association" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Association/" /><category term="BDC" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/BDC/" /></entry><entry><title>Deploy your BDC model to a specific BCS Service using Visual Studio 2010</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/07/30/deploy-your-bdc-model-to-a-specific-bcs-service-using-visual-studio-2010.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/07/30/deploy-your-bdc-model-to-a-specific-bcs-service-using-visual-studio-2010.aspx</id><published>2010-07-30T19:38:00Z</published><updated>2010-07-30T19:38:00Z</updated><content type="html">&lt;p&gt;When deploying a BDC model in Visual Studio 2010, some people may see this error message “… &lt;i&gt;There is no default Business Data Connectivity Service Proxy available for the given SPServiceContext&lt;/i&gt;…” or similar ones. This probably means the &lt;b&gt;SiteUrl&lt;/b&gt; feature property is not appropriately set.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;SiteUrl&lt;/b&gt; is a SharePoint feature property that determines where a feature will be deployed. When a BCS feature is deployed, SharePoint server will look up a BCS service (if there are more than one BCS service connected to the site, it will select the default one) connected to the appointed &lt;b&gt;SiteUrl&lt;/b&gt;. If the &lt;b&gt;SiteUrl&lt;/b&gt; property is omitted, it assumes the value of &lt;b&gt;SiteUrl&lt;/b&gt; is http://localhost:80. The SharePoint BDC project in VS2010 helps you customize the feature properties like &lt;b&gt;SiteUrl&lt;/b&gt;. Let me show you how you can easily manage &lt;b&gt;SiteUrl&lt;/b&gt; property here.&lt;/p&gt;  &lt;p&gt;Assume you have two BCS services, BCS1 and BCS2, and two web applications, one on port 80 (http://localhost:80) named WebApp80, and the other on port 90 (http://localhost:90) named WebApp90. In SharePoint 2010 Central Administration, you can link services up with web applications. Browse to the &lt;b&gt;Web Application Management&lt;/b&gt; page, select the web application WebApp80 as shown in the screenshot below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5852.clip_5F00_image001_5F00_25B7676C.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/4061.clip_5F00_image001_5F00_thumb_5F00_02A6F5FC.png" width="388" height="166" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you click the &lt;b&gt;Service Connections&lt;/b&gt; button on the top ribbon, the &lt;b&gt;Configure Service Application Associations&lt;/b&gt; dialog will be displayed. Now you can select BCS1 as the default BCS service for the current web application as shown in the screenshot below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/0741.clip_5F00_image002_5F00_47731A30.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/8182.clip_5F00_image002_5F00_thumb_5F00_2A1DC266.png" width="390" height="181" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is the same for adding BCS2 to WebApp90. Now BCS1 is the default BCS service for WebApp80 and BCS2 is the default BCS service for WebApp90.&lt;/p&gt;  &lt;p&gt;Now let’s create a new BDC project. &lt;b&gt;SiteUrl&lt;/b&gt; by default is not set for a new project. So the solution will be deployed to BCS1. If we want to deploy the solution to the BCS service other than BCS1, how can we do that? Here are the steps.&lt;/p&gt;  &lt;p&gt;1. Select the BDC folder node in the &lt;b&gt;Solution Explorer&lt;/b&gt; and view its properties in the &lt;b&gt;Property Window&lt;/b&gt;. Click the […] at the end of &lt;b&gt;Feature Properties&lt;/b&gt; row in the &lt;b&gt;Property Window&lt;/b&gt;. See the screenshot below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/0268.clip_5F00_image003_5F00_07E5B6E0.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/1323.clip_5F00_image003_5F00_thumb_5F00_21D97702.png" width="394" height="206" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. The &lt;b&gt;Feature Properties&lt;/b&gt; dialog will be displayed. Now we can add the &lt;b&gt;SiteUrl&lt;/b&gt; property and set its value to http://localhost:90 where BCS2 is the default BCS service.     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/0268.clip_5F00_image004_5F00_78822F03.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00-metablogapi/5468.clip_5F00_image004_5F00_thumb_5F00_48E41077.png" width="395" height="260" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Now if we deploy the solution again, it will be deployed to BCS2.&lt;/p&gt;  &lt;p&gt;Enjoy using this feature!&lt;/p&gt;  &lt;p&gt;Jeff Chen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10044102" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="VS2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/VS2010/" /><category term="SharePoint Server 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint+Server+2010/" /><category term="BCS" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/BCS/" /><category term="SiteUrl" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SiteUrl/" /></entry><entry><title>Using Deployment Step events to add functionality to Deployment Configuration</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/07/21/using-deployment-step-events-to-add-functionality-to-deployment-configuration.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/07/21/using-deployment-step-events-to-add-functionality-to-deployment-configuration.aspx</id><published>2010-07-21T22:16:00Z</published><updated>2010-07-21T22:16:00Z</updated><content type="html">&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;With the help of the extensibility features in the SharePoint tools in Visual Studio, you can add functionality to deployment configurations by subscribing to the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemevents.deploymentstepstarted.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;DeploymentStepStarted&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; and &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemevents.deploymentstepcompleted.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;DeploymentStepCompleted&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; events.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;To learn more about deployment configurations and deployment steps in SharePoint projects, refer to the MSDN article &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee231587(v=VS.100).aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;here&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;In this blog post I will show you how to use the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemevents.deploymentstepcompleted.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;DeploymentStepCompleted&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; event and add you own code that is executed when a SharePoint project is either deployed or retracted. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Our scenario is the following: When retracting Web Parts we would like to delete the .webpart file from the SharePoint server. We will create a project item extension for the Visual Web Part project and from that extension we will subscribe to the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemevents.deploymentstepcompleted.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;DeploymentStepCompleted&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; event. First we will need to create a SharePoint project item extension project.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;To do that we will need to:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;1)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;Install the Visual Studio SDK from:&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=47305cf4-2bea-43c0-91cd-1b853602dcc5"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff; font-size: small;"&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=47305cf4-2bea-43c0-91cd-1b853602dcc5&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt; &lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;2)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Create an empty VSIX project&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;3)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add a class library project which is project item extension project to the solution &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;4)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add the output from the project item extension project as MEF component content to the VSIX manifest in the VSIX project.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt;For detailed information on how to create project item extensions you can refer to the walkthrough&lt;/span&gt;&lt;span style="line-height: 115%; color: #4f81bd; font-size: 12pt;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256694(v=VS.100).aspx"&gt;&lt;span style="line-height: 115%; color: #4f81bd; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman;"&gt;here&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt; or Bing &amp;lsquo;&lt;span style="mso-bidi-font-weight: bold;"&gt;Visual Studio 2010 How to: Create a SharePoint Project Item Extensions&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Let&amp;rsquo;s start by creating a project Item extension for Visual Web Part.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;[&lt;span style="color: #2b91af;"&gt;Export&lt;/span&gt;(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;ISharePointProjectItemTypeExtension&lt;/span&gt;))]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;[&lt;span style="color: #2b91af;"&gt;SharePointProjectItemType&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"Microsoft.VisualStudio.SharePoint.VisualWebPart"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="color: blue; font-size: 12pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;internal&lt;/span&gt;&lt;span style="font-size: 12pt;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ItemExtension&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;ISharePointProjectItemTypeExtension&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Initialize(&lt;span style="color: #2b91af;"&gt;ISharePointProjectItemType&lt;/span&gt; projectItemType)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;projectItemType.DeploymentStepCompleted += &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;DeploymentStepCompletedEventArgs&lt;/span&gt;&amp;gt;(projectItemType_DeploymentStepCompleted);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="color: blue; font-size: 12pt;"&gt;void&lt;/span&gt;&lt;span style="font-size: 12pt;"&gt; projectItemType_DeploymentStepCompleted(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;DeploymentStepCompletedEventArgs&lt;/span&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: #2b91af;"&gt;ISharePointProjectItem&lt;/span&gt; SPProjectItem = e.ProjectItem;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;string&lt;/span&gt; webPartUrl = GetWebPartFileUrl(SPProjectItem);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (e.DeploymentStepInfo.Id == &lt;span style="color: #2b91af;"&gt;DeploymentStepIds&lt;/span&gt;.RetractSolution &amp;amp;&amp;amp; !&lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(webPartUrl))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;SPProjectItem.Project.SharePointConnection.ExecuteCommand&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt;(DeleteWebPartFileCommand, webPartUrl);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Notice in above code we created a new class called Item Extension that implements the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemtypeextension.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;ISharePointProjectItemTypeExtension&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; interface. In order for this class to be recognized in Visual Studio we added two attributes. With the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.exportattribute.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;Export&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; attribute we are telling Visual Studio that this class is a project item extension and with second attribute (&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.sharepointprojectitemtypeattribute.aspx"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;SharePointProjectItemType&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Calibri;"&gt;) we are telling Visual Studio that this extension applies to the Visual Web Part projects. Extension developers can subscribe to deployment step events in the Initialize method of the project item extension.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;projectItemType.DeploymentStepCompleted += &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;DeploymentStepCompletedEventArgs&lt;/span&gt;&amp;gt;(projectItemType_DeploymentStepCompleted);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;The event we subscribed to is raised for all the deployment steps that are executed in the active deployment configuration. With the help of the event args parameter passed to the event handler we can check which step is being executed and decide what code to run.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 12pt;"&gt;if&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt; (e.DeploymentStepInfo.Id == &lt;span style="color: #2b91af;"&gt;DeploymentStepIds&lt;/span&gt;.RetractSolution &amp;amp;&amp;amp; !&lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(webPartUrl))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Since this includes deleting a file on the SharePoint server, the extension uses a custom SharePoint command to call into the SharePoint server object model. For detailed information on why to use SharePoint commands is discussed &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256704.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;here&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;The line of code which uses the SharePoint command is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;SPProjectItem.Project.SharePointConnection.ExecuteCommand&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt;(DeleteWebPartFileCommand, webPartUrl);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;When this line of code is executed we create a new process named vssphost4.exe or use an existing one. The SharePoint command named DeleteWebpartFileCommand is executed inside this process during execution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;To create a SharePoint command class we need to:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;1)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add a class library project that targets the .NET Framework 3.5 to the same solution as the VSIX and project item extension projects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;2)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add references to Microsoft.SharePoint.dll and Microsoft.VisualStudio.SharePoint.Commands.dll.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;3)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add the commands project output to the VSIX manifest in the VSIX project as a Custom Content Type with Type= &amp;ldquo;SharePoint.Commands.v4&amp;rdquo;. This will include the commands project in the VSIX as custom assembly which can be used by the SharePoint project extensions.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="line-height: 115%; color: blue; font-size: 12pt;"&gt;internal&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;[&lt;span style="color: #2b91af;"&gt;SharePointCommand&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"DeleteWebPartFile"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; DeleteWebPartFile(&lt;span style="color: #2b91af;"&gt;ISharePointCommandContext&lt;/span&gt; context, &lt;span style="color: blue;"&gt;string&lt;/span&gt; webPartFileUrl)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: green;"&gt;//Append RootWeb Url&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;string&lt;/span&gt; fullWebpartFileUrl = &lt;span style="color: #2b91af;"&gt;SPUrlUtility&lt;/span&gt;.CombineUrl(context.Web.Site.RootWeb.Url, webPartFileUrl);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: #2b91af;"&gt;SPFile&lt;/span&gt; file = context.Web.Site.RootWeb.GetFile(fullWebpartFileUrl);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (file.Exists)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;file.Delete();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;context.Logger.WriteLine(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515;"&gt;"Visual Webpart Extension:Deleted file at {0}"&lt;/span&gt;, fullWebpartFileUrl), &lt;span style="color: #2b91af;"&gt;LogCategory&lt;/span&gt;.Status);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;context.Logger.WriteLine(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515;"&gt;"Visual Webpart Extension:Exception occured when deleting file at: {0}"&lt;/span&gt;, fullWebpartFileUrl), &lt;span style="color: #2b91af;"&gt;LogCategory&lt;/span&gt;.Status);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;context.Logger.WriteLine(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515;"&gt;"Visual Webpart Extension:Exception occured when deleting file at: {0}; Exception:{1}"&lt;/span&gt;, fullWebpartFileUrl, ex.Message&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: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;ex.StackTrace), &lt;span style="color: #2b91af;"&gt;LogCategory&lt;/span&gt;.Verbose);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&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;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Notice in the above code we are have an attribute &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.commands.sharepointcommandattribute.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;SharePointCommand&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; for the method name which will enable it to be recognized and used by the project item extension to call into. Also the first parameter should be &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.commands.isharepointcommandcontext.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;ISharePointCommandContext&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; which will have reference to &amp;lsquo;SPWeb&amp;rsquo; to take advantage of Server object model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;You will also see the logger object is also exposed in the context parameter with which we can log back messages to the output window of Visual Studio from vssphost4.exe.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="line-height: 115%; color: black; font-size: 12pt;"&gt;You can now install the extension located in the bin/output folder of the VSIX project after the solution is built. &lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;Once this extension is installed the &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemevents.deploymentstepcompleted.aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;DeploymentStepCompleted&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; event will be raised each time a Visual Web Part project is being retracted after the &amp;lsquo;retractSolution&amp;rsquo; step.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;To test and debug the extension:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;1)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://code.msdn.microsoft.com/vwpextension/"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;Download&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; and open the extension project from MSDN code gallery. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;2)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Place a breakpoint in the projectItemType_DeploymentStepCompleted event handler in ItemExtension.cs file and press F5 to start debugging. This will install the VSIX extension in the experimental instance of Visual Studio.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;3)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;The experimental instance of Visual Studio will start. Create a Visual Web Part project (select the project template under the SharePoint 2010 node) and use default values in the wizard.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;4)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;Once the project is created, press F5.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;5)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Close IE or stop debugging to start executing the retraction steps.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;6)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Once the retraction steps start executing, you will see the breakpoint being hit after &amp;ldquo;Retract Solution&amp;rdquo; step.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="mso-list: Ignore;"&gt;&lt;span style="font-family: Calibri;"&gt;7)&lt;/span&gt;&lt;span style="font: 7pt 'Times New Roman';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;You will see the file being deleted after the code is executed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt; mso-no-proof: yes;"&gt;&lt;v:shapetype coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f" id="_x0000_t75"&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:extrusionok="f" gradientshapeok="t" o:connecttype="rect"&gt;&lt;/v:path&gt;&lt;o:lock v:ext="edit" aspectratio="t"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;/span&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;img height="192" width="620" src="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-00/7802.pjct1_2D00_8.png" alt="Output Window snapshot" title="Img" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;For more information on how to extend the SharePoint project system in Visual Studio &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee471447.aspx"&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;you can refer to MSDN topic &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256700(v=VS.100).aspx"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Times New Roman; color: #0000ff;"&gt;here&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; or Bing &lt;span style="color: black;"&gt;&amp;ldquo;&lt;span style="mso-bidi-font-weight: bold;"&gt;Visual Studio 2010 Extending the SharePoint Project System&lt;/span&gt;&amp;ldquo;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Murali Madala.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10041155" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="howto" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/howto/" /><category term="Visual Studio 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+2010/" /><category term="sdk" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/sdk/" /><category term="deployment steps" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/deployment+steps/" /><category term="vsix" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/vsix/" /><category term="deployment" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/deployment/" /><category term="extensibility" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/extensibility/" /></entry><entry><title>Extending the SharePoint Tools in Visual Studio: An Overview </title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/07/08/extending-the-sharepoint-tools-in-visual-studio-an-overview.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/07/08/extending-the-sharepoint-tools-in-visual-studio-an-overview.aspx</id><published>2010-07-08T18:26:00Z</published><updated>2010-07-08T18:26:00Z</updated><content type="html">&lt;div&gt;&lt;span lang="EN" style="mso-ansi-language: EN;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: small;"&gt;
&lt;p&gt;Since you&amp;rsquo;re reading this blog, you&amp;rsquo;re&amp;nbsp;probably aware that Visual Studio 2010 includes an all-new set of tools for creating SharePoint solutions for Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010. These tools include a set of project and item templates for developing various types of solutions, integrated Feature and packaging support (with designers), and the SharePoint Connections node in Server Explorer. &lt;/p&gt;
&lt;p&gt;However, you might not know that the SharePoint tools include a comprehensive extensibility model. This extensibility model is public and &lt;a href="http://msdn.microsoft.com/en-us/library/ee256693.aspx"&gt;fully documented&lt;/a&gt;. In fact, all of the built-in tools were implemented by using same extensibility model that you can use to create your own extensions. A number of Visual Studio extensions that were built by using this extensibility API are already available, such as &lt;a href="http://code.msdn.microsoft.com/VSeWSSImport"&gt;&lt;span style="color: #0066a7;"&gt;VSeWSSImport&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://code.msdn.microsoft.com/vsixforsp"&gt;&lt;span style="color: #0066a7;"&gt;vsixforsp&lt;/span&gt;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The purpose of this post is to provide a high-level&amp;nbsp;overview of the different ways you can extend the SharePoint tools, with some pointers to relevant topics and code examples in the documentation. &lt;/p&gt;
&lt;h2&gt;&lt;b&gt;Introduction to the Extensibility Model&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;p&gt;To extend the SharePoint tools in Visual Studio 2010, you use&amp;nbsp;types in three assemblies that are included with Visual Studio: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft.VisualStudio.SharePoint.dll&lt;/li&gt;
&lt;li&gt;Microsoft.VisualStudio.SharePoint.Commands.dll&lt;/li&gt;
&lt;li&gt;Microsoft.VisualStudio.SharePoint.Explorer.Extensions.dll. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the rest of the post I'll refer to these collectively as the &lt;i&gt;SharePoint tools API&lt;/i&gt;. You can think of this API as&amp;nbsp;an&amp;nbsp;abstraction layer on top of the Visual Studio &lt;a href="http://msdn.microsoft.com/en-us/library/1xt0ezx9.aspx"&gt;&lt;span style="color: #0066a7;"&gt;automation object model&lt;/span&gt;&lt;/a&gt; (DTE and related types) and &lt;a href="http://msdn.microsoft.com/en-us/library/bb166217.aspx"&gt;&lt;span style="color: #0066a7;"&gt;integration object model&lt;/span&gt;&lt;/a&gt;&amp;nbsp;(VSPackages and related types). When you create extension for the SharePoint tools, you always work directly with the SharePoint tools API, but you can also call into the automation and integration object models if you need to leverage functionality that is provided only in those object models. &lt;/p&gt;
&lt;p&gt;The SharePoint tools API consists of two main groups of types: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Extensibility interfaces that you implement as the basis for an extension of the SharePoint tools. To extend a particular feature of the SharePoint tools, you implement an interface that is defined by the SharePoint tools and apply the &lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.exportattribute.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Export&lt;/span&gt;&lt;/a&gt; attribute (and additional attributes as necessary) to your interface implementation. There are a handful of extensibility interfaces provided by the SharePoint tools, including &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemtypeextension.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProjectItemTypeExtension&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitemtypeprovider.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProjectItemTypeProvider&lt;/span&gt;&lt;/a&gt;, and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectextension.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProjectExtension&lt;/span&gt;&lt;/a&gt;. The SharePoint tools use the &lt;a href="http://msdn.microsoft.com/en-us/library/dd460648.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Managed Extensibility Framework (MEF)&lt;/span&gt;&lt;/a&gt; to expose extensibility interfaces and to manage extensions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Other types that represent components that you can modify or automate in extensions (such as &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointproject.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProject&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitem.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProjectItem&lt;/span&gt;&lt;/a&gt;, which represent a SharePoint project and project item, respectively), and other supporting types such as delegates, attributes, and enumerations. Most of the types in the SharePoint tools API fall into this category.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are two main feature areas that you can extend: the SharePoint project system and the SharePoint Connections node in Server Explorer. &lt;/p&gt;
&lt;h2&gt;&lt;b&gt;SharePoint Project System&lt;/b&gt;&lt;/h2&gt;
&lt;p&gt;The SharePoint project system refers to the components and functionality that are available in a SharePoint project. At the highest level, this includes the project itself, each SharePoint project item in the project, and other contents of the project such as mapped folders, Feature definitions, and the package definition. A &lt;i&gt;SharePoint project item&lt;/i&gt; (or &lt;i&gt;SPI&lt;/i&gt; for short) represents a specific SharePoint customization - for example, a Web Part, an event receiver, or list definition. In a SharePoint project that is open in Solution Explorer, each SharePoint project item is represented by a node with an icon that identifies the item type. This node can contain additional files that are associated with the project item, such as Elements.xml files or code files. &lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint&lt;/span&gt;&lt;/a&gt; namespace contains most of the main types in the SharePoint project system, such as &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointproject.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProject&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.isharepointprojectitem.aspx"&gt;&lt;span style="color: #0066a7;"&gt;ISharePointProjectItem&lt;/span&gt;&lt;/a&gt;. Other project system types are also provided in the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.deployment.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint.Deployment&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.features.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint.Features&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.packages.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint.Packages&lt;/span&gt;&lt;/a&gt;, and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.validation.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint.Validation&lt;/span&gt;&lt;/a&gt; namespaces. &lt;/p&gt;
&lt;p&gt;You can extend the SharePoint project system in the following ways: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create an extension for a particular type of SPI, such as the built-in List Definition project item. Your extension is loaded only when an instance of the targeted SPI type is in a project that is open in Visual Studio. For more information and related code examples, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee471448.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Extending SharePoint Project Items&lt;/span&gt;&lt;/a&gt; in the MSDN documentation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create your own new type of SPI, which you can associate with an item template or project template. You can even implement your own wizard that appears when a customer adds your SPI to a project, or creates a new project that includes your SPI. For more information and related code examples, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee791684.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Defining Custom SharePoint Project Item Types&lt;/span&gt;&lt;/a&gt; in the MSDN documentation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create an extension for SharePoint projects. Your extension is loaded whenever any type of SharePoint project is open in Visual Studio. For more information and related code examples, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee471433.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Extending SharePoint Projects&lt;/span&gt;&lt;/a&gt; in the MSDN documentation. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extend the packaging and deployment behavior of a SharePoint project or SPI. For example, you can create your own deployment steps or deployment configurations, handle various deployment-related events, or create your own validation rules for Features and package definitions. For more information and related code examples, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee471434.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Extending SharePoint Packaging and Deployment&lt;/span&gt;&lt;/a&gt; in the MSDN documentation. &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are a number of tasks you can perform in extensions of the SharePoint project system. For example, you can add custom properties to SharePoint projects or particular types of SPIs (these properties appear in the Properties window when a project or SPI is selected in Solution Explorer), add your own context menu items to SharePoint projects or particular types of SPIs (these menu items appear when you right click the project or SPI in Solution Explorer), and you can handle many different events that are raised by SharePoint projects and SPIs in various scenarios. The MSDN topics I link to above provide how-to topics and walkthroughs that demonstrate all of these tasks. &lt;/p&gt;
&lt;h2&gt;&lt;b&gt;SharePoint Connections Node in Server Explorer&lt;/b&gt;&lt;/h2&gt;
&lt;p&gt;The new SharePoint Connections node in Server Explorer is intended to be used to browse the contents of local SharePoint sites on your development computer. After you add a connection to a local SharePoint site, many (but not all) of the components of the site are displayed here in a hierarchical tree view. This can help provide a quick, comprehensive view of the site while you are working on a new SharePoint solution that you plan to deploy to it. For an overview of how this feature is used, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee231586.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Browsing SharePoint Connections Using Server Explorer&lt;/span&gt;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The &lt;a href="http://msdnstage.redmond.corp.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.explorer.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint.Explorer&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.sharepoint.explorer.extensions.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Microsoft.VisualStudio.SharePoint.Explorer.Extensions&lt;/span&gt;&lt;/a&gt; namespaces contain the types that you can use to extend the SharePoint Connections node. &lt;/p&gt;
&lt;p&gt;You can extend the SharePoint Connections node in the following ways: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Extend a node, such as the node that represents fields, lists, or content types. For a code example and step-by-step instructions, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee471438.aspx"&gt;&lt;span style="color: #0066a7;"&gt;How to: Extend a SharePoint Node in Server Explorer&lt;/span&gt;&lt;/a&gt; in the MSDN documentation. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new type of node. For example, you might want to do this if you want to create an extension that can display components of SharePoint sites that the built-in SharePoint Connections node does not support, such as Web Parts. For a code example and step-by-step instructions, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee256706.aspx"&gt;&lt;span style="color: #0066a7;"&gt;How to: Add a Custom SharePoint Node to Server Explorer&lt;/span&gt;&lt;/a&gt; in the MSDN documentation. &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As with the project system, you can also add custom properties and context menu items to nodes, and there are a number of different events you can handle. The MSDN topics I link to above provide how-to topics and walkthroughs that demonstrate all of these tasks. &lt;/p&gt;
&lt;h2&gt;&lt;b&gt;Important Features&lt;/b&gt;&lt;/h2&gt;
&lt;p&gt;The following features play an important role in most extensions of the SharePoint tools. &lt;/p&gt;
&lt;h3&gt;&lt;b&gt;SharePoint Commands&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;Most extensions need to call into the SharePoint APIs to perform some work, such as determining whether a particular file exists on a SharePoint site or adding or deleting content from a site. Although the 2010 releases of SharePoint now include a client object model, most SharePoint tools extensions should use the "traditional" server object model, because the client object model was designed to be used to call into remote SharePoint installations, not local installations. However, the SharePoint server object model cannot be called directly from SharePoint tools extensions, because the SharePoint server object model can be called only from 64-bit processes that target the .NET Framework 3.5, but SharePoint tools extensions are run in the Visual Studio process, which is a 32-bit process that targets the .NET Framework 4. &lt;/p&gt;
&lt;p&gt;To bridge this gap, the Visual Studio tools include the concept of a &lt;em&gt;SharePoint command&lt;/em&gt;. A SharePoint command is essentially an intermediary method that can call into the SharePoint server object model directly, and that can be called by your extension. For a nuts-and-bolts explanation of how this works, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee256704.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Calling into the SharePoint Object Models&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ee471447.aspx"&gt;&lt;span style="color: #0066a7;"&gt;How to: Create a SharePoint Command&lt;/span&gt;&lt;/a&gt;, and &lt;a href="http://msdn.microsoft.com/en-us/library/ee471431.aspx"&gt;&lt;span style="color: #0066a7;"&gt;How to: Execute a SharePoint Command&lt;/span&gt;&lt;/a&gt; in the MSDN documentation. &lt;/p&gt;
&lt;h3&gt;&lt;b&gt;SharePoint Service &lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;The Visual Studio tools provide a special service object, called the SharePoint service, which provides a number of different features such as the ability to convert some types in the SharePoint tools API to types in the Visual Studio automation and integration object models, execute a SharePoint command, and access any open SharePoint project or project item. For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/ee256707.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Using the SharePoint Project Service&lt;/span&gt;&lt;/a&gt; in the MSDN documentation. &lt;/p&gt;
&lt;h2&gt;&lt;b&gt;Related Walkthroughs&lt;/b&gt;&lt;/h2&gt;
&lt;p&gt;For end-to-end walkthroughs that demonstrate how to implement, deploy, and test different types of SharePoint tools extensions, see the following walkthroughs in the MSDN documentation. &lt;/p&gt;
&lt;h3&gt;&lt;b&gt;Project System Extensions&lt;/b&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256696.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Extending a SharePoint Project Item Type&lt;/span&gt;&lt;/a&gt;: Demonstrates how to extend the built-in Business Data Connectivity Model project item type.&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee471437.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Creating a SharePoint Project Extension&lt;/span&gt;&lt;/a&gt;: Demonstrates how to add a custom property to all SharePoint projects. Developers can use the property to add or remove a mapped folder. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256697.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Creating a Custom Action Project Item with an Item Template, Part 1&lt;/span&gt;&lt;/a&gt;: Demonstrates how to define a SharePoint project item type for creating a custom action in SharePoint, and associating an item template with the new project item type. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee710183.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Creating a Custom Action Project Item with an Item Template, Part 2&lt;/span&gt;&lt;/a&gt;: Demonstrates how to create a wizard for a custom SharePoint project item type that is associated with an item template.&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee471442.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Creating a Site Column Project Item with a Project Template, Part 1&lt;/span&gt;&lt;/a&gt;: Demonstrates how to define a SharePoint project item type for creating a site column in SharePoint, and associating a project template with the new project item type.&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ff427539.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Creating a Site Column Project Item with a Project Template, Part 2&lt;/span&gt;&lt;/a&gt;: Demonstrates how to create a wizard for a custom SharePoint project item type that is associated with a project template.&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256698.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Creating a Custom Deployment Step for SharePoint Projects&lt;/span&gt;&lt;/a&gt;: Demonstrates how to define a custom deployment step that can be used to upgrade SharePoint solutions. &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;b&gt;Extensions of the SharePoint Connections Node in Server Explorer&lt;/b&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256699.aspx"&gt;&lt;span style="color: #0066a7;"&gt;Walkthrough: Extending Server Explorer to Display Web Parts&lt;/span&gt;&lt;/a&gt;: Demonstrates how to add new nodes for displaying Web Parts in SharePoint sites that are displayed in Server Explorer. This walkthrough also demonstrates how to create a SharePoint command to call into the SharePoint server object model.&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee256702.aspx"&gt;Walkthrough: Calling into the SharePoint Client Object Model in a Server Explorer Extension&lt;/a&gt;: Demonstrates how to add new nodes for displaying Web Parts in SharePoint sites that are displayed in Server Explorer. This walkthrough also demonstrates how to use the SharePoint client object model.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;McLean Schofield&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10036058" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="howto" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/howto/" /><category term="Visual Studio 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+2010/" /></entry><entry><title>Deploying documents with content types and associating content types with libraries (Part III)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/06/24/deploying-documents-with-content-types-and-associating-content-types-with-libraries-part-iii.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/06/24/deploying-documents-with-content-types-and-associating-content-types-with-libraries-part-iii.aspx</id><published>2010-06-24T21:55:09Z</published><updated>2010-06-24T21:55:09Z</updated><content type="html">&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Part III: Using Feature Event Receiver to create a library and associate a content type&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;In &lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/previous post" title="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/06/07/deploying-documents-with-content-types-and-associating-content-types-with-libraries-part-ii.aspx"&gt;previous post&lt;/a&gt; we showed how to use &lt;i style="mso-bidi-font-style: normal;"&gt;ContentTypeBinding&lt;/i&gt; to bind the content type to an existing document library. In this post, we will learn how to achieve similar results but using the feature event receiver. In this post we will create a new document library, remove all existing content types from the created library and then add our content type to the list. Instead of create a new library from the code, you could also reference an existing one that&amp;rsquo;s already on the SharePoint server. In this example we will use the same project we created in Part I. So, let's start by opening that project which contains the content type and a document. When project opens, expand the Features folder, right click the Feature1 folder and finally select the &lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;i style="mso-bidi-font-style: normal;"&gt;Add Event Receiver&lt;/i&gt;&lt;/b&gt; option to add a feature event receiver to the project. Next, uncomment the &lt;i style="mso-bidi-font-style: normal;"&gt;FeatureActivated&lt;/i&gt; method and add the following code: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; color: #2b91af; font-size: 9.5pt;"&gt;SPWeb&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; web = properties.Feature.Parent &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SPWeb&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; color: blue; font-size: 9.5pt;"&gt;string&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; libraryName = &lt;span style="color: #a31515;"&gt;"Sample library name&amp;nbsp;- "&lt;/span&gt; + &lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;.Now.Millisecond.ToString ();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; color: #2b91af; font-size: 9.5pt;"&gt;Guid&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; listGuid = web.Lists.Add(libraryName, &lt;span style="color: blue;"&gt;string&lt;/span&gt;.Empty, &lt;span style="color: #2b91af;"&gt;SPListTemplateType&lt;/span&gt;.DocumentLibrary);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;SPList&lt;/span&gt; list = web.Lists[listGuid];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; color: green; font-size: 9.5pt;"&gt;// Delete all content types from the list &lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; color: blue; font-size: 9.5pt;"&gt;for&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; list.ContentTypes.Count; i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;list.ContentTypes[i].Delete();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;}&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; color: #2b91af; font-size: 9.5pt;"&gt;SPContentType&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt; myContentType = web.ContentTypes[&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SPContentTypeId&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"0x010100a9fe27b0556b4de8a60d9e04c6db71de"&lt;/span&gt;)];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;list.ContentTypes.Add(myContentType);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;list.ContentTypesEnabled = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;span style="font-family: Consolas; font-size: 9.5pt;"&gt;list.Update(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;In the above code we are adding a library to the SharePoint site. The Add method returns the Guid of the created list/library. In the &lt;i style="mso-bidi-font-style: normal;"&gt;for&lt;/i&gt; statement, we iterate through all the content types that are in the list (since we created a new document library there should be only 1 content type (Document) in the library) and we delete them. &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 10pt;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;After we removed all content types from the list, we add a new content type to the list (similar as in Part II, we are referring to the content type by its ID). You can use the Server Explorer to get the content type ID. Finally, we enable the content type management in the list and we update the list to save the changes. &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 10pt;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;If you press F5 you will notice that the "My New Document Library" is created on SharePoint. If you click the Documents tab and then open the New Document menu you will notice a document we associated with the content type shows up. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Peter Jausovec&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10029858" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="howto" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/howto/" /><category term="Visual Studio 10" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+10/" /><category term="VS2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/VS2010/" /><category term="Visual Studio 2010" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/Visual+Studio+2010/" /><category term="event receiver" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/event+receiver/" /><category term="content types" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/content+types/" /></entry><entry><title>The Visual Studio 2010 SharePoint Power Tools are now available!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/06/17/the-visual-studio-2010-sharepoint-power-tools-are-now-available.aspx" /><id>http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/06/17/the-visual-studio-2010-sharepoint-power-tools-are-now-available.aspx</id><published>2010-06-17T19:29:00Z</published><updated>2010-06-17T19:29:00Z</updated><content type="html">&lt;p class="MsoNormal"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The Visual Studio team that brought you the SharePoint developer tools in Visual Studio 2010 is happy to announce we have created a set of power tools that make developing SharePoint 2010 sandboxed solutions even easier.&amp;nbsp; Below is the list of features included in the current release of the power tools.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;Sandboxed-compatible Visual Web Part &lt;/b&gt;&lt;br /&gt;This item template enables you to use a visual designer to create SharePoint web parts that can be deployed in a SharePoint 2010 sandboxed solution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;o:p&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;Sandboxed Compilation &lt;/b&gt;&lt;br /&gt;This extension displays build errors when you use types or members in a SharePoint 2010 sandboxed project which are not allowed in the SharePoint sandbox environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;The &lt;span style="text-decoration: underline;"&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/8e602a8c-6714-4549-9e95-f3700344b0d9"&gt;Visual Studio 2010 SharePoint Power Tools&lt;/a&gt;&lt;/span&gt; are available immediately on the Visual Studio Gallery.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Mike Morton - &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Program Manager - Visual Studio&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10026669" width="1" height="1"&gt;</content><author><name>SharePointToolsBlog</name><uri>http://blogs.msdn.com/SharePointToolsBlog/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/SharePoint/" /><category term="web part" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/web+part/" /><category term="webpart" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/webpart/" /><category term="sandbox" scheme="http://blogs.msdn.com/b/vssharepointtoolsblog/archive/tags/sandbox/" /></entry></feed>