<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Professional Visual Studio &#187; VS2010</title>
	<atom:link href="http://www.professionalvisualstudio.com/blog/tags/vs2010/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.professionalvisualstudio.com/blog</link>
	<description>Tips, Tricks, and Best Practices for professional .NET developers</description>
	<lastBuildDate>Sun, 15 Aug 2010 02:44:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Customizing the Visual Studio 2010 RTM Start Page</title>
		<link>http://www.professionalvisualstudio.com/blog/2010/05/11/customizing-the-visual-studio-2010-rtm-start-page/</link>
		<comments>http://www.professionalvisualstudio.com/blog/2010/05/11/customizing-the-visual-studio-2010-rtm-start-page/#comments</comments>
		<pubDate>Tue, 11 May 2010 02:21:17 +0000</pubDate>
		<dc:creator>Nick Randolph</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[VS2010]]></category>

		<guid isPermaLink="false">http://www.professionalvisualstudio.com/blog/2010/05/11/customizing-the-visual-studio-2010-rtm-start-page/</guid>
		<description><![CDATA[The last thing that any author wants to hear is that a reader has encountered an issue with one of the code samples given in the book. Unfortunately that’s what happened this morning with the Professional Visual Studio 2010 book that has only recently been published. What we hadn’t anticipated was that Microsoft would completely [...]]]></description>
			<content:encoded><![CDATA[<p>The last thing that any author wants to hear is that a reader has encountered an issue with one of the code samples given in the book. Unfortunately that’s what happened this morning with the Professional Visual Studio 2010 book that has only recently been published. What we hadn’t anticipated was that Microsoft would completely change the process that you follow to customize the Start Page in Visual Studio 210. This is a walk through that is available in Chapter 3 of the book so I wanted to take this opportunity to provide an alternative which works with the RTM version of the product.</p>
<p>In previous previews of Visual Studio 2010 the process started with you taking a copy of the default start page (ie StartPage.xaml) from C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\StartPages\en. Unfortunately this file no longer exists. Instead in their infinite wisdom, Microsoft has compiled the start page xaml into baml and embedded it into an assembly somewhere.</p>
<p>I figured, no problems, I’ll just start with the code sample that we already had working. Of course, there are missing and broken references. Even after fixing some of the references I noticed that the styling wasn’t the same as the default start page, so they must have added some polish to the start page since the code sample for the book was generated. I then decided to look further into where the start page had been placed. There were a number of dlls that I thought to be likely candidates for the start page:</p>
<ul>
<li>Microsoft.VisualStudio.Shell.10.0</li>
<li>Microsoft.VisualStudio.Shell.UI.Internal</li>
<li>Microsoft.VisualStudio.Shell.StartPage</li>
</ul>
<p>Turns out it’s not in any of these assemblies (although it does reference controls and components from these assemblies as we’ll see later on). It’s located in Microsoft.VisualStudio.Shell.UI.Internal.resources.dll. I used RedGate’s .NET Reflector (<a title="http://www.red-gate.com/products/reflector" href="http://www.red-gate.com/products/reflector">http://www.red-gate.com/products/reflector</a>) to trawl through these assemblies looking for start page references.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image_thumb.png" border="0" alt="image" width="374" height="200" /></a></p>
<p>Now the challenge was that the start page has been compiled to baml – essentially a binary form of the xaml file. Luckily there is an awesome addin for Reflector called the BamlViewer that is available from CodePlex (<a title="http://reflectoraddins.codeplex.com/releases/view/1805" href="http://reflectoraddins.codeplex.com/releases/view/1805">http://reflectoraddins.codeplex.com/releases/view/1805</a>). Download the addin and then go to View&gt;Add-Ins to add the BamlViewer assembly to the list of addins.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image1.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image_thumb1.png" border="0" alt="image" width="244" height="179" /></a></p>
<p>Next, from the Tools menu select BamlViewer (only appears after the addin has been correctly registered). Locate the resource that you want to view, in this case StartPage.baml, and hey presto, there’s the xaml you’re after.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image2.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image_thumb2.png" border="0" alt="image" width="354" height="326" /></a></p>
<p>You can copy the xaml into a file called StartPage.xaml and then add this file into an empty WPF project. You’ll see that there are a bunch of references that you need to add – these are listed in the Grid element where it imports the namespaces:</p>
<blockquote><p>&lt;Grid xmlns=<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a> <br />
xmlns:x=<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a><br />
xmlns:sp=&#8221;clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.StartPage&#8221;<br />
xmlns:vs=&#8221;clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.10.0&#8243; xmlns:vsfx=&#8221;clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0&#8243; xmlns:d=<a href="http://schemas.microsoft.com/expression/blend/2008">http://schemas.microsoft.com/expression/blend/2008</a><br />
xmlns:mc=&#8221;<a href="http://schemas.openxmlformats.org/markup-compatibility/2006&quot;">http://schemas.openxmlformats.org/markup-compatibility/2006&#8243;</a>&gt;</p></blockquote>
<p>Make sure you add references to all of these assemblies – some are in the GAC, some of them you’ll need to locate under C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE. There are some other minor breakages that require a bit of tweaking – these are a result of the BamlViewer not quite getting the XAML correct that it generates (I’ve attached all the files to this blog post). The end result should be that you have a XAML page that will open in the designer of Visual Studio 2010. As you can see in the following image, the design experience doesn’t look the same as when the actual start page renders within Visual Studio 2010.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image3.png"><img style="display: inline; border: 0px;" title="image" src="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image_thumb3.png" border="0" alt="image" width="422" height="248" /></a></p>
<p>Now, to get your Start Page to display – Open the Options dialog (Tools menu), locate the Startup node under Environment and change the Customize Start Page to show your start page. Note that the xaml and csproj file have to be located under \Documents\Visual Studio 2010\StartPages for them to be available in the drop down list.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image4.png"><img style="display: inline; border: 0px;" title="image" src="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image_thumb4.png" border="0" alt="image" width="398" height="232" /></a></p>
<p>Restart Visual Studio and open the Start Page and you should see your custom page (although at this point it should appear the same as the default page).</p>
<p>Let’s add an additional tab to the start page. Open up StartPage.xaml and go to the end of the file. After the last closing TabItem tag add another TabItem element. For example the following code adds a Company tab (in bold).</p>
<blockquote><p>            &lt;/TabItem&gt;<br />
            <strong>&lt;!&#8211; Company Tab &#8211;&gt;<br />
            &lt;TabItem Header=&#8221;Company&#8221;<br />
                                     </strong><strong>Style=&#8221;{DynamicResource StartPage.TabItemStyle}&#8221;<br />
                                    </strong><strong>x:Uid=&#8221;Company_Tab&#8221; &gt;<br />
               &lt;Grid&gt;<br />
                  &lt;Grid.RowDefinitions&gt;<br />
                     &lt;RowDefinition Height=&#8221;Auto&#8221;&gt;&lt;/RowDefinition&gt;<br />
                     &lt;RowDefinition Height=&#8221;*&#8221;&gt;&lt;/RowDefinition&gt;<br />
                  &lt;/Grid.RowDefinitions&gt;<br />
                  &lt;TextBlock Foreground=&#8221;#E8E8E8&#8243; <br />
                                              </strong><strong>Margin=&#8221;15&#8243; TextWrapping=&#8221;Wrap&#8221;<br />
                                             x:Uid=&#8221;Information_Paragraph&#8221; &gt; The Company has put a lot of effort into writing this custom Start Page so that you can quickly access information relevant to your job, the projects you are working on etc.<br />
                  &lt;/TextBlock&gt;<br />
               &lt;/Grid&gt;<br />
            &lt;/TabItem&gt;<br />
</strong>         &lt;/TabControl&gt;<br />
      &lt;/Grid&gt;<br />
   &lt;/Grid&gt;<br />
&lt;/Grid&gt;</p></blockquote>
<p>When you save these changes and reopen the Start Page you should see your new tab appear.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image5.png"><img style="display: inline; border: 0px;" title="image" src="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/image_thumb5.png" border="0" alt="image" width="437" height="188" /></a></p>
<p>In chapter 3 of Professional Visual Studio 2010 it also covers extending the start page by creating a WPF control and adding that to your start page – this is a good was to invoke behaviour when the user interacts with your page. This process works as described, except you need to deploy the dll that contains the controls to the C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies directory so that they can be referenced by the start page.</p>
<p><a href="http://www.professionalvisualstudio.com/blog/wp-content/uploads/2010/05/Start-Page.zip">Start Page Template</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.professionalvisualstudio.com/blog/2010/05/11/customizing-the-visual-studio-2010-rtm-start-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VS2010 and .NET Framework 4.0 Beta 1 announcement roundup</title>
		<link>http://www.professionalvisualstudio.com/blog/2009/05/19/vs2010-and-net-framework-40-beta-1-announcement-roundup/</link>
		<comments>http://www.professionalvisualstudio.com/blog/2009/05/19/vs2010-and-net-framework-40-beta-1-announcement-roundup/#comments</comments>
		<pubDate>Tue, 19 May 2009 04:29:36 +0000</pubDate>
		<dc:creator>Dave Gardner</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[VS2010]]></category>

		<guid isPermaLink="false">http://www.professionalvisualstudio.com/blog/?p=256</guid>
		<description><![CDATA[For those of you who love the bleeding edge, Beta 1 of Visual Studio 2010 and .NET Framework 4.0 has been released to MSDN subscribers (general availability on Wednesday). Here&#8217;s a few of the more useful posts: Jason Zander has a great post explaining a lot of the new functionality. Phil Haack gives the low-down [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who love the bleeding edge, Beta 1 of Visual Studio 2010 and .NET Framework 4.0 has been released to MSDN subscribers (general availability on Wednesday). Here&#8217;s a few of the more useful posts:</p>
<ul>
<li>Jason Zander has a great post <a href="http://blogs.msdn.com/jasonz/archive/2009/05/18/announcing-vs2010-net-framework-4-0-beta-1.aspx">explaining a lot of the new functionality</a>.</li>
<li>Phil Haack gives the <a href="http://www.haacked.com/archive/2009/05/18/aspnetmvc-vs2010-beta1.aspx">low-down on ASP.NET MVC with this beta</a>.</li>
<li>The documentation has also be <a href="http://msdn.microsoft.com/en-us/library/dd831853(VS.100).aspx">released to MSDN</a>.</li>
<li>On Twitter everyone is <a href="http://search.twitter.com/search?q=%23vs10">discussing this using the #vs10 hashtag</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.professionalvisualstudio.com/blog/2009/05/19/vs2010-and-net-framework-40-beta-1-announcement-roundup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

