<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Jesper Niedermann's .NET Blog - Visual Studio</title>
    <link>http://www.niedermann.dk/</link>
    <description>about .NET and related technologies</description>
    <language>en-us</language>
    <copyright>Jesper Niedermann</copyright>
    <lastBuildDate>Tue, 31 Aug 2010 16:31:11 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>jesper@niedermann.dk</managingEditor>
    <webMaster>jesper@niedermann.dk</webMaster>
    <item>
      <trackback:ping>http://www.niedermann.dk/Trackback.aspx?guid=85830aad-38de-4edb-9c1c-da24a00a7fb9</trackback:ping>
      <pingback:server>http://www.niedermann.dk/pingback.aspx</pingback:server>
      <pingback:target>http://www.niedermann.dk/PermaLink,guid,85830aad-38de-4edb-9c1c-da24a00a7fb9.aspx</pingback:target>
      <dc:creator>Jesper Niedermann</dc:creator>
      <wfw:comment>http://www.niedermann.dk/CommentView,guid,85830aad-38de-4edb-9c1c-da24a00a7fb9.aspx</wfw:comment>
      <wfw:commentRss>http://www.niedermann.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=85830aad-38de-4edb-9c1c-da24a00a7fb9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The new Guidance Automation Framework GAX 2010 and GAT 2010 which is installed through
the Extension Manager in Visual Studio 2010, provides a nicer usability experience
compared to the Visual Studio 2008 predecessor. It is installed using the new vsix
installer. A vsix install is much nicer than the old msi install since it integrates
into Visual Studio. You can uninstall using the Extension Manager and if a new version
comes out it should appear on the Updates tab of the extension manager.
</p>
        <p>
Another nice thing is that a generated factory template solution now only consists
of one project which itself results in a vsix file. So the installer of your own generated
factories will also be vsix files. Nice…
</p>
        <p>
But nicest of all is the fact that it is automatically integrated with the Visual
Studio 2010 Experimental Instance (formerly known as Experimental Hive). Before you
had to manually edit your recipes to get them to register in the Experimental Hive.
But know you just press Ctrl+F5 and the Experimental Instance is automatically launched
with your factory installed. It is now almost easy to debug your recipes. :)
</p>
        <p>
But apparently there are few weird bugs in GAX/GAT 2010. One I run into all the time
is this error:
</p>
        <p>
Unable to read the project file 'Something.csproj'. 
</p>
        <p>
C:\Something\Something\Something.csproj(354,3): The imported project "C:\Microsoft.Practices.RecipeFramework.Build.targets"
was not found. Confirm that the path in the &lt;Import&gt; declaration is correct,
and that the file exists on disk.
</p>
        <p>
Which happens when I try to open a Guidance Automation solution. 
</p>
        <p>
For some reason the declaration of the variable RecipeFramework in the project file
is not provided. This I deal with by editing the Project file by hand and adding a
declaration to the end of the first PropertyGroup like this: 
</p>
        <p>
  
</p>
        <pre class="xml" name="code">  &lt;RecipeFrameworkPath&gt;$(DevEnvDir)Extensions\Microsoft patterns and practices\GAX 2010\2.0.20406.0&lt;/RecipeFrameworkPath&gt;</pre>
        <p>
After applying this fix I can open the solution.
</p>
        <p>
I have read somewhere that it is important to adhere to the following install order:
</p>
        <ol>
        </ol>
        <ol>
          <li>
Visual Studio 2010 Ultimate or Professional (obviously) 
</li>
          <li>
The Visual Studio 2010 SDK 
</li>
          <li>
GAX 2010 
</li>
          <li>
GAT 2010</li>
        </ol>
        <p>
And this might be what I have screwed up on the particular machine where I get the
error. 
</p>
        <p>
Anyway the above mentioned fix works. And overall I am very satisfied with the new
improvements in GAX/GAT.
</p>
        <img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=85830aad-38de-4edb-9c1c-da24a00a7fb9" />
      </body>
      <title>Guidance Automation 2010 Bug: The imported project "C:\Microsoft.Practices.RecipeFramework.Build.targets" was not found</title>
      <guid isPermaLink="false">http://www.niedermann.dk/PermaLink,guid,85830aad-38de-4edb-9c1c-da24a00a7fb9.aspx</guid>
      <link>http://www.niedermann.dk/2010/08/31/GuidanceAutomation2010BugTheImportedProjectCMicrosoftPracticesRecipeFrameworkBuildtargetsWasNotFound.aspx</link>
      <pubDate>Tue, 31 Aug 2010 16:31:11 GMT</pubDate>
      <description>&lt;p&gt;
