<?xml version="1.0" encoding="utf-8"?>
<rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">
<channel>
	<title>Macaw Solutions Factory</title><description>Macaw Solutions Factory Feed Informer</description><image>
				<url>http://feed.informer.com/images/fd.gif</url>
				<title>Powered By Feed Informer</title>
				<link>http://feed.informer.com/</link>
        			</image>
				<link>http://app.feed.informer.com/digest3/SX6KV6S6UP.html</link>
											<copyright>Respective post owners and feed distributors</copyright>
											<generator>http://feed.informer.com/</generator>

<item>
	<title>How to setup BizTalk 2009 BAM Portal on a 64 Bit OS in IIS 7</title>
	<description>&lt;p&gt;I just finished setting up BizTalk 2009 (Developer Edition) on a W2008R2 x64 machine with the following components:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/111709_1539_HowtosetupB1.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;Initially, the BizTalk Server Configuration utility failed to install the BAM portal. The error log reported that IIS was in 64 bit mode where 32 bit mode was required.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa560122(BTS.10).aspx"&gt;MSDN guidance&lt;/a&gt; on configuring the BAM Portal said that in IIS 6 you should execute this script:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;cscript c:\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
&lt;/p&gt;
&lt;p&gt;However, it also mentioned this:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/111709_1539_HowtosetupB2.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;However, the MSDN guidance did not specify what you &lt;strong&gt;should&lt;/strong&gt; do if you use IIS 7.
&lt;/p&gt;
&lt;p&gt;After I found out that in IIS 7 you can specify per application pool whether you want to enable 32 bits processes, I found a clean and easy way to get the BAM Portal to install correctly:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In IIS Manager, select &lt;strong&gt;Set Application Pool Defaults&lt;/strong&gt;:&lt;br /&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/111709_1539_HowtosetupB3.png" alt=""/&gt;
		&lt;/li&gt;
&lt;li&gt;Set the property &#8220;&lt;strong&gt;Enable 32-Bit Applications&lt;/strong&gt;&#8221; to &lt;strong&gt;True&lt;/strong&gt;:&lt;br /&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/111709_1539_HowtosetupB4.png" alt=""/&gt;
		&lt;/li&gt;
&lt;li&gt;Run the BizTalk Server Configuration utility and configure the BAM Portal.
&lt;/li&gt;
&lt;li&gt;If you want, you can now change the Application Pool Defaults back to what you prefer.
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;NJoy the green checkmarks.&lt;/p&gt;
</description>
	<link>http://vincenth.net/blog/archive/2009/11/17/how-to-setup-biztalk-2009-bam-portal-on-a-64-bit-os-in-iis-7.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/11/17/how-to-setup-biztalk-2009-bam-portal-on-a-64-bit-os-in-iis-7.aspx?</guid>
	<pubDate>Tue, 17 Nov 2009 10:40 GMT</pubDate>

</item>

<item>
	<title>Detect 32 or 64 bits Windows &amp;#8211; regardless of WoW64 &amp;#8211; with the PowerShell OSArchitecture function</title>
	<description>&lt;p&gt;In 64-bits versions of Windows Operating Systems, a subsystem called &lt;a href="http://en.wikipedia.org/wiki/WoW64"&gt;Windows on Windows 64&lt;/a&gt; (WoW64) enables you to run 32 bits applications. Even to date, many Windows applications only exist in a 32 bits version – not the least of which is Microsoft's own Visual Studio(!)&lt;/p&gt;
&lt;p&gt;The purpose of WoW64 is to hide many of the structural differences between 32 bits and 64 bits Windows for 32 bits applications. This is a good thing. Most of the time, anyway&#8230;&lt;/p&gt;
&lt;p&gt;However, when your PowerShell script runs in a 32 bits process on a 64 bits OS, and you want to integrate with 64-bits applications (e.g. you want to integrate SharePoint or SQL Server within Visual Studio), WoW64 can get in the way.&lt;/p&gt;
&lt;p&gt;E.g., WoW64 hides the 64 bit registry and changes the environment variables for processor architecture and for the program files folder – in short, WoW64 hides that you are running on a 64 bits OS.&lt;/p&gt;
&lt;p&gt;To detect a 64 bits OS from PowerShell on Vista, W2008 and later Windows versions, we could use WMI:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="powershell" style="font-family:monospace;"&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #008080; font-weight: bold;"&gt;Get-WMIObject&lt;/span&gt; win32_operatingsystem&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;.OSArchitecture&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, this is not supported on W2003.&lt;/p&gt;
&lt;p&gt;Fortunately, Microsoft provided an alternative, which is supported on all Windows versions that have Wow64: the &lt;strong&gt;IsWow64Process&lt;/strong&gt; function. Since this is an unmanaged API call to Kernel32.dll, we need to do some extra work to call this in PowerShell.&lt;/p&gt;
&lt;p&gt;We can write a simple managed C# wrapper around IsWow64Process:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="csharp" style="font-family:monospace;"&gt;&lt;span style="color: #0600FF;"&gt;using&lt;/span&gt; &lt;span style="color: #008080;"&gt;System&lt;/span&gt;&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
&lt;span style="color: #0600FF;"&gt;using&lt;/span&gt; &lt;span style="color: #008080;"&gt;System.Runtime.InteropServices&lt;/span&gt;&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
 
&lt;span style="color: #0600FF;"&gt;public&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;class&lt;/span&gt; Kernel32
&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;DllImport&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #666666;"&gt;&quot;kernel32.dll&quot;&lt;/span&gt;, SetLastError &lt;span style="color: #008000;"&gt;=&lt;/span&gt; &lt;span style="color: #0600FF;"&gt;true&lt;/span&gt;, CallingConvention &lt;span style="color: #008000;"&gt;=&lt;/span&gt; CallingConvention.&lt;span style="color: #0000FF;"&gt;Winapi&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #0600FF;"&gt;return&lt;/span&gt;&lt;span style="color: #008000;"&gt;:&lt;/span&gt; MarshalAs&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;UnmanagedType.&lt;span style="color: #FF0000;"&gt;Bool&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;
    &lt;span style="color: #0600FF;"&gt;public&lt;/span&gt; &lt;span style="color: #0600FF;"&gt;static&lt;/span&gt; &lt;span style="color: #0600FF;"&gt;extern&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;bool&lt;/span&gt; IsWow64Process&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #0600FF;"&gt;In&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; IntPtr hProcess, &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #0600FF;"&gt;Out&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #0600FF;"&gt;out&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;bool&lt;/span&gt; lpSystemInfo&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
 
    &lt;span style="color: #008080; font-style: italic;"&gt;// This overload returns True if the current process is running on Wow, False otherwise&lt;/span&gt;
    &lt;span style="color: #0600FF;"&gt;public&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;bool&lt;/span&gt; CurrentProcessIsWow64&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
        &lt;span style="color: #FF0000;"&gt;bool&lt;/span&gt; retVal&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
        &lt;span style="color: #0600FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #008000;"&gt;!&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;IsWow64Process&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;System.&lt;span style="color: #0000FF;"&gt;Diagnostics&lt;/span&gt;&lt;/span&gt;.&lt;span style="color: #0000FF;"&gt;Process&lt;/span&gt;.&lt;span style="color: #0000FF;"&gt;GetCurrentProcess&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;.&lt;span style="color: #0000FF;"&gt;Handle&lt;/span&gt;, &lt;span style="color: #0600FF;"&gt;out&lt;/span&gt; retVal&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #0600FF;"&gt;throw&lt;/span&gt; &lt;span style="color: #008000;"&gt;new&lt;/span&gt; Exception&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #666666;"&gt;&quot;IsWow64Process() failed&quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #008000;"&gt;;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
        &lt;span style="color: #0600FF;"&gt;return&lt;/span&gt; retVal&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When we use the PowerShell &lt;a href="http://vincenth.net/blog/archive/2009/10/27/call-inline-c-from-powershell-with-invokecsharp.aspx"&gt;InvokeCSharp&lt;/a&gt; function, we can put this C# inline in our PowerShell script:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="powershell" style="font-family:monospace;"&gt;&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt; global:CurrentProcessIsWOW64
&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;# Use some inline C# code to call the unmanaged IsWow64Process() function in Kernel32.dll and return its result:&lt;/span&gt;
    &lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: pink;"&gt;@&lt;/span&gt;&lt;span style="color: #800000;"&gt;&quot;
        using System;
        using System.Runtime.InteropServices;
 
        public class Kernel32
        {
            [DllImport(&quot;&lt;/span&gt;kernel32.dll&lt;span style="color: #800000;"&gt;&quot;, SetLastError = true, CallingConvention = CallingConvention.Winapi)]
            [return: MarshalAs(UnmanagedType.Bool)]
            public static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool lpSystemInfo);
 
            // This overload returns True if the current process is running on Wow, False otherwise
            public bool CurrentProcessIsWow64()
            {
                bool retVal;
                if (!(IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, out retVal))) { throw new Exception(&quot;&lt;/span&gt;IsWow64Process&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; failed&lt;span style="color: #800000;"&gt;&quot;); }
                return retVal;
            }
        }
&quot;&lt;/span&gt;&lt;span style="color: pink;"&gt;@&lt;/span&gt;
    InvokeCSharp &lt;span style="color: pink;"&gt;-&lt;/span&gt;code &lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: #008080; font-style: italic;"&gt;-class&lt;/span&gt; &lt;span style="color: #800000;"&gt;'Kernel32'&lt;/span&gt; &lt;span style="color: pink;"&gt;-&lt;/span&gt;method &lt;span style="color: #800000;"&gt;'CurrentProcessIsWow64'&lt;/span&gt;
&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt; global:ProcessArchitecture
&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;switch&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;System.IntPtr&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;::Size&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #000000;"&gt;32&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;8&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #000000;"&gt;64&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
        default &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;throw&lt;/span&gt; &lt;span style="color: #800000;"&gt;&quot;Unknown Process Architecture: $([System.IntPtr]::Size * 8) bits&quot;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
&lt;span style="color: #0000FF;"&gt;Function&lt;/span&gt; global:OSArchitecture
&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;ProcessArchitecture&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-eq&lt;/span&gt; &lt;span style="color: #000000;"&gt;32&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-and&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;CurrentProcessIsWOW64&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #000000;"&gt;64&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;else&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; ProcessArchitecture &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;# Note that on Vista, W2008 and later Windows versions, we could use (Get-WMIObject win32_operatingsystem).OSArchitecture.&lt;/span&gt;
    &lt;span style="color: #008000;"&gt;# We don't use that because we also support W2003&lt;/span&gt;
&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So there you have it, some simple PowerShell functions to detect the process architecture and the OS architecture, regardless of whether or not you are running under WoW64.&lt;/p&gt;
&lt;p&gt;P.S. I also added these functions to the global functions in the &lt;a href="http://solutionsfactory.macaw.nl/"&gt;Macaw Solutions Factory&lt;/a&gt;, so they can be leveraged by anyone who wants to extend the Factory.&lt;/p&gt;
</description>
	<link>http://vincenth.net/blog/archive/2009/11/02/detect-32-or-64-bits-windows-regardless-of-wow64-with-the-powershell-osarchitecture-function.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/11/02/detect-32-or-64-bits-windows-regardless-of-wow64-with-the-powershell-osarchitecture-function.aspx?</guid>
	<pubDate>Mon, 02 Nov 2009 10:09 GMT</pubDate>

