<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Technology</title><link>http://wah.onterra.net/blog/category/7.aspx</link><description>Technology</description><managingEditor>Martin Granell</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Martin Granell</dc:creator><title>Back in the world of blogging, just moved.</title><link>http://wah.onterra.net/blog/archive/2006/05/18/10772.aspx</link><pubDate>Thu, 18 May 2006 14:10:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2006/05/18/10772.aspx</guid><description>&lt;P&gt;&lt;FONT face=Tahoma&gt;New blog home: &lt;/FONT&gt;&lt;A href="http://granell.net/martin"&gt;&lt;FONT face=Tahoma&gt;http://granell.net/martin&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Its been a while, but I now have my blogging fingers primed, after a long absence, having been very busy offline these past few months. I will also be putting up my demos and slides from the various user groups/conferences I've been at during this time, so see you there.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Wah.Onterra is dead, long live Granell.NET&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Yours,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Martin&lt;/FONT&gt;&lt;/P&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/10772.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>#! /usr/bin/vbc  support for windows script (or self-compiling .NET scripts)</title><link>http://wah.onterra.net/blog/archive/2005/08/09/2804.aspx</link><pubDate>Tue, 09 Aug 2005 11:27:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/08/09/2804.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=2804"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;One of the &amp;#8220;nice&amp;#8221; things about the unix shell is the ability to create a script file that contains the program that will run the script at the top of the file. This allows all kinds of extensibility in the shell, and the ability to plug in your favourite script interpreter. This post shows how to create the same effect for .NET 1.1 on windows.&lt;/P&gt;
&lt;P&gt;I was just reading &lt;A href="http://www.adopenstatic.com/cs/blogs/ken/archive/2005/06/03/25.aspx"&gt;Ken Schaefer&lt;/A&gt;&amp;#8217;s blog about using Windows Scripting Host, and it reminded me of some old code I had written that was a self-compiling VB.NET WSF script. An example script is below:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;' vbc /r:System.Windows.Forms.dll&lt;BR&gt;'&amp;lt;job id="IncludeExample"&amp;gt;&amp;lt;script language="JScript"&amp;gt;var WshShell = WScript.CreateObject("WScript.Shell");var filespec = WshShell.ExpandEnvironmentStrings("%TEMP%")+"\\" +WScript.ScriptName+".exe";var fso=WScript.CreateObject("Scripting.FileSystemObject");if (fso.FileExists(filespec)) fso.DeleteFile(filespec);var ts=fso.OpenTextFile(WScript.ScriptFullName, 1);var comp = ts.ReadLine();comp=comp.substring(comp.indexOf(" ")+1);ts.Close();var f=fso.GetFolder(WshShell.ExpandEnvironmentStrings("%windir%\\Microsoft.NET\\Framework\\"));if (!f) WScript.Echo("You must have the .NET Runtime installed");var netVersion="";fc = new Enumerator(f.SubFolders);for (;!fc.atEnd(); fc.moveNext()){if (fc.item().name &amp;gt; netVersion)netVersion = fc.item().Path;}oExec = WshShell.Exec(netVersion + "\\" + comp + " /out:"+filespec+" /target:exe /debug "+WScript.ScriptFullName);while (oExec.Status == 0){if (!oExec.StdOut.AtEndOfStream){WScript.Echo(oExec.StdOut.ReadAll());}WScript.Sleep(100);};if (!oExec.StdOut.AtEndOfStream){WScript.Echo(oExec.StdOut.ReadAll());}if (!fso.FileExists(filespec)) WScript.Quit(1);oExec = WshShell.Exec(filespec);while (oExec.Status == 0){if (!oExec.StdOut.AtEndOfStream){WScript.Echo(oExec.StdOut.ReadAll());}if (!oExec.StdErr.AtEndOfStream){WScript.Echo(oExec.StdErr.ReadAll());}WScript.Sleep(100);};if (!oExec.StdOut.AtEndOfStream){WScript.Echo(oExec.StdOut.ReadAll());}if (!oExec.StdErr.AtEndOfStream){WScript.Echo(oExec.StdErr.ReadAll());}&amp;lt;/script&amp;gt;&amp;lt;/job&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;'&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;' A "Hello World!" program in Visual Basic.&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;Imports System&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;Imports Microsoft.VisualBasic&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;Imports System.Windows.Forms&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;Module Hello&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp; Sub Main()&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Console class from .NET&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Write("To the console...")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Intrinsic VB compatible code&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("Hello World!")&amp;nbsp;&amp;nbsp; ' Display message on computer screen.&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Example of using the shell object&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim shell as Object = CreateObject("WScript.Shell")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shell.Popup("hello2")&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Example of using a referenced assembly&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("This is using System.Windows.Forms")&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;End Module&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The magic in this script comes from the second line, which contains a valid WSF fragment. It is also VB.NET commented, so that the file is a valid VB.NET file. The code searches for the latest version of the .NET runtime, reads the first line of itself for the compiler and any additional arguments (e.g. references to other assemblies), compiles the .exe into the TEMP directory, and then runs the executable, making sure to copy standard out and error out into the console window.&lt;/P&gt;
&lt;P&gt;To run the example, copy it into a file named foo.wsf, and run:&lt;/P&gt;
&lt;P&gt;cscript foo.wsf&lt;/P&gt;
&lt;P&gt;If you wanted to use the c# compiler instead, it would be a small matter of changing the compiler in the first line, and making the code compatible (of course you couldn&amp;#8217;t use the late binding support available within VB.NET). Now you have the full power of .NET without having to run the compiler manually&amp;#8230;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/2804.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>Enterprise Library Demo from tonights user group meeting</title><link>http://wah.onterra.net/blog/archive/2005/02/18/288.aspx</link><pubDate>Fri, 18 Feb 2005 00:27:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/02/18/288.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=288"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;Here&amp;#8217;s the web service that I demoed tonight. This web service provides an authenticated and instrumented web service that uses a persistent, encrypted database cache to support web farm caching of generated results in 60 lines of code. It also (coincidentally) makes use of every one of the Enterprise Library application blocks directly, or through configuration.&lt;/P&gt;
&lt;P&gt;You can download the demo &lt;A href="http://wah.onterra.net/files/SecureGIS.zip"&gt;here&lt;/A&gt;. The powerpoint file&amp;nbsp;can be found at the Enterprise Library gotdotnet&amp;nbsp;&lt;A href="http://workspaces.gotdotnet.com/entlib"&gt;workspace&lt;/A&gt; (under releases on the right-hand side), &lt;A href="http://www.gotdotnet.com/workspaces/releases/checkForDownload.aspx?id=295a464a-6072-4e25-94e2-91be63527327&amp;amp;releaseid=00d295a8-c274-4ef9-9ac9-769a8924f389"&gt;this&lt;/A&gt; is a direct link to that file.&lt;/P&gt;
&lt;P&gt;To run, ensure that you have created the Caching and Security databases (by running the .cmd files in the Enterprise Library source). Add a user &amp;#8220;martin&amp;#8221;, password &amp;#8220;martin&amp;#8221; using the SecurityDatabaseConsole.exe program. Make sure that the ASPNET account has access to the databases. You may also need to run the &amp;#8220;Install Services&amp;#8221; script to register instrumentation sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/288.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>Declarative security with Enterprise Library (The Real Thing)</title><link>http://wah.onterra.net/blog/archive/2005/02/10/264.aspx</link><pubDate>Thu, 10 Feb 2005 00:42:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/02/10/264.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=264"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;Lets start off with &lt;I&gt;&lt;SPAN style="FONT-STYLE: italic"&gt;Why bother to use declarative security attributes?&lt;/SPAN&gt;&lt;/I&gt; It&amp;#8217;s only a few more lines of code to write:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&amp;nbsp;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;public &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;void &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;DoSomethind()&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IAuthorizationProvider prov = AuthorizationFactory.GetAuthorizationProvider();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;if&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;(!prov.Authorize(Thread.CurrentPrincipal, "important stuff"))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;throw &lt;/SPAN&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;new &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;SecurityException("Not allowed to do this");&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Versus:&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;[AuthorizationPermission(SecurityAction.Demand,&amp;nbsp; Context = "important stuff")]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;public &lt;/SPAN&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;void &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;DoSomethind()&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma&gt;But there are two main advantages to the attribute approach (as well as reduced LOC, and cleaner code):&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The ability to read the metadata. Permview is an example of an application that can read the meta data from an assembly, and spits out the following for the method above:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Lucida Console'"&gt;&amp;nbsp;Method AuthTest.Class1::DoSomethind() NonCasDemand permission set:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;&lt;SPAN style="COLOR: maroon; FONT-FAMILY: 'Lucida Console'"&gt;PermissionSet &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Lucida Console'"&gt;class&lt;/SPAN&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;="System.Security.PermissionSet"&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=fuchsia&gt;&lt;SPAN style="COLOR: fuchsia; FONT-FAMILY: 'Lucida Console'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Lucida Console'"&gt;version&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;="1"&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Lucida Console'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=maroon&gt;&lt;SPAN style="COLOR: maroon"&gt;IPermission&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red&gt;&lt;SPAN style="COLOR: red"&gt;class&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue"&gt;="Readify.EnterpriseLibrary.Permissions.AuthorizationPermissionXml, Readify.Entlib.Permissions"&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=fuchsia&gt;&lt;SPAN style="COLOR: fuchsia; FONT-FAMILY: 'Lucida Console'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Lucida Console'"&gt;version&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;="1"&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=fuchsia&gt;&lt;SPAN style="COLOR: fuchsia; FONT-FAMILY: 'Lucida Console'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Lucida Console'"&gt;unrestricted&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;="False"&lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=fuchsia&gt;&lt;SPAN style="COLOR: fuchsia; FONT-FAMILY: 'Lucida Console'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red&gt;&lt;SPAN style="COLOR: red; FONT-FAMILY: 'Lucida Console'"&gt;context&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;="important stuff"/&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;&lt;/&lt; span&gt;&lt;SPAN style="COLOR: maroon; FONT-FAMILY: 'Lucida Console'"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;/PermissionSet&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Lucida Console'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Tahoma color=#000000&gt;This then allows us to scan all the assemblies in the application, and build up a manifest of which methods are protected by which authorities.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; Flexibility &amp;#8211; If we want to add additional logging to our attribute, or change the factory behaviour, we have one level of isolation from the underlying authorization source (in this case enterprise library).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000&gt;OK, well how do we build one? Have a look at the source from &lt;/FONT&gt;&lt;A href="http://projectdistributor.readify.net/Projects/Project.aspx?projectId=1"&gt;&lt;FONT face=Tahoma color=#0000ff&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma color=#000000&gt; to see a finished custom non-code access security attribute. See this &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/eugene_bobukh/archive/2004/03/10/87645.aspx"&gt;&lt;FONT face=Tahoma color=#0000ff&gt;post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma color=#000000&gt; for an overview of the process.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000&gt;There are a few tricks to know:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The attribute must derive from CodeAccessSecurityAttribute, &lt;B&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;even&lt;/SPAN&gt;&lt;/B&gt; if it is not a CAS attribute. If it just derives from SecurityAttribute, then the C# compiler will ignore it (although the VB.NET one does the right thing&amp;#8230;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The ToXml() method must create an element with the name IPermission, and there must be a class attribute with the assembly qualified name.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;3.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The assembly must be strongly named, otherwise you won&amp;#8217;t get the compiler to emit the permission.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;4.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The assembly must either be added to the GAC, or to the Visual Studio devenv.exe directory, for the VS.NET compiler to find it (although the command line compiler does not have the same problem).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;5.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The attribute &lt;B&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;must&lt;/SPAN&gt;&lt;/B&gt; have a single constructor which takes a single SecurityAction parameter. Don&amp;#8217;t be tempted to provide multiple parameters to initialize the attribute instead.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;6.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; The debugger is your friend. Debug visual studio by launching it in the program arguments of the project debugging properties, and step through what your permission and attribute is doing.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;7.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; Reflector is critical. When things start going wrong, the error messages are usually totally irrelevant. Look at the implementation of PermissionSet in reflector, and use permview to dump the XML that your attribute created.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo4"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Tahoma&gt;&lt;SPAN style="mso-list: Ignore"&gt;8.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; Unit tests. Unit tests. Unit tests. Unit tests. Did I mention unit tests?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000&gt;Now, point number 3 was that the assembly had to be strong named. Since we want to call the authorization interface in enterprise library, and the default installation of enterprise library is not strong named, this is a problem.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000&gt;Well&amp;#8230; back to reflection land. I&amp;#8217;ve created three wrapper classes, that on class constructor dynamically load the weakly named enterprise library using an assembly string, using reflection to grab MethodInfo instances for each the types, and then has some public wrapper methods that invoke the method infos.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000&gt;Performance should not be too bad, and should be outweighed by the real authorization costs being performed anyway. From a security perspective (Trojan succeptability), this is no worse than using the IAuthorizationProvider interfaces directly, if the enterprise library assemblies being used are not strongly named.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000&gt;If you do strongly name your enterprise library, then you can rip out the wrappers, and the calls to the wrappers, and replace with direct calls to the enterprise library factory and interfaces.&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/264.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>New release of String Resource Generator with multi-language SR.strings support</title><link>http://wah.onterra.net/blog/archive/2005/02/09/258.aspx</link><pubDate>Wed, 09 Feb 2005 22:33:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/02/09/258.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=258"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; There was a problem in the previous release. Method (b) would not work (thanks to VS.NET for not handling satellite assemblies correctly..). I've updated the instructions below, and the sample in the release, to cover what needs to be done to make it work:&lt;/P&gt;
&lt;P&gt;Hi Folks,&lt;/P&gt;
&lt;P&gt;The next release (&lt;STRIKE&gt;1.2.2&lt;/STRIKE&gt; 1.2.3) of the string resource tool is &lt;A href="http://projectdistributor.readify.net/Projects/Project.aspx?projectId=2"&gt;here&lt;/A&gt;&amp;#8230; Changes for this release are:&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt; More complete sample, that should cover all of the functionality of the Custom tool and Batch .exe&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt; Accessibilty option now works (with VB.NET &amp; C# only at this point, otherwise it can only be public, blame CodeDom).&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt; The Resource class generation can be turned off by using &amp;#8220;generate_class = false&amp;#8221;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;SPAN style="mso-list: Ignore"&gt;4.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt; SR.strings files can now contain multi-line resources, by doing the following:&lt;/P&gt;
&lt;P&gt;[strings]&lt;BR&gt;ResName(int age) = First Line&lt;BR&gt;= Second Line {0}&lt;BR&gt;= Third Line&lt;BR&gt;NextRes = Blah&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;SPAN style="mso-list: Ignore"&gt;5.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt; From release 1.2.1 onwards its possible to use 3 methods of having multiple locales resources in the same project.&lt;BR&gt;(a) Have a primary .resx file (e.g. SR.resx), with the CustomTool option set. Have secondary .resx files (e.g. SR.de.resx, SR.en.us.resx), which do not have a custom tool set.&lt;BR&gt;&lt;BR&gt;b) Have a primary SR.strings file, with one [strings] section with all the neutral resources, with the CustomTool set. Have secondary .strings files (e.g. SR.strings-de) _with_ the Custom Tool set, but with &amp;#8220;#! generate_class = false&amp;#8221; at the beginning of all the secondary .strings files, and locale dependent [strings] sections, e.g:&lt;BR&gt;&lt;BR&gt;SR.strings:&lt;BR&gt;[strings]&lt;BR&gt;ResName = blah&lt;BR&gt;&lt;BR&gt;SR.strings-de:&lt;BR&gt;#! generate_class = false&lt;BR&gt;[strings.de]&lt;BR&gt;ResName = German blah&lt;BR&gt;&lt;BR&gt;SR.strings-de-DE:&lt;BR&gt;#! generate_class = false&lt;BR&gt;[strings.de-DE]&lt;BR&gt;ResName = German in Germany blah&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2"&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;The extension on the secondary strings files can be anything, but the base filename must be the non-localized resource name. i.e. SR.de.strings &lt;STRONG&gt;is not valid &lt;/STRONG&gt;because the base name is &amp;#8220;SR.de&amp;#8220;. SR.strings-de is valid, because the base name is &amp;#8220;SR&amp;#8220;. &lt;BR&gt;&lt;BR&gt;c) Multi-locale .strings file. Have a SR.strings file with multiple [strings] sections, one for each locale. e.g.&lt;BR&gt;[strings]&lt;BR&gt;Res1 = Text&lt;BR&gt;...&lt;BR&gt;&lt;BR&gt;[strings.de]&lt;BR&gt;Res1 = German Override&lt;BR&gt;...&lt;BR&gt;&lt;BR&gt;[strings.de.DE]&lt;BR&gt;Res1 = Germany override&lt;BR&gt;...&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Note that you can combine all of these options if you wish. E.g. a primary SR.strings file with:&lt;BR&gt;[strings]&lt;BR&gt;[strings.en]&lt;BR&gt;[strings.en.US]&lt;BR&gt;&lt;BR&gt;And a secondary SR.strings-de file with:&lt;BR&gt;#! generate_class = false&lt;BR&gt;[strings.de-DE]&lt;BR&gt;[strings.de-CZ]&lt;BR&gt;&lt;BR&gt;which will generate:&lt;BR&gt;SR.de-DE.resx&lt;BR&gt;SR.de-CZ.resx&lt;BR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/258.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>Declarative security with Enterprise Library</title><link>http://wah.onterra.net/blog/archive/2005/02/03/244.aspx</link><pubDate>Thu, 03 Feb 2005 23:35:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/02/03/244.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=244"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt;: ok, so it's tomorrow, and I haven't done the post... however I have uploaded the files. You can get the source &lt;A href="http://projectdistributor.readify.net/Releases/Release.aspx?releaseId=6"&gt;here&lt;/A&gt;. Tomorrow, I promise, I'll put up a post describing how I built the code, what issues there were, and how to use it.&lt;/P&gt;
&lt;P&gt;Tomorrow I&amp;#8217;ll be posting some code I&amp;#8217;ve been working on that allow the use of declarative attributes to secure blocks of code, and uses Enterprise Library&amp;#8217;s authorization model to do so. An example line in VB.NET would be:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 0pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 0pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&amp;lt; AuthorizationPermission(SecurityAction.Demand, Context:="OrderBooks" &amp;gt; _&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt; OrderBooks()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P&gt;&lt;!--EndFragment--&gt;This is somewhat equivalent to the PrincipalPermission attribute, but uses (in this case the default) IAuthorizationProvider instance obtained through the enterprise library provider model.&lt;/P&gt;
&lt;P&gt;The code will show a few things:&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-list: Ignore"&gt;1)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; How to use the authorization API of enterprise library&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-list: Ignore"&gt;2)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; How to build custom security attributes&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-list: Ignore"&gt;3)&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt; How to get around the problem of security attributes having to be strong named, but the default install of enterprise library does not use strong naming. (Remember that a strongly named assembly&amp;nbsp;may only reference other strongly named assemblies).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be used as part of a defence in depth strategy, typically to secure business methods. One of the great advantages to using security attributes is the ability to use permview to dump which methods in which assemblies require which authorities. This allows a high degree of security visibility and checking.&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/244.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>String Resource Generator v1.2 now with support for Enterprise Library SR.strings files</title><link>http://wah.onterra.net/blog/archive/2005/02/01/223.aspx</link><pubDate>Tue, 01 Feb 2005 14:12:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/02/01/223.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=223"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; All future updates and comments will be at the project distributor website, as that contains an RSS feed and comment system... &lt;/P&gt;
&lt;P&gt; I originally wrote the resource generator to run off a .resx file, but I&amp;#8217;ve now updated the tools with two important changes. You can download the source and samples from &lt;A href="http://projectdistributor.readify.net/Projects/Project.aspx?projectId=2"&gt;here&lt;/A&gt; (with installer included):&lt;/P&gt;
&lt;P&gt;An example SR.strings file can be found &lt;A href="http://wah.onterra.net/files/SR.strings.txt"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Firstly, there is now a command line .exe, SRGenerator.exe, which can be used by doing the following command line:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Lucida Console'"&gt;SRGenerator.exe &lt;CODEPROVIDER&gt;&lt;NAMESPACE&gt;&lt;FILE&gt;&lt;CODEPROVIDER&gt;&lt;NAMESPACE&gt;&lt;FILE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: 'Lucida Console'"&gt;codeProvider  vb, cs, or CodeDom Provider assembly qualified class name.&lt;BR&gt;namespace     Namespace.&lt;BR&gt;file          File name, either a .strings file or a .resx file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Secondly, the tool can now parse the SR.strings file, which is the one of the string resource file format used within Microsoft. It will generate a SR.resx file, and the SR class to use the resource. This means that if you want to edit the enterprise library resources, just run this installer, and then you can edit the library to your hearts content.&lt;/P&gt;
&lt;P&gt;The changes to the tool are the following:&lt;/P&gt;
&lt;P&gt;It registers itself under both the SRCodeGen custom tool (my original name), and the StringResourceTool (used in the enterprise library source).&lt;/P&gt;
&lt;P class=MsoPlainText&gt;&lt;SPAN&gt;      If the file that the custom tool is set on is not a resource file then it converts the file (in the format of the SR.strings file) into a resource file, and adds the file to the project underneath the .strings file, by doing the following:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;1.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;Converts all options into resource file headers, e.g. #! culture_info = Resources.CultureInfo, becomes a header named &amp;#8220;culture_info&amp;#8221;, and with the value &amp;#8220;Resources.CultureInfo&amp;#8221;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;2.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;Converts all entries in the [strings] section into resources, with the name of the resource being the first part of the line, the value of the resource the part after the = sign, and the comment of the resource being anything in brackets after the name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText&gt;&lt;SPAN&gt;The resource file is then processed according to the rules of my original &lt;A href="http://wah.onterra.net/blog/archive/2004/12/09/190.aspx"&gt;post&lt;/A&gt;, with a couple of changes:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt; mso-list: l0 level2 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;        &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;The comments denote the parameter names and optionally types of any arguments in the value (given as String.Format arguments). If there are no argument names specified in the comment, then the resource accessor generated will &lt;I&gt;&lt;SPAN style="FONT-STYLE: italic"&gt;not&lt;/SPAN&gt;&lt;/I&gt; use String.Format to replace any parameters in the resource. This allows having resources with un-replaced positional specifiers in them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 72pt; TEXT-INDENT: -18pt; mso-list: l0 level2 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;        &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;The following options (specified as resource headers) are implemented:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 108pt; TEXT-INDENT: -108pt; mso-list: l0 level3 lfo2; mso-text-indent-alt: -9.0pt"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;                                                              &lt;/SPAN&gt; i.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;     &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;culture_info : If specified, then this will be copied verbatim into the generated file as part of the call to ResourceManager.GetString(name, &amp;#8230;). If not specified, then a public static Culture property is added to the SR class to allow changing the culture manually.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 108pt; TEXT-INDENT: -108pt; mso-list: l0 level3 lfo2; mso-text-indent-alt: -9.0pt"&gt;&lt;SPAN&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;                                                             &lt;/SPAN&gt; ii.&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;     &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;accessor_class_accessibility: If this value is &amp;#8220;public&amp;#8221;, then the SR class will be public, otherwise it will be internal.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText&gt;&lt;SPAN&gt;This uses CodeDOM, and so supports VB.NET as well as C#.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/223.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>Windows Integrated Security Providers for Enterprise Library</title><link>http://wah.onterra.net/blog/archive/2005/02/01/220.aspx</link><pubDate>Tue, 01 Feb 2005 02:00:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/02/01/220.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=220"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;Over the next few weeks, I&amp;#8217;ll be posting code samples, patches, tips and tricks for using enterprise library. I&amp;#8217;m currently in the middle of building a course which uses Enterprise Library as the implementation for a lot&amp;nbsp;of the patterns the course teaches, and so I hope to share some of the knowledge I&amp;#8217;m gleaning, some sample code, and hopefully some useful extensions to the library.&lt;/P&gt;
&lt;P&gt;The first cab off the rank is a couple of security providers. These are really more examples of how to extend the security application block, but they are useful in their own right. They also demonstrate how to hook into the new configuration console.&lt;/P&gt;
&lt;P&gt;Firstly the download location, and the place I&amp;#8217;ll be putting all the code samples until the community site for enterprise library appears:&lt;BR&gt;&lt;A href="http://projectdistributor.readify.net/Projects/Project.aspx?projectId=3"&gt;http://projectdistributor.readify.net/Projects/Project.aspx?projectId=3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You&amp;#8217;ll find the source there, along with some unit tests.&lt;/P&gt;
&lt;P&gt;The two providers wrap the functionality given by LogonUser, the WindowsIdentity class and the WindowsPrincipal class. The API for authentication and roles in enterprise library looks like this:&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;IAuthenticationProvider authProvider = AuthenticationFactory.GetAuthenticationProvider();&lt;BR&gt;&lt;BR&gt;NamePasswordCredential credentials =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;new &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;NamePasswordCredential(@"UNKNOWN\bogart","password");&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;IIdentity identity;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;if (authProvider.Authenticate(credentials,&lt;/SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;out &lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;identity))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IRolesProvider roleProvider = RolesFactory.GetRolesProvider();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPrincipal princ = roleProvider.GetRoles(ident);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do stuff with IPrincipal, e.g. Thread.CurrentPrincipal = princ&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Now, if we just wanted the current windows identity, we could have passed null instead of some credentials.&lt;/P&gt;
&lt;P&gt;If we were just trying to get the current user&amp;#8217;s identity, then you would think, let&amp;#8217;s just do:&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;WindowsIdentity ident = WindowsIdentity.GetCurrent();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;IPrincipal princ =&lt;/SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;new&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=black&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: 'Courier New'"&gt;WindowsPrincipal(ident);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt;// Do something with the principal.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;But the advantage is that the provider that is used is configuration driven, and with the shiny new configuration tool that comes with enterprise library, configuration is a breeze. See Scott&amp;#8217;s &lt;A href="http://weblogs.asp.net/scottdensmore/archive/2005/01/28/362579.aspx"&gt;post&lt;/A&gt; about the configuration tool.&lt;/P&gt;
&lt;P&gt;So the reason why the Windows security providers can be useful is that we can immediately start using the provider model in our application, and then swap out the integrated providers for some custom authentication / roles providers in the future.&lt;/P&gt;
&lt;P&gt;I&amp;#8217;d be interested what people think, and whether these sorts of samples are useful or not.&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/220.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>Enterprise library is out of the box</title><link>http://wah.onterra.net/blog/archive/2005/01/30/214.aspx</link><pubDate>Sun, 30 Jan 2005 01:42:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2005/01/30/214.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=214"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P class=MsoNormal&gt;Congratulations &lt;A href="http://blogs.msdn.com/tomholl/archive/2005/01/28/362818.aspx"&gt;Tom&lt;/A&gt;, and the entire group involved for putting together a coherent library of extremely useful pluggable blocks. I have it on good authority that they were up until 2am last night getting it out the door :P&lt;/P&gt;
&lt;P class=MsoNormal&gt;You can grab it from &lt;A href="http://msdn.microsoft.com/library/en-us/dnpag2/html/entlib.asp"&gt;here&lt;/A&gt;, but you&amp;#8217;ll have to register.&lt;/P&gt;
&lt;P class=MsoNormal&gt;For me, the biggest change from the mishmash of the application blocks is useability. While there was great technical functionality in the original blocks, details such as the ability to configure up the end application, consistent documentation and deployment/versioning considerations hadn&amp;#8217;t been reached yet.&lt;/P&gt;
&lt;P class=MsoNormal&gt;With the configuration console, and the &amp;#8220;configuration time&amp;#8221; experience (rather than the design time experience in the IDE), we now the ability to give system administrators, or deployment customizing development teams a user interface to select which providers they need, where to store configuration information, what level of encryption, etc. all without touching a single line of XML. See Scott Desnmore's &lt;A href="http://weblogs.asp.net/scottdensmore/archive/2005/01/28/362579.aspx"&gt;blog&lt;/A&gt; for a preview of the configuration console.&lt;/P&gt;
&lt;P class=MsoNormal&gt;Now I know there will be a few tears&amp;#8230; I&amp;#8217;ve had the joy of cutting and pasting XML configuration files over the past year. Watching configuration exceptions appear when I&amp;#8217;ve pasted that invisible tab character in from an internet explorer window, tracking down what QName I needed for WSE2, using reflector to see exactly what was happening inside EIF when it didn&amp;#8217;t like my configuration&amp;#8230;&lt;/P&gt;
&lt;P class=MsoNormal&gt;Enterprise library is missing some functionality compared to the set of application blocks it replaced. Most of the functionality missing was obviously a conscious design decision. Some looks like it is just due to time. But they have concentrated on quality and coherent functionality rather than getting the kitchen sink in.&lt;/P&gt;
&lt;P class=MsoNormal&gt;For those that like kitchen sinks (like myself), there will be a community site coming along, but I&amp;#8217;ve got a few things that I&amp;#8217;ve created that I&amp;#8217;ll be posting. Keep tuned.&lt;/P&gt;
&lt;P&gt;Again, thank you to everyone involved for the obvious effort that has been put in to providing, for free and with source and documentation, a set of very useful building blocks for .NET application development.&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/214.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Martin Granell</dc:creator><title>.NET User interface for Tracking down managed memory leaks</title><link>http://wah.onterra.net/blog/archive/2004/12/20/195.aspx</link><pubDate>Mon, 20 Dec 2004 10:05:00 GMT</pubDate><guid>http://wah.onterra.net/blog/archive/2004/12/20/195.aspx</guid><description>&lt;H2&gt;This post and comments can now be found on my new blog &lt;A HREF="http://granell.net/martin/Posts/Post.aspx?postId=195"&gt;here&lt;/A&gt;&lt;/H2&gt;&lt;DIV class=Section1&gt;
&lt;P&gt;From Mitch's &lt;A href="http://notgartner.com/posts/950.aspx"&gt;blog&lt;/A&gt;, I got to read Rico Mariani&amp;#8217;s &lt;A href="http://blogs.msdn.com/ricom/archive/2004/12/10/279612.aspx"&gt;post&lt;/A&gt; the other day, and&amp;nbsp;I noticed a couple of comments suggesting automating the process he described there. Being somewhat of a debugger hack, I thought it would be good to put together a user interface that drives the debugger process, parses the output, and provides an easy way to explore an application&amp;#8217;s heap. The result is below:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="/files/LeakDetectorCapture.PNG"&gt;&lt;/P&gt;
&lt;P&gt;One of the trickiest bits was allowing the application to continue, and then break, as the debugger requires Ctrl-C to be sent to the console window. I&amp;#8217;ve also multi-threaded the console tracing, as that was proving to be a bottleneck. The application demand loads information as the user clicks around, and caches it until the next breakpoint.&lt;/P&gt;
&lt;P&gt;I&amp;#8217;ve included an updated product support SOS DLL, psscor.dll, as it provides much better information when dumping objects. This can be found at:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://blogs.msdn.com/mvstanton/archive/2004/04/05/108023.aspx"&gt;http://blogs.msdn.com/mvstanton/archive/2004/04/05/108023.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can get the source and binaries from &lt;A href="http://wah.onterra.net/files/LeakDetector.zip"&gt;here&lt;/A&gt;. Usage instructions are included, as detailed below:&lt;/P&gt;
&lt;P&gt;Instructions for use:&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Install Debugging Tools for Windows (&lt;A href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;http://www.microsoft.com/whdc/devtools/debugging/default.mspx&lt;/A&gt;)&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Change the application configuration file to point to your installation.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Fire up the application.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Use File-&amp;gt;Connect to Process to select the process to attach to.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; This will suspend the process and dump out a list of all the types currently running, with size and instance count.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Click on a type, and it will list all the instances in the top right-hand corner.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Click on an instance, and it will search for all the GC roots that can get to the object, and list the count of them.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; In the "Roots" combo-box, it will list all the roots.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Selecting a root in the "Roots" combo box will show the trace of objects from the object to the instance selected.&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Click on an object in the trace, and its details will be dumped into the text box.&lt;/P&gt;
&lt;P&gt;You will also notice a console window. This shows a trace of all the debugger communication, and is required to allow the application so send Ctrl-C commands to the debugger (to allow continue &amp;amp; break to work). It's also nice to see what's going on behind the scenes.&lt;/P&gt;
&lt;P&gt;You can continue the application by going to Debug-&amp;gt;Continue, and break again by using Debug-&amp;gt;Break. You can also send the debugger explicit commands by typing in the "Send Debugger Command" text box, and hitting return. The output will appear in the textbox under the GC trace, as well as in the console window. I wouldn't recommend sending the "G" (go) command, as the application will probably freeze. Please use the Debug menu to &amp;#8220;continue&amp;#8221;, &amp;#8220;break&amp;#8221; &amp;amp; &amp;#8220;detach&amp;#8221; the application.&lt;/P&gt;
&lt;P&gt;Future enhancements I&amp;#8217;m thinking about:&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Parse the output of the object dump to allow jumping to other objects referenced from the object (and viewing GC trace etc.)&lt;/P&gt;
&lt;P style="MARGIN-LEFT: 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo2"&gt;&lt;SPAN style="FONT-FAMILY: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&amp;#183;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; Dump out the entire info-set as XML for post-processing (not sure about whether to dump out all the demand loaded GC traces though, maybe only dump out one set of type instances, or a tree?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://wah.onterra.net/blog/aggbug/195.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>