The new Guidance Automation Framework GAX 2010 and GAT 2010 which is installed through
the Extension Manager in Visual Studio 2010, provides a nicer usability experience
compared to the Visual Studio 2008 predecessor. It is installed using the new vsix
installer. A vsix install is much nicer than the old msi install since it integrates
into Visual Studio. You can uninstall using the Extension Manager and if a new version
comes out it should appear on the Updates tab of the extension manager.
&lt;/p&gt;
&lt;p&gt;
Another nice thing is that a generated factory template solution now only consists
of one project which itself results in a vsix file. So the installer of your own generated
factories will also be vsix files. Nice…
&lt;/p&gt;
&lt;p&gt;
But nicest of all is the fact that it is automatically integrated with the Visual
Studio 2010 Experimental Instance (formerly known as Experimental Hive). Before you
had to manually edit your recipes to get them to register in the Experimental Hive.
But know you just press Ctrl+F5 and the Experimental Instance is automatically launched
with your factory installed. It is now almost easy to debug your recipes. :)
&lt;/p&gt;
&lt;p&gt;
But apparently there are few weird bugs in GAX/GAT 2010. One I run into all the time
is this error:
&lt;/p&gt;
&lt;p&gt;
Unable to read the project file 'Something.csproj'. 
&lt;p&gt;
C:\Something\Something\Something.csproj(354,3): The imported project "C:\Microsoft.Practices.RecipeFramework.Build.targets"
was not found. Confirm that the path in the &amp;lt;Import&amp;gt; declaration is correct,
and that the file exists on disk.
&lt;/p&gt;
&lt;p&gt;
Which happens when I try to open a Guidance Automation solution. 
&lt;/p&gt;
&lt;p&gt;
For some reason the declaration of the variable RecipeFramework in the project file
is not provided. This I deal with by editing the Project file by hand and adding a
declaration to the end of the first PropertyGroup like this: 
&lt;p&gt;
&amp;nbsp; &lt;pre class="xml" name="code"&gt;  &amp;lt;RecipeFrameworkPath&amp;gt;$(DevEnvDir)Extensions\Microsoft patterns and practices\GAX 2010\2.0.20406.0&amp;lt;/RecipeFrameworkPath&amp;gt;&lt;/pre&gt;
&lt;p&gt;
After applying this fix I can open the solution.
&lt;/p&gt;
&lt;p&gt;
I have read somewhere that it is important to adhere to the following install order:
&lt;/p&gt;
&lt;ol&gt;
&lt;ol&gt;
&lt;li&gt;
Visual Studio 2010 Ultimate or Professional (obviously) 
&lt;li&gt;
The Visual Studio 2010 SDK 
&lt;li&gt;
GAX 2010 
&lt;li&gt;
GAT 2010&lt;/li&gt;
&lt;/ol&gt;
&gt;
&lt;p&gt;
And this might be what I have screwed up on the particular machine where I get the
error. 
&lt;/p&gt;
&lt;p&gt;
Anyway the above mentioned fix works. And overall I am very satisfied with the new
improvements in GAX/GAT.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=85830aad-38de-4edb-9c1c-da24a00a7fb9" /&gt;</description>
      <comments>http://www.niedermann.dk/CommentView,guid,85830aad-38de-4edb-9c1c-da24a00a7fb9.aspx</comments>
      <category>.NET</category>
      <category>GAX</category>
      <category>Tips &amp; Tricks</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.niedermann.dk/Trackback.aspx?guid=cbfce837-1ab4-46ce-ba51-b67ab69cc1dc</trackback:ping>
      <pingback:server>http://www.niedermann.dk/pingback.aspx</pingback:server>
      <pingback:target>http://www.niedermann.dk/PermaLink,guid,cbfce837-1ab4-46ce-ba51-b67ab69cc1dc.aspx</pingback:target>
      <dc:creator>Jesper Niedermann</dc:creator>
      <wfw:comment>http://www.niedermann.dk/CommentView,guid,cbfce837-1ab4-46ce-ba51-b67ab69cc1dc.aspx</wfw:comment>
      <wfw:commentRss>http://www.niedermann.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=cbfce837-1ab4-46ce-ba51-b67ab69cc1dc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Imagine that you want to make an extension for Visual Studio 2010 that creates new