</item>

<item>
	<title>Call inline C# from PowerShell with InvokeCSharp</title>
	<description>&lt;p&gt;Out of the box PowerShell 1.0 makes it very easy to call any managed code in an assembly. However, one of the strong points of a scripted language such as PowerShell is that you can debug and extend it in any environment without the need for development tools or additional source code. This is especially valuable in scripts that integrate heavily with production environments, e.g. with automated deployment scripts such as we use in the &lt;a href="http://solutionsfactory.macaw.nl/"&gt;Macaw Solutions Factory&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Ideally you would want the ability to call any C# source code from PowerShell, either inline or as a separate source file, effectively adding the maintainability benefits of a scripted language to C#. Based on &lt;a href="http://www.leeholmes.com/blog/LibraryForInlineCInMSH.aspx"&gt;a library created by Lee Holmes&lt;/a&gt; I created an improved PowerShell 1.0 function called &lt;strong&gt;InvokeCSharp&lt;/strong&gt; that does just this.&lt;/p&gt;
&lt;p&gt;InvokeCSharp is completely self-contained and can be used in any PowerShell script.&lt;/p&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;Here are some simple examples on how to use InvokeCSharp:&lt;/p&gt;
&lt;p&gt;Let's say we have a file &lt;strong&gt;MyClass.cs&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="line_numbers"&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="csharp" style="font-family:monospace;"&gt;&lt;span style="color: #0600FF;"&gt;using&lt;/span&gt; &lt;span style="color: #008080;"&gt;System&lt;/span&gt;&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
 
&lt;span style="color: #0600FF;"&gt;public&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;class&lt;/span&gt; MyClass
&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
    &lt;span style="color: #0600FF;"&gt;public&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;string&lt;/span&gt; AString&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
 
    &lt;span style="color: #0600FF;"&gt;public&lt;/span&gt; MyClass&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;string&lt;/span&gt; aString&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
        AString &lt;span style="color: #008000;"&gt;=&lt;/span&gt; aString&lt;span style="color: #008000;"&gt;;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Then we can invoke it like this in PowerShell:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="line_numbers"&gt;&lt;pre&gt;1
2
3
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="powershell" style="font-family:monospace;"&gt;&lt;span style="color: #008000;"&gt;# Create a class instance from a .cs file, passing a parameter to the class constructor:&lt;/span&gt;
&lt;span style="color: #008000;"&gt;# Note that the class name can be omitted here, since it is implied from the .cs file name&lt;/span&gt;
&lt;span style="color: #800080;"&gt;$myClassInstance&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; InvokeCSharp &lt;span style="color: #FF0000;"&gt;-file&lt;/span&gt; &lt;span style="color: #800000;"&gt;'.\MyClass.cs'&lt;/span&gt; &lt;span style="color: pink;"&gt;-&lt;/span&gt;parameters &lt;span style="color: #800000;"&gt;'A text'&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Or we can put some C# code inline in the PowerShell script itself, and invoke it:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="line_numbers"&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="powershell" style="font-family:monospace;"&gt;&lt;span style="color: #008000;"&gt;# Call some simple inline code. Note that you could also wrap the code in a namespace, &lt;/span&gt;
&lt;span style="color: #008000;"&gt;# add using statements and reference other assemblies.&lt;/span&gt;
&lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: pink;"&gt;@&lt;/span&gt;&lt;span style="color: #800000;"&gt;&quot;
	public class MyClass2
	{
		public static int MyStaticMethod(int a, int b)
		{
			return a * b;
		}
	}
&quot;&lt;/span&gt;&lt;span style="color: pink;"&gt;@&lt;/span&gt;
&lt;span style="color: #800080;"&gt;$result&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; InvokeCSharp &lt;span style="color: pink;"&gt;-&lt;/span&gt;code &lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: #008080; font-style: italic;"&gt;-class&lt;/span&gt; &lt;span style="color: #800000;"&gt;'MyClass2'&lt;/span&gt; &lt;span style="color: pink;"&gt;-&lt;/span&gt;method &lt;span style="color: #800000;"&gt;'MyStaticMethod'&lt;/span&gt; &lt;span style="color: pink;"&gt;-&lt;/span&gt;parameters &lt;span style="color: #000000;"&gt;3&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt; &lt;span style="color: #000000;"&gt;7&lt;/span&gt; &lt;span style="color: #008000;"&gt;# Will return 21&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Although these are very simple examples, all the rich goodness of PowerShell &#8211; .NET integration is available. Passing any type of parameters back and forth is simple and completely transparent. All C# features can be used; e.g. you can use the C# DllImport attribute to call unmanaged API's when COM interop is not available or not preferred.&lt;/p&gt;
&lt;p&gt;After initial compilation the performance is equivalent to calling compiled assemblies from PowerShell.&lt;/p&gt;
&lt;h2&gt;Extending the Macaw Solutions Factory PowerShell scripts with inline C#&lt;/h2&gt;
&lt;p&gt;I added InvokeCSharp to the global functions in the &lt;a href="http://solutionsfactory.macaw.nl/"&gt;Macaw Solutions Factory&lt;/a&gt;. This makes it possible to simply extend or modify any Factory script – including the scripts that deploy a MAST Product from a package to (production) machines.&lt;/p&gt;
&lt;p&gt;For anyone who is more adept with C# than with PowerShell this will make it easier to extend the Factory scripts. This also enables leveraging existing C# libraries from PowerShell while keeping the entire solution maintainable as a script.&lt;/p&gt;
&lt;h2&gt;Improvements&lt;/h2&gt;
&lt;p&gt;The improvements I added to InvokeCSharp when compared to the original version are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The C# code you specify is completely self-contained; no more C# wrapper code where your code is pasted into. This improves readability and maintainability of inline C# code.&lt;/li&gt;
&lt;li&gt;Simpler parameter passing; no more wrapper code needed for parameters and return values.&lt;/li&gt;
&lt;li&gt;Automatically un-wraps parameters that PowerShell wraps in a PSObject. This eliminates the need to explicitly cast parameters to make them strongly typed on each call to InvokeCSharp, and to always wrap them in @().&lt;br /&gt;
Figuring this one out was interesting; it required diving in the innards of the &lt;a href="http://msdn.microsoft.com/en-us/library/ms714419(VS.85).aspx"&gt;PowerShell Extended Type System&lt;/a&gt; (ETS) which gets in the way when you work with .NET reflection classes from PowerShell. PowerShell tries to make the ETS transparent to the PowerShell user, which in general is a good thing but in this case meant it was hard to see what was happening.&lt;/li&gt;
&lt;li&gt;Adds support for calling static methods, including overloaded methods, without creating a class instance.&lt;/li&gt;
&lt;li&gt;Adds support for creating a class instance and providing constructor parameters.&lt;/li&gt;
&lt;li&gt;Caches compiled assemblies instead of class instances. This improves performance because it eliminates duplicate compilation when the same C# code is called more than once. In addition to assembly caching you can of course also cache the object instances using any of the standard PowerShell mechanisms; however this is better handled outside the InvokeCSharp function.&lt;/li&gt;
&lt;li&gt;Support for inline C# and separate C# source files; the latter allows you to easily edit the C# in Visual Studio, e.g. to use IntelliSense and compile the source to catch compile time errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;PowerShell Source&lt;/h2&gt;
&lt;p&gt;So here are the goods &#8211; the complete PowerShell source for InvokeCSharp:&lt;/p&gt;