custom right click menus for the Solution Explorer. Imagine that you could do it by
just implementing a good old .NET interface like this:
</p>
        <pre class="c#" name="code">public class MenuManager : IMenuManager<br />
{<br />
public IEnumerable&lt;IMenuItem&gt; GetMenus(ContextLevels menuForLevel)<br />
{<br />
var menuItems = new List&lt;IMenuItem&gt;();<br />
var menuItem1 = new MenuItem("My Menu1");<br />
menuItems.Add(menuItem1);<br />
var menuItem2 = new MenuItem("My Menu2");<br />
menuItems.Add(menuItem2);<br />
return menuItems;<br />
}<br /><br />
public string MainMenu()<br />
{<br />
return "My Main Menu";<br />
}<br />
}</pre>
        <p>
 
</p>
        <p>
Well it turns out you can. In <a href="http://mme.codeplex.com/" target="_blank">MME</a> I
have helped you do exactly that. No more using the convoluted add-in model of Visual
Studio to accomplish this goal. And it is also much simpler than using GAX/GAT (that
can do so much more to be fair).
</p>
        <p>
You can easily install MME, either by downloading directly from <a href="http://mme.codeplex.com/" target="_blank">Codeplex</a> or
by installing directly from the Extension Manager in Visual Studio 2010 (you can find
it under the Tools menu).
</p>
        <p>
MME does not work for the Express editions of VS.
</p>
        <p>
I also recommend installing the MME MenuManager template which you can also find in
the Extension Manager.
</p>
        <p>
At codeplex you can read more about <a href="http://mme.codeplex.com/wikipage?title=implementing&amp;referringTitle=Documentation" target="_blank">implementing</a> and <a href="http://mme.codeplex.com/wikipage?title=deploying&amp;referringTitle=Documentation" target="_blank">deploying</a> MME’s
and also get further insight on the <a href="http://mme.codeplex.com/wikipage?title=Architecture&amp;referringTitle=Documentation" target="_blank">architecture.</a></p>
        <img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=cbfce837-1ab4-46ce-ba51-b67ab69cc1dc" />
      </body>
      <title>Right Click menus for Visual Studio 2010</title>
      <guid isPermaLink="false">http://www.niedermann.dk/PermaLink,guid,cbfce837-1ab4-46ce-ba51-b67ab69cc1dc.aspx</guid>
      <link>http://www.niedermann.dk/2010/06/13/RightClickMenusForVisualStudio2010.aspx</link>
      <pubDate>Sun, 13 Jun 2010 17:20:02 GMT</pubDate>
      <description>&lt;p&gt;
Imagine that you want to make an extension for Visual Studio 2010 that creates new
custom right click menus for the Solution Explorer. Imagine that you could do it by
just implementing a good old .NET interface like this:
&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;public class MenuManager : IMenuManager&lt;br&gt;
{&lt;br&gt;
public IEnumerable&amp;lt;IMenuItem&amp;gt; GetMenus(ContextLevels menuForLevel)&lt;br&gt;
{&lt;br&gt;
var menuItems = new List&amp;lt;IMenuItem&amp;gt;();&lt;br&gt;
var menuItem1 = new MenuItem("My Menu1");&lt;br&gt;
menuItems.Add(menuItem1);&lt;br&gt;
var menuItem2 = new MenuItem("My Menu2");&lt;br&gt;
menuItems.Add(menuItem2);&lt;br&gt;
return menuItems;&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
public string MainMenu()&lt;br&gt;
{&lt;br&gt;
return "My Main Menu";&lt;br&gt;
}&lt;br&gt;
}&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Well it turns out you can. In &lt;a href="http://mme.codeplex.com/" target="_blank"&gt;MME&lt;/a&gt; I
have helped you do exactly that. No more using the convoluted add-in model of Visual
Studio to accomplish this goal. And it is also much simpler than using GAX/GAT (that
can do so much more to be fair).
&lt;/p&gt;
&lt;p&gt;
You can easily install MME, either by downloading directly from &lt;a href="http://mme.codeplex.com/" target="_blank"&gt;Codeplex&lt;/a&gt; or
by installing directly from the Extension Manager in Visual Studio 2010 (you can find
it under the Tools menu).
&lt;/p&gt;
&lt;p&gt;
MME does not work for the Express editions of VS.
&lt;/p&gt;
&lt;p&gt;
I also recommend installing the MME MenuManager template which you can also find in
the Extension Manager.
&lt;/p&gt;
&lt;p&gt;
At codeplex you can read more about &lt;a href="http://mme.codeplex.com/wikipage?title=implementing&amp;amp;referringTitle=Documentation" target="_blank"&gt;implementing&lt;/a&gt; and &lt;a href="http://mme.codeplex.com/wikipage?title=deploying&amp;amp;referringTitle=Documentation" target="_blank"&gt;deploying&lt;/a&gt; MME’s
and also get further insight on the &lt;a href="http://mme.codeplex.com/wikipage?title=Architecture&amp;amp;referringTitle=Documentation" target="_blank"&gt;architecture.&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=cbfce837-1ab4-46ce-ba51-b67ab69cc1dc" /&gt;</description>
      <comments>http://www.niedermann.dk/CommentView,guid,cbfce837-1ab4-46ce-ba51-b67ab69cc1dc.aspx</comments>
      <category>Tools</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.niedermann.dk/Trackback.aspx?guid=7c2564c2-8b2c-4c16-837e-9f0e56f43786</trackback:ping>
      <pingback:server>http://www.niedermann.dk/pingback.aspx</pingback:server>
      <pingback:target>http://www.niedermann.dk/PermaLink,guid,7c2564c2-8b2c-4c16-837e-9f0e56f43786.aspx</pingback:target>
      <dc:creator>Jesper Niedermann</dc:creator>
      <wfw:comment>http://www.niedermann.dk/CommentView,guid,7c2564c2-8b2c-4c16-837e-9f0e56f43786.aspx</wfw:comment>
      <wfw:commentRss>http://www.niedermann.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=7c2564c2-8b2c-4c16-837e-9f0e56f43786</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Just released version 1.2 of <a href="http://solzip.codeplex.com/" target="_blank">SolZip</a> my
convenient tool for Zipping Visual Studio 2008 solutions
</p>
        <p>
The major is a single install for SolZipMME, so you won't have to install <a href="http://managedmenuextension.codeplex.com/" target="_blank">ManagedMenuExtensions</a> beforehand.
</p>
        <p>
The release notes are here:
</p>
        <ol>
          <li>
Bug Fix: when multiple projects where referering to the same file it was added to
the archive multiple times.</li>
          <li>
SolZipMME uses SaveFileDialog instead of FolderBrowserDialog for Zip files.</li>
          <li>
A single file installer for SolZipMME.</li>
          <li>
Clipboard functionality now works on Vista / Windows Server 2008.</li>
          <li>
SolZipGuidance changed. The menu will no longer appear on projects that are not C#
projects. SolZipMME not changed.</li>
          <li>
Support for $(SolutionDir) and $(ProjectDir) placeholders added</li>
          <li>
Now works on Windows Vista even if UAC is not turned off</li>
        </ol>
        <p>
Enjoy...
</p>
        <img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=7c2564c2-8b2c-4c16-837e-9f0e56f43786" />
      </body>
      <title>Version 1.2 of SolZip released</title>
      <guid isPermaLink="false">http://www.niedermann.dk/PermaLink,guid,7c2564c2-8b2c-4c16-837e-9f0e56f43786.aspx</guid>
      <link>http://www.niedermann.dk/2009/07/15/Version12OfSolZipReleased.aspx</link>
      <pubDate>Wed, 15 Jul 2009 15:05:27 GMT</pubDate>
      <description>&lt;p&gt;
Just released version 1.2 of &lt;a href="http://solzip.codeplex.com/" target="_blank"&gt;SolZip&lt;/a&gt; my
convenient tool for Zipping Visual Studio 2008 solutions
&lt;/p&gt;
&lt;p&gt;
The major is a single install for SolZipMME, so you won't have to install &lt;a href="http://managedmenuextension.codeplex.com/" target="_blank"&gt;ManagedMenuExtensions&lt;/a&gt; beforehand.
&lt;/p&gt;
&lt;p&gt;
The release notes are here:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Bug Fix: when multiple projects where referering to the same file it was added to
the archive multiple times.&lt;/li&gt;
&lt;li&gt;
SolZipMME uses SaveFileDialog instead of FolderBrowserDialog for Zip files.&lt;/li&gt;
&lt;li&gt;
A single file installer for SolZipMME.&lt;/li&gt;
&lt;li&gt;
Clipboard functionality now works on Vista / Windows Server 2008.&lt;/li&gt;
&lt;li&gt;
SolZipGuidance changed. The menu will no longer appear on projects that are not C#
projects. SolZipMME not changed.&lt;/li&gt;
&lt;li&gt;
Support for $(SolutionDir) and $(ProjectDir) placeholders added&lt;/li&gt;
&lt;li&gt;
Now works on Windows Vista even if UAC is not turned off&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Enjoy...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=7c2564c2-8b2c-4c16-837e-9f0e56f43786" /&gt;</description>
      <comments>http://www.niedermann.dk/CommentView,guid,7c2564c2-8b2c-4c16-837e-9f0e56f43786.aspx</comments>
      <category>Tools</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.niedermann.dk/Trackback.aspx?guid=5feb4e6f-48b5-444f-9057-d2b8be5ef199</trackback:ping>
      <pingback:server>http://www.niedermann.dk/pingback.aspx</pingback:server>
      <pingback:target>http://www.niedermann.dk/PermaLink,guid,5feb4e6f-48b5-444f-9057-d2b8be5ef199.aspx</pingback:target>
      <dc:creator>Jesper Niedermann</dc:creator>
      <wfw:comment>http://www.niedermann.dk/CommentView,guid,5feb4e6f-48b5-444f-9057-d2b8be5ef199.aspx</wfw:comment>
      <wfw:commentRss>http://www.niedermann.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=5feb4e6f-48b5-444f-9057-d2b8be5ef199</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just released version 1.1 of <a href="http://solzip.codeplex.com/" target="_blank">SolZip</a> which
can be downloaded from the <a href="http://solzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29427" target="_blank">download
page</a> at the SolZip site.
</p>
        <p>
The new action packed version contains one major improvement, one bug fix, and a few
name changes:
</p>
        <ol>
          <li>
Now Source Control bindings for TFS and SCC can be removed from sln and csproj files.
The default for all 3 UI's is that the bindings are removed, but you can optionally
choose not to remove them. Feel free to contact me if you need bindings from other
source control vendors removed.</li>
          <li>
A bug fixed that made WinZip clients give a warning when unzipping certain archives
made by SolZip. The warning was given when there was .. (2 dots) in a path in one
of the zipped files.</li>
          <li>
The Name SunZip.exe for the commandline tool was changed to SolZip.exe. Because SunZip
sounded too much like UnZip.</li>
          <li>
The Name SolutionZipper changed to SolZip everywhere. Except for SolutionZipper.dll
which has been changed to SolZipBasis.dll</li>
        </ol>
        <p>
In the next version I will try to include <a href="http://managedmenuextension.codeplex.com/" target="_blank">ManagedMenuExtensions</a> in
the install so you won't have to run more than one setup to install SolZipMME.
</p>
        <p>
Enjoy the new version :O)
</p>
        <img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=5feb4e6f-48b5-444f-9057-d2b8be5ef199" />
      </body>
      <title>Version 1.1 of SolZip released</title>
      <guid isPermaLink="false">http://www.niedermann.dk/PermaLink,guid,5feb4e6f-48b5-444f-9057-d2b8be5ef199.aspx</guid>
      <link>http://www.niedermann.dk/2009/06/29/Version11OfSolZipReleased.aspx</link>
      <pubDate>Mon, 29 Jun 2009 19:44:48 GMT</pubDate>
      <description>&lt;p&gt;