&lt;div class="wp_syntax"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="line_numbers"&gt;&lt;pre&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="powershell" style="font-family:monospace;"&gt;&lt;span style="color: #008000;"&gt;#&lt; #&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Synopsis&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Create a class instance and/or invoke a method on C# source code.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   For details, see:&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   http://vincenth.net/blog/archive/2009/10/27/call-inline-c-from-powershell-with-invokecsharp.aspx &lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Description&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   This function compiles the provided C# source code (only if necessary, compiled&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   assemblies are cached). The code can be supplied either inline in a string or&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   in a source file. Relative source filename paths are interpreted&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   relative to the parent folder of the calling script.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   This enables simple organization and reference of related .ps1 and .cs files.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   If a method name is specified, that method is invoked with any supplied&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   parameters and the function then returns the result of the method.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Both static and nonstatic methods are supported, including overloaded&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   methods.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   If no method name is specified, an instance of the specified class is&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   created, passing any supplied parameters to the class constructor, and the&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   function then returns the class instance. You can then program against the&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   class instance in standard PowerShell fashion.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   If necessary for compilation, you can specify names of any referenced&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   assemblies.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter code&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   The complete C# source code - effectively this is an inline C# source file.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Note that it is possible but not necessary to declare classes within a&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   namespace.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Either the code parameter or the file parameter must be specified.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter file&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Absolute or relative path to a C# source file. Relative paths (beginning&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   with '.\' or '..\') are interpreted relative to the folder that contains&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   the calling script (i.e. the script that calls this function).&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Either the code parameter or the file parameter must be specified.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter class&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   The name of the class to be instantiated / that contains the method to&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   be invoked. Include the namespace in which the class is declared, if any.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   If you specify the -file parameter and the class name is identical to the&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   file name, you can omit the -class parameter.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter method&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Either the name of the method to be invoked, '()' to invoke a &lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   constructor to create and resturn a class instance, or '' to return&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   the cached assembly. The last option allows you to precompile assemblies&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   without calling a method or creating a class instance.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#    &lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   If the specified method is not static, an instance of the class will&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   be created on the fly.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter parameters&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   To pass parameters to the constructor or method, specify them as an&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   array of objects (e.g. with the comma operator or @() ).&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter reference&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   If necessary, specify an array of assembly filenames to be added as&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   assembly references when the source code is compiled.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Parameter forceCompile&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Specify this switch to force recompilation. This is useful if you specify&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   the file parameter and the file contents has changed (when specifying a&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   source file name, the cache key is the file name only - changes to the file&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   do not automatically cause cache invalidation).&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Returns&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   Either the cached assembly, a class instance or a method result (depending &lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   on the value specified for the method parameter).&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#.Example&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   # Create a class instance from a .cs file, passing a parameter to the class constructor:&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   # Note that the class name can be omitted here, since it is implied from the .cs file name&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   $myClassInstance = InvokeCSharp -file '.\MyClass.cs' -parameters 'A text'&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#    &lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   # Call some simple inline code. Note that you could also wrap the code in a namespace, &lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   # add using statements and reference other assemblies.&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   $code = @&quot;&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#       public class MyClass2&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#       {&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#           public static int MyStaticMethod(int a, int b)&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#           {&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#               return a * b;&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#           }&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#       }&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   &quot;@&lt;/span&gt;
&lt;span style="color: #008000;"&gt;#   $result = InvokeCSharp -code $code -class 'MyClass2' -method 'MyStaticMethod' -parameters 3, 7 # Will return 21&lt;/span&gt;
&lt;span style="color: #008000;"&gt;##&gt;&lt;/span&gt;
&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt; global:InvokeCSharp
&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;param&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #008080;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #008080;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$file&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #008080;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$class&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #008080;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$method&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800000;"&gt;'()'&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #008080;"&gt;Object&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$parameters&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800080;"&gt;$null&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;string&lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$reference&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: pink;"&gt;@&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: pink;"&gt;,&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #008080;"&gt;switch&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$forceCompile&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
 
    &lt;span style="color: #008000;"&gt;# Stores a cache of generated assemblies. If this library is dot-sourced &lt;/span&gt;
    &lt;span style="color: #008000;"&gt;# from a script, these objects go away when the script exits. &lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;-not&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #008080; font-weight: bold;"&gt;Test-Path&lt;/span&gt; Variable:\macaw.solutionsfactory.assemblycache&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
        $&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;GLOBAL:macaw.solutionsfactory.assemblycache&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: pink;"&gt;@&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
    &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-eq&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-and&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$file&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-eq&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;throw&lt;/span&gt; &lt;span style="color: #800000;"&gt;'Neither code nor file are specified. Specify either one or the other.'&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
    &lt;span style="color: #008000;"&gt;# If a source file was specified, see if it was already loaded, compiled and cached:&lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$file&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-ne&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
        &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$code&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-ne&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;throw&lt;/span&gt; &lt;span style="color: #800000;"&gt;'Both code and file are specified. Specify either one or the other.'&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
        &lt;span style="color: #008000;"&gt;# We interpret the current directory as the directory containing the calling script, instead of the currect directory of the current process.&lt;/span&gt;
        &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$file&lt;/span&gt;.StartsWith&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800000;"&gt;'.'&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
            &lt;span style="color: #800080;"&gt;$callingScriptFolder&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #008080; font-weight: bold;"&gt;Split-Path&lt;/span&gt; &lt;span style="color: #008080; font-style: italic;"&gt;-path&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #008080; font-weight: bold;"&gt;Get-Variable&lt;/span&gt; MyInvocation &lt;span style="color: #008080; font-style: italic;"&gt;-Scope&lt;/span&gt; &lt;span style="color: #000000;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;.Value&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;.MyCommand.Path &lt;span style="color: #008080; font-style: italic;"&gt;-Parent&lt;/span&gt;
            &lt;span style="color: #800080;"&gt;$file&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #008080; font-weight: bold;"&gt;Join-Path&lt;/span&gt; &lt;span style="color: #008080; font-style: italic;"&gt;-Path&lt;/span&gt; &lt;span style="color: #800080;"&gt;$callingScriptFolder&lt;/span&gt; &lt;span style="color: #008080; font-style: italic;"&gt;-ChildPath&lt;/span&gt; &lt;span style="color: #800080;"&gt;$file&lt;/span&gt;
        &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
        &lt;span style="color: #008000;"&gt;# If no class name is  specified, we assume by convention that the file name is equal to the class name.&lt;/span&gt;
        &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$class&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-eq&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #800080;"&gt;$class&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;System.IO.Path&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;::GetFileNameWithoutExtension&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$file&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
        &lt;span style="color: #008000;"&gt;# Use the real full path as the cache key:&lt;/span&gt;
        &lt;span style="color: #800080;"&gt;$file&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;System.IO.Path&lt;span style="color: #000000;"&gt;&#93;&lt;/span&gt;::GetFullPath&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #008080; font-weight: bold;"&gt;Convert-Path&lt;/span&gt; &lt;span style="color: #008080; font-style: italic;"&gt;-path&lt;/span&gt; &lt;span style="color: #800080;"&gt;$file&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt;
        &lt;span style="color: #800080;"&gt;$cacheKey&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800080;"&gt;$file&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;else&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;
        &lt;span style="color: #008000;"&gt;# See if the code has already been compiled and cached &lt;/span&gt;
        &lt;span style="color: #800080;"&gt;$cacheKey&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; &lt;span style="color: #800080;"&gt;$code&lt;/span&gt;
    &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
    &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#40;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$class&lt;/span&gt; &lt;span style="color: #FF0000;"&gt;-eq&lt;/span&gt; &lt;span style="color: #800000;"&gt;''&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#41;&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;throw&lt;/span&gt; &lt;span style="color: #800000;"&gt;'Required parameter missing: class'&lt;/span&gt; &lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;
 
    &lt;span style="color: #008000;"&gt;# See if the code must be (re)compiled:&lt;/span&gt;
    &lt;span style="color: #800080;"&gt;$cachedAssembly&lt;/span&gt; &lt;span style="color: pink;"&gt;=&lt;/span&gt; $&lt;span style="color: #000000;"&gt;&#123;&lt;/span&gt;macaw.solutionsfactory.assemblycache&lt;span style="color: #000000;"&gt;&#125;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&#91;&lt;/span&gt;&lt;span style="color: #800080;"&gt;$cacheKey&lt;/spa</description>
	<link>http://vincenth.net/blog/archive/2009/10/27/call-inline-c-from-powershell-with-invokecsharp.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/10/27/call-inline-c-from-powershell-with-invokecsharp.aspx?</guid>
	<pubDate>Tue, 27 Oct 2009 06:58 GMT</pubDate>

</item>

<item>
	<title>Factory Feature – Create Component</title>
	<description>&lt;p&gt;Create Component is a new feature that was added to the &lt;a href=\"http://solutionsfactory.macaw.nl\"&gt;Macaw Solutions Factory&lt;/a&gt; in version 2.1. \r\n&lt;/p&gt;
&lt;p&gt;With Create Component allows you can quickly add instances of the sample template components to your existing solution. You simply select the component type and specify the name of the new component; all other actions are automated. The component is created automatically in the correct project and folder, its namespace is set accordingly, and if the correct project is not present in the solution it is added on the fly with all correct namespaces, project settings etc.\r\n&lt;/p&gt;
&lt;p style=\"margin-left: 36pt\"&gt;Note: there are several series of Macaw Solutions Factory posts, on multiple blogs.&lt;br /&gt;You can read all posts on the &lt;a href=\"http://solutionsfactory.macaw.nl\"&gt;Macaw Solutions Factory site&lt;/a&gt;, or use &lt;a href=\"http://app.feed.informer.com/digest3/SX6KV6S6UP.rss\"&gt;&lt;span style=\"color:blue; text-decoration:underline\"&gt;this feed&lt;/span&gt;&lt;/a&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat1.png\" alt=\"\"/&gt;.\r\n&lt;/p&gt;
&lt;p&gt;Basically, the Create Components feature allows you to think and work quickly and the logical level when creating components. You do not need to think about which project, folder, project items or settings are needed to implement the component. Instead, all that stuff is generated for you; you can start directly with implementing the component\'s internals.\r\n&lt;/p&gt;
&lt;p&gt;The Create Components feature only works on MSBuild-based projects, so this feature is not available in the Bts2006 and the Sql2005 SS*S solutions.\r\n&lt;/p&gt;
&lt;p&gt;This is how Create Component works in detail:\r\n&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You start by creating a baseline solution with the MAST Solution Builder, by selecting an action in the Factory Guide under \'Create Functional Area\'.&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat2.png\" alt=\"\"/&gt;&lt;br /&gt;All you need to do now is type the name of the new Functional Area (VS solution), and select which components types (VS projects) the Functional Area should contain initially.&lt;br /&gt;&lt;span style=\"background-color:yellow\"&gt;Note&lt;/span&gt; that you only need to select the component types (projects) of which you know for sure that you will need them; you can add component types to an existing solution any time you want.&lt;br /&gt;When you click Create, the new solution is built and all namespaces, project settings etc are set to the correct values.&lt;/p&gt;
&lt;p&gt;After you close the solution builder window, you will be asked whether you want to remove the sample components and sample code from the new solution:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat3.png\" alt=\"\"/&gt;&lt;/p&gt;
&lt;p&gt;And whether you want to open the new solution:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat4.png\" alt=\"\"/&gt;&lt;/p&gt;
&lt;p&gt;After you make these choices, the Product.config file will be opened in VS instance where you selected the \'Create Functional Area\' action, and the new Functional Area will be added automatically to the first non-Templates machine role:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat5.png\" alt=\"\"/&gt;&lt;br /&gt;If you have more than one machine role – other than Templates - in your product, you may want to move the Functional  Area to a different machine role now.&lt;br /&gt;\r\n		&lt;/li&gt;
&lt;li&gt;When the new solution is opened in VS you will see a node \'Create Component\' in the Factory Guide, with a lot of actions in it:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat6.png\" alt=\"\"/&gt;
&lt;p&gt;In any non-Templates solution these Create Component actions are generated on the fly, based on the Sample components in the Templates Functional Area for the current Product Dependency.&lt;br /&gt;E.g. in the DotNet3Templates.sln you can easily recognize the sample components that correspond to the actions in above screenshot:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat7.png\" alt=\"\"/&gt;&lt;/p&gt;
&lt;p&gt;For each project item in a template solution whose name starts with \'Sample\', an action is generated under Create Component. The name of the action specifies both the project name and the component name (without \'Sample\').&lt;br /&gt;If a template project does not contain any sample components, an action is generated to only add the project to your solution (e.g. \'New OperationalManagement\' in the above screenshot).&lt;/p&gt;
&lt;p&gt;You can easily modify the template solutions to change, add or remove sample components. You need to select the \&#8221;&lt;em&gt;Refresh \'Create Component\' actions&lt;/em&gt;\&#8221; action to regenerate the actions after you make this type of changes.&lt;br /&gt;\r\n		&lt;/li&gt;
&lt;li&gt;When you execute a Create Component action, you are prompted for the component name and everything else is done automatically:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat8.png\" alt=\"\"/&gt;&lt;br /&gt;When you select OK, the component is added and it is opened in the editor:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat9.png\" alt=\"\"/&gt;
&lt;p&gt;If necessary, the proper project for the new component will be created on the fly. You can see whether this will happen beforehand in the name prompt dialog:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat10.png\" alt=\"\"/&gt;&lt;br /&gt;When you select OK, the MAST solution builder window will open and the new project will be created:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat11.png\" alt=\"\"/&gt;&lt;br /&gt;As you can see in the log window the solution builder performs a lot of actions automatically, e.g. setting namespaces and project properties, and adding the project target to the FxCop project file for this solution.&lt;/p&gt;
&lt;p&gt;When you close the MAST solution builder window, the new component will be added and it is opened in the editor:&lt;br /&gt;&lt;img src=\"http://vincenth.net/blog/wp-content/uploads/091509_1455_FactoryFeat12.png\" alt=\"\"/&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
	<link>http://vincenth.net/blog/archive/2009/09/15/factory-feature-%e2%80%93-create-component.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/09/15/factory-feature-%e2%80%93-create-component.aspx?</guid>
	<pubDate>Tue, 15 Sep 2009 09:56 GMT</pubDate>

</item>