I just released version 1.1 of &lt;a href="http://solzip.codeplex.com/" target="_blank"&gt;SolZip&lt;/a&gt; which
can be downloaded from the &lt;a href="http://solzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29427" target="_blank"&gt;download
page&lt;/a&gt; at the SolZip site.
&lt;/p&gt;
&lt;p&gt;
The new action packed version contains one major improvement, one bug fix, and a few
name changes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Now Source Control bindings for TFS and SCC can be removed from sln and csproj files.
The default for all 3 UI's is that the bindings are removed, but you can optionally
choose not to remove them. Feel free to contact me if you need bindings from other
source control vendors removed.&lt;/li&gt;
&lt;li&gt;
A bug fixed that made WinZip clients give a warning when unzipping certain archives
made by SolZip. The warning was given when there was .. (2 dots) in a path in one
of the zipped files.&lt;/li&gt;
&lt;li&gt;
The Name SunZip.exe for the commandline tool was changed to SolZip.exe. Because SunZip
sounded too much like UnZip.&lt;/li&gt;
&lt;li&gt;
The Name SolutionZipper changed to SolZip everywhere. Except for SolutionZipper.dll
which has been changed to SolZipBasis.dll&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
In the next version I will try to include &lt;a href="http://managedmenuextension.codeplex.com/" target="_blank"&gt;ManagedMenuExtensions&lt;/a&gt; in
the install so you won't have to run more than one setup to install SolZipMME.
&lt;/p&gt;
&lt;p&gt;
Enjoy the new version :O)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=5feb4e6f-48b5-444f-9057-d2b8be5ef199" /&gt;</description>
      <comments>http://www.niedermann.dk/CommentView,guid,5feb4e6f-48b5-444f-9057-d2b8be5ef199.aspx</comments>
      <category>Tools</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.niedermann.dk/Trackback.aspx?guid=bfa592b2-d186-48c8-a6bf-98ecbc4c8df8</trackback:ping>
      <pingback:server>http://www.niedermann.dk/pingback.aspx</pingback:server>
      <pingback:target>http://www.niedermann.dk/PermaLink,guid,bfa592b2-d186-48c8-a6bf-98ecbc4c8df8.aspx</pingback:target>
      <dc:creator>Jesper Niedermann</dc:creator>
      <wfw:comment>http://www.niedermann.dk/CommentView,guid,bfa592b2-d186-48c8-a6bf-98ecbc4c8df8.aspx</wfw:comment>
      <wfw:commentRss>http://www.niedermann.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=bfa592b2-d186-48c8-a6bf-98ecbc4c8df8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just released a new codeplex project <a href="http://solzip.codeplex.com/" target="_blank">SolutionZipper</a> which
makes it a breeze to zip compress your visual studio solutions and projects. "What's
wrong with WinZip you might Ask". Well WinZip has no knowledge of Visual Studio Solutions,
which means it will compress everything in the folder, including bin / obj folders
and other random debris.
</p>
        <p>
I accomplish the compression by using the following algorithm:
</p>
        <p>
1. Iterate over all items and projects in the sln file and zip each of these.<br />
2. Zip the sln file itself.<br />
3. Iterate over all items in the csproj files and zip each of these. The iteration
is done using Linq to Xml of course.<br />
4. Zip the csproj file itself.
</p>
        <p>
As you might have guessed SolutionZipper only works for C# projects, and is only tested
with VS2008.
</p>
        <p>
I offer three UI's for SolutionZipper
</p>
        <p>
          <a href="http://solzip.codeplex.com/Wiki/View.aspx?title=SunZip" target="_blank">SunZip</a> -
A commandline tool. 
</p>
        <p>
  
</p>
        <p>
          <a href="http://solzip.codeplex.com/Wiki/View.aspx?title=SolZipMME" target="_blank">SolZipMME</a> -
Providing Right click menus for Visual Studio 2008 using <a href="http://managedmenuextension.codeplex.com" target="_blank">Managed
Menu Extensions</a> . 
</p>
        <p>
  
</p>
        <p>
          <a href="http://solzip.codeplex.com/Wiki/View.aspx?title=SolZipGuidance" target="_blank">SolZipGuidance</a> -
Providing Right click menus for Visual Studio 2008 using Guidance Automation (GAX). 
</p>
        <p>
  
</p>
        <p>
For the actual zipping I use the excellent open source framework <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib" target="_blank">SharpZipLib</a>.
</p>
        <img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=bfa592b2-d186-48c8-a6bf-98ecbc4c8df8" />
      </body>
      <title>Compression of Visual Studio Solutions and Projects made easy</title>
      <guid isPermaLink="false">http://www.niedermann.dk/PermaLink,guid,bfa592b2-d186-48c8-a6bf-98ecbc4c8df8.aspx</guid>
      <link>http://www.niedermann.dk/2009/06/15/CompressionOfVisualStudioSolutionsAndProjectsMadeEasy.aspx</link>
      <pubDate>Mon, 15 Jun 2009 21:46:31 GMT</pubDate>
      <description>&lt;p&gt;