<item>
	<title>Macaw Vision on SharePoint Release Management</title>
	<description>&lt;p&gt;The current version of SharePoint (Windows SharePoint Services 3 and Microsoft Office SharePoint Server 2007) delivers a powerful collaboration platform. It also offers excellent customization capabilities through configuration and custom code. This customization and configuration be done at a system level through server based installations, but also by power users through the web based site management and administration UI.
&lt;/p&gt;
&lt;p&gt;The power, ease and accessibility of customization in SharePoint encourages a quickly growing and diversifying collection of sites, through manual changes applied directly in the production environment. However this poses several big challenges for release management on SharePoint platforms, specifically:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to deploy and test new functionality through DTAP (Development, Test, Acceptation, Production) environments
&lt;/li&gt;
&lt;li&gt;How to make new or changed functionality available on existing site instances
&lt;/li&gt;
&lt;li&gt;How to handle content staging
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on Macaw's extensive SharePoint project experience, we have developed a strategy on how to address these challenges.
&lt;/p&gt;
&lt;h2&gt;Deploying new functionality through DTAP environments&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;The key to DTAP-enabling SharePoint is to create automatic setup packages that leverage SharePoint's built-in deployment technologies.  Standard SharePoint solution packages (.wsp files) can carry content files, XML definitions and executable files.
&lt;/p&gt;
&lt;p&gt;In the &lt;a href="http://vincenth.net/blog/archive/2009/04/24/factory-overview-part-1-a-bird%e2%80%99s-eye-view-of-the-macaw-solutions-factory.aspx"&gt;Macaw Solutions Factory&lt;/a&gt; new functionality is implemented using SharePoint Features and (when needed) code. The Factory then automatically generates a WSP file, which in turn is embedded in a ZIP file, together with automatic (PowerShell) installation scripts. This ZIP file is also known as a &lt;strong&gt;MAST&lt;/strong&gt; package (because it is based on the Microsoft .NET Architecture Style which is at the heart of the Factory).
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042809_0957_MacawVision1.gif" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;In the development environment these deployment packages are generated; each package contains all information needed to deploy the relevant components of the solution on any machine in any environment. No user input is required.
&lt;/p&gt;
&lt;p&gt;The same (binary) package then travels through the DTAP environments, being deployed and tested for approval at each stage:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042809_0957_MacawVision2.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;This approach has been used for years in many projects, and has proven to effectively DTAP-enable SharePoint solutions (as well as solutions based on other Microsoft server products).
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;Note: there are several series of Macaw Solutions Factory posts, on multiple blogs.&lt;br /&gt;You can use &lt;a href="http://app.feed.informer.com/digest3/SX6KV6S6UP.rss"&gt;&lt;span style="color:blue; text-decoration:underline"&gt;this feed&lt;/span&gt;&lt;/a&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042809_0957_MacawVision3.png" alt=""/&gt; to track all Factory posts.
&lt;/p&gt;
&lt;h2&gt;Maintaining existing site instances&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;The above Factory approach works well for deploying new functionality for new sites. However since at its heart the Factory leverages the standard SharePoint deployment mechanisms, this approach is limited to what type of changes can be deployed through these (XML driven) mechanisms.
&lt;/p&gt;
&lt;p&gt;E.g., a key XML structure in SharePoint is the Site Definition. Through Site Definitions you can make functionality available for new sites that will be created based on that new site definition. However, once a site has been instantiated, the SharePoint XML driven mechanisms do &lt;em&gt;not&lt;/em&gt; allow you to modify the functionality defined by that XML. Changing a Site Definition after it has been instantiated does not modify the existing site instances, and doing this is unsupported by Microsoft – even when you only want to adjust new sites that will be instantiated after the Site Definition modification.
&lt;/p&gt;
&lt;p&gt;But there is an alternative: code that accesses the SharePoint object model &lt;em&gt;can&lt;/em&gt; change &lt;em&gt;any&lt;/em&gt; aspect of sites that are already instantiated. The idea is that to change functionality on (selected) existing sites, you do not write new XML features and site definitions for new sites. Instead, you write a piece of code that upgrades a site instance from version N to version N + 1. Then you automatically chain together all relevant updates to make the latest functionality available on any site.
&lt;/p&gt;
&lt;p&gt;This idea follows the same pattern as the well-known Continuous Database Integration (CDI) strategy (which incidentally is also used in the Factory for SQL Databases): you write small pieces of code that bring the functionality from version N to version N + 1; the tools do the rest.
&lt;/p&gt;
&lt;p&gt;Based on this idea, Macaw created the &lt;strong&gt;Site Management Tool&lt;/strong&gt;. Like the other tools in the Factory, this approach is a combination of an implementation style (write upgrade code instead of XML definitions) with tooling to manage and automatically deploy the functionality to existing sites. The nice thing is that the same approach also works for new sites, so a specific piece of functionality only needs to be implemented once – either in standard SharePoint XML if no existing sites need to be upgraded, or in upgrade code otherwise. The SMT is itself implemented as a custom site in SharePoint:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042809_0957_MacawVision4.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;The SMT offers considerable flexibility in controlling which updates will be applied to which sites at which moment:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which updates: the SMT allows you to define &lt;strong&gt;Update Profiles&lt;/strong&gt;, which in essence is a set of changes grouped together. A site can be assigned multiple Update Profiles.
&lt;/li&gt;
&lt;li&gt;Which sites to update: the SMT allows you to specify a Site Definition, a URL start or a part of the Site Title for each Update Profile, to select which site instances will be updated. In addition you can specify advanced logic in custom code to determine which sites to upgrade. So you can do this based on type of site, the area in your intranet (e.g. for a department), the site topic (a word in the Site Title) or custom logic:&lt;br /&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042809_0957_MacawVision5.png" alt=""/&gt;
		&lt;/li&gt;
&lt;li&gt;When to update: It is possible to have new sites, that are based on site definitions that you control, receive the relevant updates when they are created (this works with an update feature stapled to the site definition), to have updates distributed through scheduled SharePoint jobs, and on demand from the SMT site.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Schematically the SMT operates like this:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042809_0957_MacawVision6.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;Like with CDI, this coded update approach does not allow automatic rollback or downgrade of functionality to a previous version if the data involved originates from the production environment.
&lt;/p&gt;
&lt;p&gt;However in our experience, in the rare cases that the rollback opportunities offered by standard SharePoint backups (site backups and database backups) are not sufficient, you can accomplish an downgrade by writing a specific new update to reverse the effects of the previous one.
&lt;/p&gt;
&lt;p&gt;The Site Management Tool is DTAP enabled by using the Factory to build the upgrade classes. The upgrade classes are then incorporated in the MAST package and are deployed throughout the DTAP environments, allowing the updates themselves to be tested before they are applied in production.
&lt;/p&gt;
&lt;h2&gt;Content Staging&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;The last challenge is how to handle content staging in combination with a DTAP approach. Although not all SharePoint solutions require content staging, it is often unclear how to integrate content with the other types of changes deployed to a SharePoint solution.
&lt;/p&gt;
&lt;p&gt;Macaw's approach to realize this is based on two choices:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have a separate staging environment that is treated as a second Production environment from the DTAP perspective
&lt;/li&gt;
&lt;li&gt;Perform automatic content deployment from the staging environment to the production environment through the built-in SharePoint Content Deployment technology.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This effectively means that the production environment receives updates from two sources: content packages from the Staging Environment and functionality (MAST) packages via DTAP.
&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;With these three major release management challenges addressed, Macaw feels confident that large SharePoint installations with a rich variety of quickly changing functionality can be effectively maintained.
&lt;/p&gt;
&lt;p&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Vincent Hoogendoorn&lt;/em&gt;&lt;/p&gt;
</description>
	<link>http://vincenth.net/blog/archive/2009/04/28/macaw-vision-on-sharepoint-release-management.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/04/28/macaw-vision-on-sharepoint-release-management.aspx?</guid>
	<pubDate>Tue, 28 Apr 2009 04:57 GMT</pubDate>

</item>

<item>
	<title>Factory Overview, Part 1: A Bird’s Eye View of the Macaw Solutions Factory</title>
	<description>&lt;p&gt;The Macaw Solutions Factory is quite a big thing, even though it fits both small and large solutions. In this post I will take you on a quick tour of the major systems and tools in the Factory. Later posts in the Factory Overview series will zoom in on the details of those systems and tools.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;Note: there are several series of Macaw Solutions Factory posts, on multiple blogs.&lt;br /&gt;You can use &lt;a href="http://app.feed.informer.com/digest3/SX6KV6S6UP.rss"&gt;&lt;span style="color:blue; text-decoration:underline"&gt;this feed&lt;/span&gt;&lt;/a&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver1.png" alt=""/&gt; to track all Factory posts.
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver2.gif" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;In &lt;a href="http://vincenth.net/blog/archive/2009/04/07/factory-vision-part-1-introducing-the-macaw-solutions-factory.aspx"&gt;Factory Vision, Part 1: Introducing the Macaw Solutions Factory&lt;/a&gt; I described what the Factory does:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;em&gt;&#8220;Automate and standardize development and deployment on top of Microsoft Server products, targeting shared infrastructures with .NET, SQL Server, SQL BI, BizTalk and SharePoint&#8221;&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;and how the scope of the Factory is defined:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;em&gt;&#8220;All infrastructure, tooling and content used in Macaw's primary process: Realize IT Solutions with Microsoft Technology&#8221;&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;Given this it's not really surprising that there's too much in the Factory to describe in one post.&lt;br /&gt;So without further ado, let's start the Factory tour. I'll present the tools in the chronological order in which they typically are first used during the application lifecycle.
&lt;/p&gt;
&lt;h2&gt;Microsoft Virtual Machine Manager&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;One of the first things that you need to do when you start development on a new solution is to provide machines for the development and test environments. Usually you need at least as much machines as there are developers in the team, plus typically build and test servers. Since each machine logically belongs to one solution (not to a person), over time this can result in a lot of machines that must be kept available (for maintenance) but that only need to run occasionally. Virtualization offers great benefits here, allowing flexible creation and storing of machines, as well as additional benefits such as quick rollback to a checkpoint in case a machine installation gets corrupted.
&lt;/p&gt;
&lt;p&gt;In the Factory we use Microsoft's &lt;a href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/default.aspx"&gt;Virtual Machine Manager&lt;/a&gt;, run on a powerful array of virtual machine hosts, to deliver self-servicing creation, access and management of virtual machines. In addition to fully configurable OS installations, we supply preconfigured machine templates for 32 bits and 64 bits versions of Windows Server 2003 and Windows Server 2008. New machines can be created in a matter of minutes.
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver3.png" alt=""/&gt;
	&lt;/p&gt;
&lt;h2&gt;The Factory Machine Installer&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Virtual Machine Manager offers great flexibility through machine templates, but many Microsoft server products do not work well when they are preinstalled on such a template. This is due to the fact that these server products were not designed to handle a machine rename. Renaming machines happens when you instantiate a machine template – you need to select a unique name for the new machine for network access.  At the OS level a tool named Sysprep handles this, but many Microsoft server products lack this kind of machine rename support.
&lt;/p&gt;
&lt;p&gt;In addition to that, a more flexible and less maintenance intensive mechanism is desired to deliver the desired combination of OS, server products and applications that are needed to develop or test a specific solution.
&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="http://technet.microsoft.com/en-us/library/dd407791.aspx"&gt;Microsoft's Deployment Toolkit&lt;/a&gt;. We use this toolkit to create and maintain the Factory Machine Installer, which allows users to select any desired combination of server products and applications from a single menu. With a single click all selected technologies are installed fully automatic, with all the latest updates. During the remainder of the installation (which can take up to several hours) no user interaction is needed. If a team needs to start (or is extended) tomorrow, you can create all machines simultaneously and have them ready for production work in the morning.
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver4.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;Automatically installing and retaining stable development and test machines saves a lot of time during the application lifecycle. In traditional situations it is not uncommon to spend several days before a new team member has a fully productive development machine for a specific solution.
&lt;/p&gt;
&lt;p&gt;For more details, see &lt;a href="http://www.macaw.nl/Het+Bedrijf/Producten/Macaw+Solutions+Factory/xp/content_pda.Factory+Machine+Installer/default.aspx"&gt;this post on the Factory Machine Installer by Maarten&lt;/a&gt;.
&lt;/p&gt;
&lt;h2&gt;Microsoft Visual Studio&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;The Factory leverages the power of &lt;a href="http://www.microsoft.com/visualstudio/en-us/default.mspx"&gt;Microsoft Visual Studio&lt;/a&gt;, both its built-in functionality and its extensibility. Visual Studio Professional and Team System editions in VS 2005 and VS 2008 versions are fully supported (note that some MS Server products require using VS 2005 because they do not yet support developing in VS 2008). The Factory allows you to mix versions and editions, even within a single Factory product, as needed.
&lt;/p&gt;
&lt;p&gt;Microsoft Visual Studio Team System, including Team Foundation Server, is the application lifecycle management (ALM) platform of choice for working with the Factory. However we also support alternatives for version control (&lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt;) and automated build servers (&lt;a href="http://ccnetbuildstation.codeplex.com/"&gt;CruiseControl.NET Build Station&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver5.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;The freedom of choice that the Factory provides with Visual Studio versions, editions and components, makes the Factory fit both small and large teams, solutions, and development environments.
&lt;/p&gt;
&lt;h2&gt;The MAST standard&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;At the heart of the Factory design is the Microsoft.NET Application Style (MAST) standard. MAST standardizes both the logical design of an application built with the Factory, and how the logical design is translated to an implementation structure in a working folder. MAST is based on Microsoft Patterns &amp; Practices &lt;a href="http://www.codeplex.com/AppArchGuide"&gt;guidance on application architecture&lt;/a&gt;, it has at its core the &lt;a href="http://msdn.microsoft.com/en-us/library/ms978689.aspx"&gt;three-layered services application&lt;/a&gt; pattern:
&lt;/p&gt;
&lt;div&gt;
&lt;table style="border-collapse:collapse" border="0"&gt;
&lt;colgroup&gt;&lt;col style="width:191px"/&gt;&lt;col style="width:189px"/&gt;&lt;col style="width:262px"/&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;
&lt;td colspan="2" style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver6.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver7.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver8.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;(Note that MAST supports both the above pattern from the 1.0 guidance and the updated pattern from the 2.0 guidance, which adds a services layer and an application façade component type)&lt;br /&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The MAST standard provides a standards-based, durable, stable yet flexible implementation structure that is consistent across Microsoft server products and technologies. MAST offers consistency, separation of concerns, alignment with underlying server products, and cost-effective automation through convention over configuration.
&lt;/p&gt;
&lt;p&gt;For solutions built with the Factory this results in very good maintainability. Experience also proves that the consistent implementation structure across solutions makes it much easier for developers to work on another solution or on multiple solutions.
&lt;/p&gt;
&lt;h2&gt;The Factory IDE&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;The Factory Integrated Development Environment (IDE) extends Visual Studio with templates, tools and automation to create a highly productive development environment. Virtually all tools and templates leverage detailed knowledge of the standard MAST implementation structure, to achieve maximum automation. MAST significantly reduces the cost of implementing and maintaining the Factory IDE; it also increases the attainable level of automation.
&lt;/p&gt;
&lt;p&gt;Our choices on how we utilize the available Visual Studio extension mechanisms in the Factory IDE are guided primarily by pragmatism. Rather than see how far we can get with the &#8216;default' technology for a specific type of extension, we consistently select the extension technology that is most effective and future proof for our purpose. This approach has resulted in some innovative and powerful Factory IDE features, such as integration with PowerShell and with the Confluence Wiki.
&lt;/p&gt;
&lt;p&gt;These are the main tools and templates in the Factory IDE:
&lt;/p&gt;
&lt;h3&gt;Factory Product Wizard&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;In Factory terms, the thing that you build with one instance of the Factory is called a &lt;em&gt;Factory Product&lt;/em&gt;. Since the architecture and the implementation structure of Factory products is standardized using the MAST standard, Factory products are also referred to as MAST products. Some examples of products that you can build with the Factory are:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver9.png" alt=""/&gt;&lt;br /&gt;For more details, see in &lt;a href="http://vincenth.net/blog/archive/2009/04/07/factory-vision-part-1-introducing-the-macaw-solutions-factory.aspx"&gt;this post&lt;/a&gt; under the heading &lt;em&gt;&#8220;What can you build with the Factory?&#8221;&lt;/em&gt;.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;Once you have a development machine installed with all required server products and applications, the next step when you start a new solution is to create its &lt;em&gt;working folder&lt;/em&gt;. In addition to the source code, each working folder contains a copy of the Factory IDE. This allows integrated versioning of both the source and the development tools; it also makes product-specific Factory customizations easy to create and maintain. The Factory IDE is designed to run in multiple versions side-by-side, so independent versioning per Factory product is also possible in a shared development environment (see &lt;a href="http://vincenth.net/blog/archive/2009/04/07/factory-vision-part-1-introducing-the-macaw-solutions-factory.aspx"&gt;this post&lt;/a&gt; for more rationale on this).
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;The Factory Product Wizard lets you create a working folder for a new product, with (only) the tools and templates that you need for developing &lt;em&gt;that&lt;/em&gt; product. Since the Wizard knows the MAST standardized working folder structure, which is designed in accordance to the &lt;em&gt;convention over configuration&lt;/em&gt; principle, it requires very little user input to create a product working folder that has a consistent structure.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver10.png" alt=""/&gt;
	&lt;/p&gt;
&lt;h3&gt;MAST Working Folder&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;Once the working folder for a Factory product has been created with the Factory Product Wizard, it will contain all the templates, tools and automation scripts that you need to start developing your product. A typical working folder created by the Wizard looks like this:
&lt;/p&gt;
&lt;div style="margin-left: 36pt"&gt;
&lt;table style="border-collapse:collapse" border="0"&gt;
&lt;colgroup&gt;&lt;col style="width:117px"/&gt;&lt;col style="width:112px"/&gt;&lt;col style="width:184px"/&gt;&lt;col style="width:179px"/&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;
&lt;td colspan="2" style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver11.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver12.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver13.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver14.png" alt=""/&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2" style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p style="text-align: center"&gt;&lt;em&gt;Working Folder - Source&lt;/em&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p style="text-align: center"&gt;&lt;em&gt;Source – Product Dependency Folders&lt;/em&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p style="text-align: center"&gt;&lt;em&gt;.NET 2 Product Dependency Folder&lt;/em&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px"&gt;
&lt;p style="text-align: center"&gt;&lt;em&gt;.NET 3 Template Solution&lt;/em&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="margin-left: 36pt"&gt;
 &lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;The templates in the MAST working folder are ready to be built and (automatically) deployed with a single action. This allows you to verify if your development machine is functioning end-to-end (using the automated system test suite included in the templates), even before you have written any code.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;You can also automatically package and deploy the templates to other machines, e.g. a test machine. This means you get practically free deployment tests starting from day 1 of a project. No more &#8216;nasty surprises' that are common when you do your first deployment much later, e.g. right before your product must be tested in a test environment, only to discover too late that something in that environment was not installed or configured correctly.
&lt;/p&gt;
&lt;h3&gt;Factory MSBuild extensions&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;When you build a MAST Visual Studio solution, post build scripts are run via an MSBuild task that hosts &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;PowerShell&lt;/a&gt;. These PowerShell post build scripts perform a rapid (incremental) deploy of the current Visual Studio solution to the local machine. Deployment is done from the working folder (where files are edited under source control) to the runtime deployment locations that are configured for the local machine:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver15.png" alt=""/&gt;
	&lt;/p&gt;
&lt;h3&gt;Factory Guide Visual Studio Extension&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;Developers spend most of their time working in Visual Studio. To automate development tasks and offer guidance to developers while they are working in Visual Studio, we created the Factory Guide.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;The Factory Guide shows actions that are relevant in the context where the developer is working in. The context consists of elements such as the part of the product they are working on (the Functional Area) and the components that are present in that part. These actions are implemented in &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;PowerShell&lt;/a&gt; scripts (the Guide hosts PowerShell). These scripts have direct access to the Visual Studio object model, the working folder, and the server products running on the development machine.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;This provides a very powerful and flexible automation environment. Existing scripts can be modified easily and new scripts and actions can also be added easily. PowerShell offers excellent integration with command-line tools, web services and managed code assemblies, so it is easy to leverage any type of asset in the scripts. Modifying and extending the Factory Guide is simply done in the working folder of the product being built; no additional Factory source and no Factory development environment is required, and versioning is simple.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver16.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;Each action in the Guide is preceded by icons that indicate whether approved and/or community guidance on that action is available (in the central Factory Wiki):
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver17.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;This way, up-to-date guidance availability information is visible at a glance for all actions in the Guide – no need to click through on each action to see whether there actually is any guidance. Any Factory user can add community guidance to any action with a single click. This means that when a developer (specialist) in any project adds guidance about an action, this becomes visible to all Factory users in all projects. Since guidance is initially sparse and then is created on the fly and as needed, this leads to guidance that is both valuable (there is a proven need) and effective (directly visible to all Factory users).
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;We call this guidance approach: community driven guidance in context.
&lt;/p&gt;
&lt;h3&gt;MAST Solution Builder&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;First you've automatically created and installed your development machines with VMM and the Factory Machine Installer, and then you have created a working folder on your new development machine for your new Factory product with the Factory Product Wizard. Finally you have automatically deployed and tested the templates that you are going to use. Due to the level of automation in these steps an experienced user will spend less than an hour on them.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;At this point you are ready to define the baseline for your new Factory product - meaning that you create all Visual Studio solutions and projects that will be needed (as far as is known at this point in the project). Once you have added all Visual Studio solutions and projects to the working folder, you can add it to source control and let the team start fleshing out the various components.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;We created the MAST Solution Builder to let you quickly create new solutions and projects (or add projects to existing solutions). With a single click the Solution Builder takes the selected template projects, creates a new solution (if needed) and instantiates those projects in the new solution:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver18.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;Since the Solution Builder understands the standard MAST structure of solutions and projects in the Factory, it can automate many tedious and error-prone tasks when creating new projects:
&lt;/p&gt;
&lt;ul style="margin-left: 74pt"&gt;
&lt;li&gt;It creates the solution and project folders with the correct name
&lt;/li&gt;
&lt;li&gt;It copies all selected template projects while removing example code
&lt;/li&gt;
&lt;li&gt;It sets all namespaces and project properties to the correct names
&lt;/li&gt;
&lt;li&gt;It sets all correct project and assembly references,  and updates linked project items
&lt;/li&gt;
&lt;li&gt;It creates an FxCop project file with all project assemblies added as target and with the MAST validation rules added (see &lt;em&gt;MAST Validator&lt;/em&gt; below)
&lt;/li&gt;
&lt;li&gt;It updates comment headers with the correct product information.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since the MAST templates live in the same working folder as the product source, under single source control, the templates can easily be customized and maintained for a specific project. The Solution Builder will instantiate the customized templates when creating new Visual Studio projects.
&lt;/p&gt;
&lt;p style="margin-left: 38pt"&gt;The MAST Solution builder requires very little user input to do its work; you only need enter the Functional Area (~ VS Solution) name and select the project templates to add.
&lt;/p&gt;
&lt;p style="margin-left: 38pt"&gt;By applying the principle of convention over configuration, the MAST standard allows to automatically translate a logical design (consisting of machine roles, product dependencies, functional areas and component types) into an implementation structure (consisting of product- and machine- config files and Visual Studio solutions and projects).
&lt;/p&gt;
&lt;p style="margin-left: 38pt"&gt;All the above makes it possible to create a complete implementation baseline, starting from a logical (whiteboard) product design, in a matter of hours – even for complex, large solutions. At that point, the entire baseline will build and deploy automatically without errors. The team can get from logical design to fleshing out the baseline in one day, while using continuous deployment across development and test environments.
&lt;/p&gt;
&lt;h3&gt;MAST Validator&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;MAST standardizes the logical design and many details of the implementation structure. But even though this offers a lot of value, it is not realistic to expect developers to know all details of the standard by heart, much less to apply the standard consistently. The MAST templates and the MAST Solution builder provide you with a MAST compliant baseline, but once you start fleshing out that baseline, how will you make sure that you will remain compliant to the standard?
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;This concern is even more pressing because the Factory IDE tools rely on MAST compliance. If your source is not MAST compliant, there is no guarantee that the Factory IDE tools (e.g. automatic deployment) will work correctly.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;To address this concern we created the MAST Validator. As the name implies, the MAST Validator validates the source in the working folder against the MAST standard. We implemented the MAST Validator as an FxCop rule library:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver19.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;The MAST Validator analyzes much more than typical FxCop rule libraries, which usually only analyze compiled assemblies. The MAST Validator also analyzes source files (including Visual Studio project files) and even databases.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;Where applicable, MAST rules adjust themselves automatically to customized templates. E.g. in the example above, the project references in the template solution (which can be customized just as any other solution in a Factory product) are interpreted by the rule as the set of all &lt;em&gt;potential&lt;/em&gt; valid project references. If a non-template solution contains any other project reference, the rule reports this as an error. This allows for automatically detecting unwanted dependencies, much like the Layering Diagram in VS 2010 will provide.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;In case you wonder why we integrated the MAST rule library in FxCop instead of directly in Visual Studio, this is because FxCop provides us with additional UI that supports the audit process. In FxCop you can exclude rule messages with a reason, and you can see all exclusion reasons at a glance. When you want to do a quick audit of a product, you run FxCop, verify that no active MAST messages exist, and whether you agree with the rationale provided in the notes of excluded messages:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/042409_1526_FactoryOver20.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;The Factory IDE will only create MAST deployment packages if there are no active MAST error messages; this effectively enforces MAST compliance throughout the application's lifetime.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;The MAST Validator helps you to keep your source MAST compliant, and to audit on MAST compliancy, with little effort. At the same time flexibility is preserved: you can ignore rule messages if you record a satisfying rationale to do so.
&lt;/p&gt;
&lt;h3&gt;Factory Local Build Server&lt;br /&gt;
&lt;/h3&gt;
&lt;p style="margin-left: 36pt"&gt;The Factory fully supports Visual Studio Team Foundation Server build servers. However as an alternative for smaller projects, a lightweight build server is also included in the Factory IDE:
&lt;/p&gt;
&lt;</description>
	<link>http://vincenth.net/blog/archive/2009/04/24/factory-overview-part-1-a-bird%e2%80%99s-eye-view-of-the-macaw-solutions-factory.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/04/24/factory-overview-part-1-a-bird%e2%80%99s-eye-view-of-the-macaw-solutions-factory.aspx?</guid>
	<pubDate>Fri, 24 Apr 2009 10:26 GMT</pubDate>

</item>

<item>
	<title>Factory Vision, Part 1: Introducing the Macaw Solutions Factory</title>
	<description>&lt;p&gt;This is the start of a story about a three-year companywide Software Factory effort. The result is not your common code-generating or process-focused factory. In our effort to realize maximum value, we focused on solving common challenges that existing factories do not address.
&lt;/p&gt;
&lt;p&gt;We created a Factory to automate and standardize development and deployment on top of Microsoft Server products, targeting shared infrastructures with .NET, SQL Server, SQL BI, BizTalk and SharePoint:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi1.gif" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;Interested? Read on…
&lt;/p&gt;
&lt;h2&gt;History&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;For the past three years it has been my job to move Macaw, a Microsoft Systems Integrator, to a software factory approach.
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi2.png" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.macaw.nl/"&gt;Macaw&lt;/a&gt; specializes in realizing IT solutions with the latest Microsoft technologies. While Macaw is organized in several Solution Centers that each specialize in specific types of IT Solutions, it is common for Macaw's clients to run these different solution types on a shared infrastructure (deployed on the same set of machines) and a common Microsoft technology stack (deployed on the same Microsoft server product installations, e.g. SharePoint). We created a Factory to support this.
&lt;/p&gt;
&lt;p&gt;Three years ago, based on experience gained at Macaw's (then) largest customer, &lt;a href="http://vincenth.net/blog/archive/2006/04/14/realizing-the-software-factories-vision-for-a-microsoft-systems-integrator.aspx"&gt;I proposed a vision&lt;/a&gt; to create a single, durable software factory to support 80% of Macaw's work as a Systems Integrator.  The vision was recognized and adopted by &lt;a href="http://blogs.macaw.nl/user/Profile.aspx?UserID=2103"&gt;Maarten Sikkema&lt;/a&gt;, co-founder and CTO of Macaw, and with his support things were set in motion. I became member of a dedicated Factory core team, which was tasked with designing, building and embedding the &lt;strong&gt;Macaw Solutions Factory&lt;/strong&gt; company-wide.
&lt;/p&gt;
&lt;p&gt;I convinced Macaw's key technology experts and development community leaders to participate in creating the core Factory standard – the &lt;strong&gt;Microsoft .NET Architecture Style&lt;/strong&gt; (MAST). The entire Factory initiative is driven by voluntary participation (building the Factory) and adoption (using the Factory), as opposed to a mandatory approach. Although this did take a lot of extra effort and discussion to get people on-board, the resulting commitment was strong and durable because people really believed in the initiative and they felt it was also &lt;em&gt;their&lt;/em&gt; factory. Durable community commitment is key for a durable factory approach; this is a necessary and worthwhile effort.
&lt;/p&gt;
&lt;p&gt;After the first year, &lt;a href="http://weblogs.asp.net/Soever/"&gt;Serge van den Oever&lt;/a&gt; joined the core Factory team. As Macaw's resident SharePoint guru he started out adding SharePoint support to the Factory, but since then Serge continued to add many key innovative elements to the Factory (PowerShell integration, the Factory Wiki, and the Factory Guide Visual Studio extension).
&lt;/p&gt;
&lt;p&gt;As Factory usage became more and more widespread, an extended team of &lt;strong&gt;Factory Champions&lt;/strong&gt; was created, with members from all solution centers. The Factory Champions were tasked with continually improving Factory usage and usability for their respective centers. Finally a strategy was put into place to integrate results of Macaw innovation projects into the Factory.
&lt;/p&gt;
&lt;p&gt;During this time, we consciously maintained an internal focus, supporting and strengthening Macaw's capabilities as a Microsoft Systems Integrator.
&lt;/p&gt;
&lt;h2&gt;Today&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;The Factory has been adopted throughout the company and has been sold under license for use by non-Macaw personnel. The people and processes to continually improve the Factory are in-place. We are integrating the latest Microsoft technologies as they are applied and we capture best practices as we learn them, across all solution centers. Now we feel it is time to share what we have learned and achieved.
&lt;/p&gt;
&lt;p&gt;In several factory blog post series, &lt;a href="http://blogs.macaw.nl/user/Profile.aspx?UserID=2103"&gt;Maarten&lt;/a&gt;, &lt;a href="http://weblogs.asp.net/Soever/"&gt;Serge&lt;/a&gt; and &lt;a href="http://vincenth.net"&gt;I&lt;/a&gt; will cover the Factory vision, overview, features, usage and customer cases.&lt;br /&gt;You can use &lt;a href="http://app.feed.informer.com/digest3/SX6KV6S6UP.rss"&gt;this feed&lt;/a&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi3.png" alt=""/&gt; to easily track Factory posts by all contributors.
&lt;/p&gt;
&lt;h2&gt;Vision&lt;br /&gt;
&lt;/h2&gt;
&lt;p&gt;Ok, enough history. Since this is the first installment in the Factory Vision series, let me outline the key elements of our vision on a Software Factory for a Microsoft Systems Integrator.
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;span style="background-color:yellow"&gt;Note: for this introductory post I will stick to the high-level view; it is long enough as it is. However we intend to quickly zoom in on the key details in the next posts, right down to the &#8216;bare metal'.&lt;/span&gt;
	&lt;/p&gt;
&lt;h3&gt;Design goals&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;When designing the Factory, we set these goals:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fit at least &lt;strong&gt;80%&lt;/strong&gt; of Macaw's work as a systems integrator, specialized in the latest Microsoft &lt;strong&gt;technologies&lt;/strong&gt;.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Be effective for very &lt;strong&gt;small teams&lt;/strong&gt; (1 – 2 persons) as well as &lt;strong&gt;large teams&lt;/strong&gt; (15 persons).&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Support multiple, independently versioned solutions running on a &lt;strong&gt;shared infrastructure&lt;/strong&gt;. Large projects or programs are often organized into multiple teams of 5-8 persons each, where all teams work on the same chain of DTAP (development, test, acceptation, production) environments. This means that the Factory must be versionable per solution; different factory versions must be able to live side-by-side in a shared development environment.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Be effective for short, &lt;strong&gt;simple&lt;/strong&gt; projects (a simple web site) as well as long, &lt;strong&gt;complex&lt;/strong&gt; ones (a SOA).&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Deliver &lt;em&gt;&#8220;Tomorrow's IT, Today&#8221;&lt;/em&gt;,&lt;em&gt;&lt;br /&gt;
			&lt;/em&gt;company-wide. Allow the knowledge and experience of Macaw's &lt;strong&gt;top&lt;/strong&gt;&lt;br /&gt;
			&lt;strong&gt;innovators&lt;/strong&gt; who are working on projects to be &lt;strong&gt;captured&lt;/strong&gt; with minimal overhead, and then distributed company-wide, &lt;strong&gt;quickly&lt;/strong&gt;. This requires easy factory customizability in an ongoing project, frequent factory releases, and easy factory upgrades (also in ongoing projects).&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Be &lt;strong&gt;durable&lt;/strong&gt;, meaning that the effort in maintaining the factory – integrating new technologies and practices as they are learned by Macaw - should remain constant, while the total generated value of the factory keeps increasing. This means embedding Factory maintenance and innovation in the organization, and partitioning the Factory components across the underlying Microsoft server products and across the different versions of those server technologies.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Overall vision&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;Overall we envisioned a durable, company-wide Factory approach that would relieve people from the same tedious, error-prone, repetitive tasks that they encounter on many projects. Instead, they are able to focus on what is specific and innovative for the current project, while the Factory provides them up-to-date, combined knowledge and experience of their best colleagues at their fingertips. This approach will bring every team closer to the level of the company's very best combined; a dream team.
&lt;/p&gt;
&lt;h3&gt;Core Factory value&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;Key to the value of the Factory is the value of Macaw's best innovators, who are leaders in their respective fields, working in innovative projects. The Factory amplifies this value (making it available for other teams) and also makes it more durable (even after the expert leaves the company, the &lt;em&gt;captured&lt;/em&gt; knowledge and experience remains available). In a market where top IT talent remains scarce, hard to come by and hard to retain, this Factory approach provides a significant strategic advantage for an innovative systems integrator.
&lt;/p&gt;
&lt;p&gt;Customers benefit from consistent high levels of productivity and expertise that - across the board - are simply unattainable for traditional systems integrators who still use a manual, one-off approach to development. When customers license the Factory for use by non-Macaw personnel, they boost those developers with Macaw's packaged expertise.
&lt;/p&gt;
&lt;h3&gt;What can you build with the Factory?&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;The first step in defining a Factory is describing what types of solutions you can build with it – what the targeted &lt;em&gt;software product family&lt;/em&gt; is. We observed a large overlap across different solution types with respect to what Microsoft server products are used and what best practices are applied. In addition to that, different solution types often coexist on a single shared infrastructure.
&lt;/p&gt;
&lt;p&gt;So instead of building a separate factory for each type of IT solution, we decided to define a single Factory that can build:
&lt;/p&gt;
&lt;p style="margin-left: 36pt"&gt;&lt;em&gt;&#8220;Solutions composed from a combination of custom .NET code and zero or more Microsoft server products&#8221;&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;The phrase &#8220;zero or more&#8221; indicates that we target solutions ranging from the &#8216;traditional' fully custom solutions to solutions based on standard server products. The latter type of solutions has become predominant for Macaw's clients; as much as possible of the functionality is bought with standard server products. The remaining functionality is then realized by customizing and extending the standard products:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi4.png" alt=""/&gt;
	&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Examples of custom components are web pages, console UI or windows UI, business components, workflows and business entities.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Product extensions are specific types of components that Microsoft has defined to allow extending the functionality of their server products through code, such as web parts for SharePoint or pipeline components for BizTalk.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;Product configurations are product-specific settings and data that specify how to use the product's existing functionality, such as configuration of web sites and web applications in IIS, site definitions for Moss 2007 and custom databases for SQL Server.&lt;br /&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Factory supports building small or simple solutions equally well as building large or complex solutions. The Factory is automatically configured to only include the tools and templates that you actually need for the solution at hand. If the solution is &#8216;light', the factory will also be &#8216;light', e.g. to build:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi5.png" alt=""/&gt;
	&lt;/p&gt;
&lt;h3&gt;What does the Factory &lt;em&gt;do&lt;/em&gt; for you?&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;Like most factories, this Factory increases developer productivity and quality by automating repetitive, error-prone development tasks. When building the above types of solutions, this is how the Factory addresses the most common big challenges for you:
&lt;/p&gt;
&lt;div&gt;
&lt;table style="border-collapse:collapse" border="0"&gt;
&lt;colgroup&gt;&lt;col style="width:318px"/&gt;&lt;col style="width:318px"/&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-top:  solid black 0.5pt; border-left:  solid black 0.5pt"&gt;
&lt;p style="text-align: center"&gt;&lt;strong&gt;Challenge&lt;/strong&gt; &lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-top:  solid black 0.5pt; border-right:  solid black 0.5pt"&gt;
&lt;p style="text-align: center"&gt;&lt;strong&gt;Strategy&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-left:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi6.jpg" alt=""/&gt;&lt;em&gt;Install development machines&lt;/em&gt;&lt;br /&gt;For every person working in a development environment, a project-specific development machine must be installed with all required server products in a consistent configuration. This often involves many manual, error-prone steps; it is quite common to spend several working days installing and configuring a development machine correctly. Inconsistent installations also cost time downstream due to incomplete functionality, local defects or inability to reproduce defects from other environments.&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-right:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi7.png" alt=""/&gt;&lt;em&gt;Automated Factory Machine Installer&lt;br /&gt;&lt;/em&gt;Virtual development and test machines are created fully automated, providing multiple OS choices in 32 and 64 bits variations. From a single selection menu all required server products are installed fully automatic on each machine in a single scripted step, with all the latest service packs and patches.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-left:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi8.png" alt=""/&gt;&lt;em&gt;Deployment&lt;/em&gt;&lt;br /&gt;
							&lt;br /&gt;Deployment needs to be done many times during the entire application lifecycle, throughout different environments. However extensions and configurations for Microsoft Server products require a wide variety of deployment tools and many error-prone, manual steps.
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-right:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi9.png" alt=""/&gt;&lt;em&gt;Automated deployment&lt;/em&gt;&lt;br /&gt;Fully automated deployment across all DTAP (Development, Test, Application and Production) environments.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-left:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi10.png" alt=""/&gt;&lt;br /&gt;
							&lt;em&gt;Maintainability&lt;/em&gt;&lt;br /&gt;Maintaining a clear, consistent, stable source structure over time and across solutions for a wide variety of component types while developers, functionality and technology change.
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-right:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi11.jpg" alt=""/&gt;&lt;em&gt;Standard implementation structure&lt;/em&gt;&lt;br /&gt;The Microsoft .NET Architecture Style (MAST) standard provides a standards-based, durable, stable yet flexible implementation structure that is consistent across Microsoft server products and technologies. MAST offers separation of concerns, alignment with underlying server products, and cost-effective automation through convention over configuration.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi12.jpg" alt=""/&gt;&lt;em&gt;Specialist knowledge&lt;/em&gt;&lt;br /&gt;How to make all required specialist knowledge of the underlying server products available in each development team, while specialist fields are narrow and scarce specialists are distributed across the organization.&lt;/p&gt;
&lt;/td&gt;
&lt;td style="padding-left: 7px; padding-right: 7px; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt"&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi13.jpg" alt=""/&gt;&lt;em&gt;Community driven guidance in context&lt;/em&gt;&lt;br /&gt;Like most factories, specialist knowledge and best practices are packaged in templates and tools.&lt;/p&gt;
&lt;p&gt;Going beyond that static approach, we also provide community driven guidance in context. Within Visual Studio the actions that are relevant in the current context are displayed. Guidance on each action is available in a single central Wiki – both approved guidance and community content. When any community member enters some guidance, it instantaneously becomes visible and available for all Factory users, when they are working in a relevant context.
&lt;/p&gt;
&lt;p&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi14.jpg" alt=""/&gt;&lt;em&gt; New world of work&lt;/em&gt;&lt;br /&gt;We provide the infrastructure to enable all employees to work &lt;em&gt;together&lt;/em&gt; from any location, ad-hoc. They can work together on the same machine screen while talking to each other, allowing them to work together as least as effective as when they were physically working on the same machine.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;
 &lt;/p&gt;
&lt;h3&gt;What's in the box?&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;So now we have seen what types of solutions you can build with the Factory, and which common challenges the Factory helps you address. Now it's time to look at what exactly the Factory itself is. Here is our governing definition of the Factory:
&lt;/p&gt;
&lt;p&gt;&lt;img src="http://vincenth.net/blog/wp-content/uploads/040709_1557_FactoryVisi15.jpg" alt=""/&gt;
	&lt;/p&gt;
&lt;p&gt;As you can see this is quite a broad definition for a factory. We explicitly include not only the development tools and templates, but also all infrastructure that enables the Factory users to work (together) from any location. One of the main pillars of our factory is to support the &#8220;New World of Work&#8221;. This is part of our strategy to handle the challenge of distributed specialist knowledge.
&lt;/p&gt;
&lt;h3&gt;How do we ensure sustained, increasing Factory value?&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;From the outset durability was a design goal for our entire factory approach. The main steps we took to realize this were:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We embedded Factory usage and usability in the organization by creating the Factory Champions team and working closely together, while keeping Factory usage a choice.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;We proposed the Macaw Innovation Board, as a central place to provide overview and direction on all innovation projects. This allows to integrate and align innovation projects and the Factory to each other.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;We created a Factory Improvement Forum with voting, open to all Factory users, to allow community-driven feature proposal and prioritization. This ensures that we are always working on the &lt;em&gt;right&lt;/em&gt; features, that are the most wanted and valuable for the project teams.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;We partitioned the Factory components across the underlying Microsoft server products and across the different versions of those server technologies, so we can distribute our maintenance effort proportionally to how much value is currently generated with a specific technology. Obsolete (versions of) technology can be removed in newer Factory versions very easily, while older Factory versions that still use that technology can continue to live side-by-side with newer Factory versions.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;We made the Factory implementation very open and easily modified and extended. We implemented a large part of the Factory functionality in open PowerShell scripts to allow quick customization without the need for separate Factory source code or a Factory development environment. Our solution templates are customized with the same ease as when coding in regular Visual Studio Solutions. This way the innovation can be driven by projects on the go, modifying their factory instance as they learn.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;We provide on-call consultancy from the core Factory team to help innovators extend the Factory within their project context in such a way that the result is suitable for other projects, and for integration in new Factory releases.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;We provide one-click functionality to any Factory user to share guidance on any Factory action, or to post remarks or requests to clarify guidance. The community contributions are then used to create or improve the approved guidance. This way we prevent a central documentation bottleneck and we prevent work on guidance that is not needed.&lt;br /&gt; 
&lt;/li&gt;
&lt;li&gt;The Factory IDE is versioned with each product that is built with it; multiple Factory versions can live side-by-side on the same machine. This way, factory upgrades and customizations can be done independently for each solution, even when the solutions are developed in shared DTAP environments. The impact of Factory upgrades is much less, because you only upgrade for projects if and when the benefits are significant in the current lifecycle stage of the solution.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Closing remarks&lt;br /&gt;
&lt;/h3&gt;
&lt;p&gt;I hope this post gives you an impression of where we have come from and where we are heading with our Factory approach. For me it is a privilege and a joy to be realizing this vision.
&lt;/p&gt;
&lt;p&gt;I would like to take this opportunity to thank everyone who helped to make this possible. In particular I would like to thank Maarten Sikkema for his unwavering belief and support to let us realize this vision, and his personal, hands-on involvement. Also many thanks to Serge van den Oever for the great teamwork and his many innovative ideas. Thanks to the Factory Champions team who encouraged and helped their colleagues to use the Factory and who provide us with invaluable feedback and direction. Thanks to the innovators who volunteered to integrate their learnings in the Factory, and last but not least thanks to all Macawers who believe in and use the Factory.&lt;/p&gt;
&lt;p&gt;Moving forward, realizing tomorrow's IT, today, the road ahead beckons brightly. In this article I outlined the vision that resulted in the Factory as it exists today. More recent developments in Microsoft IT have inspired us to expand our vision. Specifically VS Team System 2010, Microsoft Azure, GoGrid, ElasticHosts, and textual and graphical modeling with M and Quadrant offer great potential for future Factory versions, to raise the abstraction level, target cloud solutions and offer factories in the cloud, and to target more team roles and application lifecycle management (ALM) aspects. But more on that at a later time…
&lt;/p&gt;
&lt;p&gt;
 &lt;/p&gt;
&lt;p&gt;Vincent Hoogendoorn&lt;/p&gt;
</description>
	<link>http://vincenth.net/blog/archive/2009/04/07/factory-vision-part-1-introducing-the-macaw-solutions-factory.aspx</link>
	<source url="http://vincenth.net/blog/archive/category/factory/feed">VincentH on .NET &amp;#187; Macaw Solutions Factory</source>
	<guid isPermaLink="false">http://vincenth.net/blog/archive/2009/04/07/factory-vision-part-1-introducing-the-macaw-solutions-factory.aspx?</guid>
	<pubDate>Tue, 07 Apr 2009 10:57 GMT</pubDate>

</item>

<item>
	<title>Self-Service deployment with VMM and the Microsoft Deployment Toolkit</title>
	<description>&lt;P&gt;What is the best way to organize and maintain a software development infrastructure? At Macaw (and I think most software development environments), virtualization has become an essential part of the way we do our work. For most projects, we "clone" a standard development image for each team member and each integration, test and build server. Team members run their virtual machine using &lt;A href="http://www.microsoft.com/windows/products/winfamily/virtualpc/overview.mspx"&gt;Virtual PC&lt;/A&gt; or &lt;A href="http://www.microsoft.com/windowsserversystem/virtualserver/default.aspx"&gt;Virtual Server&lt;/A&gt; on their notebook or desktop, often using external hard drives for better performance. The project servers are hosted in our centrally managed Virtual Server environment. &lt;/P&gt;
&lt;P&gt;But this approach has many disadvantages: security is an issue with laptops getting stolen and USB drives getting lost, reliability is an issue with external hard drives crashing, performance is sluggish because of memory constraints and disk performance of laptops. We use Vista x64 on all our laptops with bitlocker enabled, this is quite secure but virtual machine performance is not very good, even on very powerful laptops with 4 Gigs of ram, especially when you run "heavy" virtual machines with Visual Studio, SQL Server and MOSS installed. &lt;/P&gt;
&lt;P&gt;So we had to come up with a better solution. This solution was found in &lt;A href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/default.aspx"&gt;Microsoft Virtual Machine Manager&lt;/A&gt; (VMM) combined with Windows 2008 &lt;A href="http://technet.microsoft.com/en-us/library/cc731264.aspx"&gt;Terminal Services Gateway&lt;/A&gt; (TSG) for remote access. In this setup we run all virtual machines in a centrally managed server environment, using Remote Desktop or &lt;A href="http://technet.microsoft.com/en-us/library/cc753844.aspx"&gt;RemoteApp&lt;/A&gt; to access the development machines. This infrastructure provides better performance because virtual machines run on fast servers with quadcore processors and fast disk systems. And there is no project data on remote laptops anymore, so security and reliability are much, much higher. At Macaw, we initially built our Virtual Machine environment on VMM 2007 and Virtual Server 2005 R2, last month we upgraded this environment to &lt;A href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/default.aspx"&gt;VMM 2008&lt;/A&gt; and &lt;A href="http://www.microsoft.com/servers/hyper-v-server/"&gt;Hyper-V Server 2008&lt;/A&gt; on all virtual machine hosts. This infrastructure has quickly become very popular within Macaw, especially TSG works really well.&lt;/P&gt;
&lt;P&gt;However, there is always another problem to solve. Now, we were creating and managing much more virtual machines in the central environment. Because most of our project-related infrastructure was now hosted centrally that meant extra work for our internal IT staff. Setting up a new development environment for a small team, with a few development machines and some build and test servers, costs a lot of work. Also, our one-size-fits-all development image, based on Windows 2003 Enterprise with Visual Studio 2005, SQL Server 2005 and MOSS, had inherent drawbacks. Cloning an image that has MOSS and SQL Server installed is not without issues. We have solved these, but it is unsupported and never felt 100% "right". The image also began to show its age: more and more projects were asking for 64 bits hardware, Windows 2008, Visual Studio 2008 and SQL Server 2008. The number of permutations with the 2005 and 2008 stack of software is large, so the cloning approach was no longer a viable solution. &lt;/P&gt;
&lt;P&gt;For this reason we are now introducing the &lt;EM&gt;Factory Installer&lt;/EM&gt;. What we created is a self-service model for completely installing development machines that can be used by any project team in our organization and Solutions Factory customer (we will sell this solution as as part of our Solutions Factory). After approval by a manager, the team receives VMM "quota points" and can go to the VMM Self Service Portal (a standard web interface for management of virtual machines, provided by VMM) and start creating virtual machines based on Virtual Machine templates. Currently we have 4 Operating System templates available: Windows 2003 x86 and x64, Windows 2008 x86 and x64. After computer name and admin password have been given, the new machine is created, deployed to a server host and started. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="/photos/maarten/images/37280/640x451.aspx"&gt; &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;VMM 2008 Self Service Portal &lt;/EM&gt;&lt;/P&gt;&lt;IMG src="/photos/maarten/images/37282/630x480.aspx"&gt; 
&lt;P&gt;&lt;EM&gt;Create new virtual machine based on template &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;At first login, the user is presented the Factory Setup Wizard. This wizard lets you install the complete software application suite for this new virtual machine in one single process. We currently support: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;.NET Framework 3.5 Sp1 
&lt;LI&gt;Visual Studio 2005, 2008 
&lt;LI&gt;SQL Server 2005, 2008, with Analysis, Integration, and Reporting Services as separate options 
&lt;LI&gt;WSS3 and MOSS 2007 
&lt;LI&gt;Biztalk 2006 R2 
&lt;LI&gt;Popular utilities like Firefox, 7Zip, Adobe Reader, Flash and Silverlight &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Below are some images from the Installation Wizard. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="/photos/maarten/images/37284/630x480.aspx"&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Select applications to be installed &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="/photos/maarten/images/37286/630x480.aspx"&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Confirmation Dialog: after this screen the unattended installation will run for up to 4 hours, depending on selected applications &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;After selection of the applications needed for the project, the Installer gets to work. Each software package is installed silently, with reboots in between. All applications come preconfigured with the most recent updates and service packs and installed according to our guidelines, and the latest security updates are installed automatically. Installation of a "loaded" server can take up to 4 hours time, but you don't have to wait for that: no manual intervention is required during the process. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="/photos/maarten/images/37287/638x480.aspx"&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;During the install sequence &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;We created the Factory Installer using the Microsoft Deployment Toolkit. This freely available toolkit was originally created for deployment of desktop computers, but now also supports installation of server operating systems and custom task sequences. We have loaded the toolkit with modified instances of Windows 2003 and 2008 OSses, Virtual Server 2005 and Hyper-V drivers and created unattended installation scripts for those server and client applications that we use most often on our machines. There is a lot of technology at work here, you have to go through a lot of steps, but the whole mechanism works beautifully. Getting some applications (Visual Studio is an example) to install properly and silently takes a lot of magic; it cost us a lot of time to get every combination working correctly. We are still hard at work getting the final wrinkles out. But now that we have this whole mechanism working, from now on it will be very easy to start supporting a new operating system such as Windows 2008 R2 or add an application such as PerformancePoint to the wizard. To add an OS, we would create a customized unattended install of the new OS using vLite and the System Image Editor, add it in the Deployment Workbench, deploy it to an empty virtual machine, create a VMM Template from it and add this template to self service policies. Users can then start using the new OS for experimentation, and install all of the existing applications on it without extra effort. This will save us a lot of time and effort. &lt;/P&gt;
&lt;P&gt;&lt;IMG src="/photos/maarten/images/37288/565x480.aspx"&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The Microsoft Deployment Workbench &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Personally I think this solution is interesting not only to us, but for any organization that regularly deploys (virtual) servers with a variation of application software. Using the method I described, it is not too hard to create a deployment system like this in your own environment, especially if you have some prior experience with automated Windows deployment (i.e. &lt;A href="http://msdn.microsoft.com/en-us/library/aa967394(VS.85).aspx"&gt;WDS&lt;/A&gt;, RIS, &lt;A href="http://www.microsoft.com/systemcenter/configurationmanager/"&gt;System Center Configuration Manager&lt;/A&gt;, &lt;A href="http://www.symantec.com/business/deployment-solution"&gt;Altiris&lt;/A&gt;). But you will find that, although it is not hard to get the basic process working, it &lt;EM&gt;is &lt;/EM&gt;hard to get a complete set of hardware environments, OSses and applications working really well in combination. It takes a lot of testing and that costs a lot of time. &lt;/P&gt;
&lt;P&gt;For those who don't want to spend that time, we will sell this solution as a separate module of the Macaw Solutions Factory. It must be mentioned that this is not shrink-wrapped software, customization will always be needed because for many of the supported applications there is licencing involved, and the customer has to provide valid product keys for each OS and application that goes into the solution. &lt;/P&gt;
&lt;P&gt;Finally, it is nice to know that this solution works just as well for physical server deployment and even cloud-based deployment: create a CD/DVD deployment point, upload the very large ISO file that Deployment Workbench will generate to cloud-based storage, attach the ISO file to a newly created cloud-based server (with Windows installed or even completely empty), boot it, and off it goes!&lt;/P&gt;&lt;img src="http://blogs.macaw.nl/aggbug.aspx?PostID=37279" width="1" height="1"&gt;</description>
	<link>http://blogs.macaw.nl/blogs/application_services_hosting_beheer_security/archive/2009/01/08/37279.aspx</link>
	<source url="http://blogs.macaw.nl/blogs/application_services_hosting_beheer_security/rss.aspx?CategoryID=1020">Application Services (Hosting, Beheer, Security) : Factory Overview</source>
	<guid isPermaLink="false">http://blogs.macaw.nl/blogs/application_services_hosting_beheer_security/archive/2009/01/08/37279.aspx?</guid>
	<pubDate>Thu, 08 Jan 2009 08:03 GMT</pubDate>

</item>


</channel></rss>