I just released a new codeplex project &lt;a href="http://solzip.codeplex.com/" target="_blank"&gt;SolutionZipper&lt;/a&gt; which
makes it a breeze to zip compress your visual studio solutions and projects. "What's
wrong with WinZip you might Ask". Well WinZip has no knowledge of Visual Studio Solutions,
which means it will compress everything in the folder, including bin / obj folders
and other random debris.
&lt;/p&gt;
&lt;p&gt;
I accomplish the compression by using the following algorithm:
&lt;/p&gt;
&lt;p&gt;
1. Iterate over all items and projects in the sln file and zip each of these.&lt;br&gt;
2. Zip the sln file itself.&lt;br&gt;
3. Iterate over all items in the csproj files and zip each of these. The iteration
is done using Linq to Xml of course.&lt;br&gt;
4. Zip the csproj file itself.
&lt;/p&gt;
&lt;p&gt;
As you might have guessed SolutionZipper only works for C# projects, and is only tested
with VS2008.
&lt;/p&gt;
&lt;p&gt;
I offer three UI's for SolutionZipper
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://solzip.codeplex.com/Wiki/View.aspx?title=SunZip" target="_blank"&gt;SunZip&lt;/a&gt; -
A commandline tool. 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
&lt;a href="http://solzip.codeplex.com/Wiki/View.aspx?title=SolZipMME" target="_blank"&gt;SolZipMME&lt;/a&gt; -
Providing Right click menus for Visual Studio 2008 using &lt;a href="http://managedmenuextension.codeplex.com" target="_blank"&gt;Managed
Menu Extensions&lt;/a&gt; . 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
&lt;a href="http://solzip.codeplex.com/Wiki/View.aspx?title=SolZipGuidance" target="_blank"&gt;SolZipGuidance&lt;/a&gt; -
Providing Right click menus for Visual Studio 2008 using Guidance Automation (GAX). 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
For the actual zipping I use the excellent open source framework &lt;a href="http://www.icsharpcode.net/OpenSource/SharpZipLib" target="_blank"&gt;SharpZipLib&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=bfa592b2-d186-48c8-a6bf-98ecbc4c8df8" /&gt;</description>
      <comments>http://www.niedermann.dk/CommentView,guid,bfa592b2-d186-48c8-a6bf-98ecbc4c8df8.aspx</comments>
      <category>Tools</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.niedermann.dk/Trackback.aspx?guid=10be7325-8b71-41a0-ba08-658b3a16b70e</trackback:ping>
      <pingback:server>http://www.niedermann.dk/pingback.aspx</pingback:server>
      <pingback:target>http://www.niedermann.dk/PermaLink,guid,10be7325-8b71-41a0-ba08-658b3a16b70e.aspx</pingback:target>
      <dc:creator>Jesper Niedermann</dc:creator>
      <wfw:comment>http://www.niedermann.dk/CommentView,guid,10be7325-8b71-41a0-ba08-658b3a16b70e.aspx</wfw:comment>
      <wfw:commentRss>http://www.niedermann.dk/SyndicationService.asmx/GetEntryCommentsRss?guid=10be7325-8b71-41a0-ba08-658b3a16b70e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was using my codeplex project <a href="http://managedmenuextension.codeplex.com/" target="_blank">ManagedMenuExtensions</a> recently
when I realized that it threw an Exception, when clicking on a menu attached to a
C# project under a solution folder. The reason was that the object which normally
contained an EnvDTE.Project when a project was clicked contained null, when this project
was contained in a solution folder.
</p>
        <p>
I normally use this code to get at the selected project (m_VSStudio is the DTE object
of the current solution):
</p>
        <pre class="c#" name="code">private UIHierarchyItem SelectedItem<br />
{<br />
get<br />
{<br />
UIHierarchy uiHierarchy = m_VSStudio.ToolWindows.SolutionExplorer;<br />
if(uiHierarchy == null)<br />
return null;<br /><br />
object[] items = uiHierarchy.SelectedItems as object[];<br />
if(items == null || items.Length == 0)<br />
return null;<br /><br />
return items[0] as UIHierarchyItem;<br />
}<br />
}</pre>
        <p>
The SelectedItem.Object of type object now contains a EnvDTE.Solution object if the
solution is selected in the solution explorer, and guess what :O) it contains an EnvDTE.Project
if a project is selected. It is this SelectedItem.Object that contains null, if the
project is contained in a solution folder.
</p>
        <p>
I googled this problem and found others who had the same problem, but none with a
solution, so I had to come up with my own. I don't know if this behaviour is by design
from Microsoft, or if it is a bug.
</p>
        <h3>My Solution
</h3>
        <p>
Normally I would test if a project is selected with this code:
</p>
        <pre class="c#" name="code">var project = SelectedItem.Object as Project;<br />
if (project != null)<br />
{<br />
//Do something with the project<br />
}</pre>
        <p>
Now I use this code instead:
</p>
        <pre class="c#" name="code">Project project = GetProject(SelectedItem.Object);<br />
if (project != null)<br />
{<br />
//Do something with the project<br />
}</pre>
        <p>
Where I implemented GetProject(...) as:
</p>
        <pre class="c#" name="code">private Project GetProject(object selectedItemObject)<br />
{<br />
var project = selectedItemObject as Project;<br />
if (project != null)<br />
return project; 
<br /><br />
var item = selectedItemObject as ProjectItem;<br />
if (item == null)<br />
return null; 
<br /><br />
return item.SubProject;<br />
}</pre>
        <p>
Not exactly beautiful, but that is to be expected when playing with Visual Studios
AddIn model, and the kind of thing I try to hide in <a href="http://managedmenuextension.codeplex.com/" target="_blank">ManagedMenuExtensions</a>.
I haven't had a chance to look at Visual Studio 2010 yet, one could hope that they
have done a better job of hiding the ugly underlying COM stuff. 
</p>
        <p>
  
</p>
        <p>
Anyway, I hope this helps the next person who tries to search for a workaround for
this rather weird behaviour.
</p>
        <img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=10be7325-8b71-41a0-ba08-658b3a16b70e" />
      </body>
      <title>How to get EnvDTE.Project information when the project is contained in a Solution Folder in Visual Studio</title>
      <guid isPermaLink="false">http://www.niedermann.dk/PermaLink,guid,10be7325-8b71-41a0-ba08-658b3a16b70e.aspx</guid>
      <link>http://www.niedermann.dk/2009/06/14/HowToGetEnvDTEProjectInformationWhenTheProjectIsContainedInASolutionFolderInVisualStudio.aspx</link>
      <pubDate>Sun, 14 Jun 2009 17:33:04 GMT</pubDate>
      <description>&lt;p&gt;
I was using my codeplex project &lt;a href="http://managedmenuextension.codeplex.com/" target="_blank"&gt;ManagedMenuExtensions&lt;/a&gt; recently
when I realized that it threw an Exception, when clicking on a menu attached to a
C# project under a solution folder. The reason was that the object which normally
contained an EnvDTE.Project when a project was clicked contained null, when this project
was contained in a solution folder.
&lt;/p&gt;
&lt;p&gt;
I normally use this code to get at the selected project (m_VSStudio is the DTE object
of the current solution):
&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;private UIHierarchyItem SelectedItem&lt;br&gt;
{&lt;br&gt;
get&lt;br&gt;
{&lt;br&gt;
UIHierarchy uiHierarchy = m_VSStudio.ToolWindows.SolutionExplorer;&lt;br&gt;
if(uiHierarchy == null)&lt;br&gt;
return null;&lt;br&gt;
&lt;br&gt;
object[] items = uiHierarchy.SelectedItems as object[];&lt;br&gt;
if(items == null || items.Length == 0)&lt;br&gt;
return null;&lt;br&gt;
&lt;br&gt;
return items[0] as UIHierarchyItem;&lt;br&gt;
}&lt;br&gt;
}&lt;/pre&gt;
&lt;p&gt;
The SelectedItem.Object of type object now contains a EnvDTE.Solution object if the
solution is selected in the solution explorer, and guess what :O) it contains an EnvDTE.Project
if a project is selected. It is this SelectedItem.Object that contains null, if the
project is contained in a solution folder.
&lt;/p&gt;
&lt;p&gt;
I googled this problem and found others who had the same problem, but none with a
solution, so I had to come up with my own. I don't know if this behaviour is by design
from Microsoft, or if it is a bug.
&lt;/p&gt;
&lt;h3&gt;My Solution
&lt;/h3&gt;
&lt;p&gt;
Normally I would test if a project is selected with this code:
&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;var project = SelectedItem.Object as Project;&lt;br&gt;
if (project != null)&lt;br&gt;
{&lt;br&gt;
//Do something with the project&lt;br&gt;
}&lt;/pre&gt;
&lt;p&gt;
Now I use this code instead:
&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;Project project = GetProject(SelectedItem.Object);&lt;br&gt;
if (project != null)&lt;br&gt;
{&lt;br&gt;
//Do something with the project&lt;br&gt;
}&lt;/pre&gt;
&lt;p&gt;
Where I implemented GetProject(...) as:
&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;private Project GetProject(object selectedItemObject)&lt;br&gt;
{&lt;br&gt;
var project = selectedItemObject as Project;&lt;br&gt;
if (project != null)&lt;br&gt;
return project; 
&lt;br&gt;
&lt;br&gt;
var item = selectedItemObject as ProjectItem;&lt;br&gt;
if (item == null)&lt;br&gt;
return null; 
&lt;br&gt;
&lt;br&gt;
return item.SubProject;&lt;br&gt;
}&lt;/pre&gt;
&lt;p&gt;
Not exactly beautiful, but that is to be expected when playing with Visual Studios
AddIn model, and the kind of thing I try to hide in &lt;a href="http://managedmenuextension.codeplex.com/" target="_blank"&gt;ManagedMenuExtensions&lt;/a&gt;.
I haven't had a chance to look at Visual Studio 2010 yet, one could hope that they
have done a better job of hiding the ugly underlying COM stuff. 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
Anyway, I hope this helps the next person who tries to search for a workaround for
this rather weird behaviour.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.niedermann.dk/aggbug.ashx?id=10be7325-8b71-41a0-ba08-658b3a16b70e" /&gt;</description>
      <comments>http://www.niedermann.dk/CommentView,guid,10be7325-8b71-41a0-ba08-658b3a16b70e.aspx</comments>
      <category>.NET</category>
      <category>Tips &amp; Tricks</category>
      <category>Visual Studio</category>
    </item>
  </channel>
</rss>