<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10frenchfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-1146316188254265608</id><updated>2012-04-08T20:01:52.590+02:00</updated><category term="Afterthought" /><category term="AOP" /><category term="Dojo" /><category term="Visual Studio" /><category term="Claymore" /><category term="SQL" /><category term="CSS" /><category term="Javascript" /><category term="SMDBehavior" /><category term="Virtual Earth" /><category term="MVP" /><category term="Google Charts" /><category term="CIL" /><category term="MSBuild" /><category term="Blogger" /><category term="IIS" /><category term="Mercurial" /><category term="EntityFramework.Patterns" /><category term="ASP.NET MVC" /><category term="ASP.NET" /><category term="Autre" /><category term="SignalR" /><category term="WCF" /><category term="Subsonic" /><category term="Micro Framework" /><category term="GreaseMonkey" /><category term="ORM" /><category term="SSAS" /><category term="SSRS" /><category term="Nuget" /><category term="Electronique" /><category term="SSIS" /><category term="AllyStats" /><category term="Mono.Cecil" /><category term="Obsidian" /><category term="Entity Framework" /><category term="OGame" /><title type="text">Memory Leaks</title><subtitle type="html">Blog sur les technos Microsoft.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://mymemoryleaks.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default?start-index=26&amp;max-results=25" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MemoryLeaks" /><feedburner:info uri="memoryleaks" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/content?lg=fr&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/bn/intatm_fr_1.gif">Subscribe with Mon Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MemoryLeaks" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.yourminis.com/subscribe.aspx?u=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.yourminis.com/images/addtoyourminisbadge.gif">Subscribe with Yourminis.com</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://hub.netomat.net/account/account.autoSubscribe.jspa?urls=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.netomat.net/blogger/images/icon_netomat_feedbutton.gif">Subscribe with netomat Hub</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FMemoryLeaks" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-4921929042336737796</id><published>2011-10-14T13:58:00.000+02:00</published><updated>2011-10-17T15:47:00.765+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title type="text">Implémenter une sécurité à base de rôles avec Windows Authentication &amp; SQL Server</title><content type="html">&lt;br /&gt;
Ces derniers jours j'ai été confronté à une problématique très intéressante; j'aimerais la partager avec vous aujourd'hui et vous soumettre la solution que j'ai imaginé pour y répondre.&lt;br /&gt;
&lt;br /&gt;
Mon client souhaitait restreindre l'accès à son site/application intranet aux seuls membres d'un groupe Windows prédéfini. &lt;br /&gt;
Le hic est que le site fonctionne avec des rôles définis en base de données, laissant ainsi libre champs aux admins de l'appli d'attribuer et révoquer des droits aux autres utilisateurs. Évidement, il était hors de question de devoir passer par l'IT pour changer les droits des utilisateurs à l'avenir.&lt;br /&gt;
&lt;br /&gt;
Si l'on transpose la demande en termes techniques, on a besoin du &lt;a href="http://msdn.microsoft.com/fr-fr/library/system.web.security.windowstokenroleprovider.aspx"&gt;WindowsTokenRoleProvider&lt;/a&gt; pour autoriser l'accès au site et pour tout le reste il faut se reposer sur un &lt;a href="http://msdn.microsoft.com/fr-fr/library/system.web.security.sqlroleprovider.aspx"&gt;SqlRoleProvider&lt;/a&gt;.&lt;br /&gt;
Comme vous le savez, ce genre de configuration n'est pas prise en charge par le modèle de provider tel que nous le connaissons jusqu'à présent.&lt;br /&gt;
&lt;br /&gt;
En cherchant sur la toile si ce genre de situation à déjà été traitée (ne réinventons pas la roue carrée), vous tomberez très certainement sur &lt;a href="http://weblogs.asp.net/scottgu/pages/Recipe_3A00_-Implementing-Role_2D00_Based-Security-with-ASP.NET-2.0-using-Windows-Authentication-and-SQL-Server.aspx"&gt;un article de Scott Guthrie&lt;/a&gt; qui traite d'un problème très similaire. Dans l'article &lt;a href="http://weblogs.asp.net/scottgu/"&gt;l'homme à la chemise rouge&lt;/a&gt; nous montre comment, sans code, utiliser les rôles issus de la base de données et n'autoriser l'accès au site &lt;u&gt;qu'aux utilisateurs identifiés&lt;/u&gt;. Et c'est bien sur ce dernier point que nos problématiques diffèrent car dans mon cas, il ne suffit pas d'être identifié sur le domaine, mais il faut aussi faire partie d'un groupe d'utilisateurs.&lt;br /&gt;
&lt;br /&gt;
J'ai donc remonté mes manches, et quitte à écrire du code j'ai tenté de trouver une solution générique permettant de combiner des RoleProvider.&lt;br /&gt;
&lt;br /&gt;
Commençons par définir un RoleProviderDecorator qui comme son nom l'indique suit le pattern &lt;a href="http://en.wikipedia.org/wiki/Decorator_pattern"&gt;Decorator&lt;/a&gt;.&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public class RoleProviderDecorator&amp;lt;TSurrogateRoleProvider&amp;gt; : RoleProvider
        where TSurrogateRoleProvider : RoleProvider, new()
    {

        protected TSurrogateRoleProvider _surrogate;

        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException(&amp;quot;config&amp;quot;);

            base.Initialize(name, config);

            _surrogate = new TSurrogateRoleProvider();

            InitializeInnerProvider(_surrogate, name, config);
        }

        protected virtual void InitializeInnerProvider(RoleProvider innerProvider, string name, NameValueCollection config)
        {
            innerProvider.Initialize(name, config);
        }
        
        public override bool IsUserInRole(string username, string roleName)
        {
            return _surrogate.IsUserInRole(username, roleName);
        }
        
        public override string[] GetRolesForUser(string username)
        {
            return _surrogate.GetRolesForUser(username).ToArray();
        }
        
        public override void CreateRole(string roleName)
        {
            _surrogate.CreateRole(roleName);
        }
        
        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
        {
            return _surrogate.DeleteRole(roleName, throwOnPopulatedRole);
        }
        
        public override bool RoleExists(string roleName)
        {
            return _surrogate.RoleExists(roleName);
        }
        
        public override void AddUsersToRoles(string[] usernames, string[] roleNames)
        {
            _surrogate.AddUsersToRoles(usernames, roleNames);
        }
        
        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
        {
            _surrogate.RemoveUsersFromRoles(usernames, roleNames);
        }
        
        public override string[] GetUsersInRole(string roleName)
        {
            return _surrogate.GetUsersInRole(roleName).ToArray();
        }
        
        public override string[] GetAllRoles()
        {
            return _surrogate.GetAllRoles().ToArray();
        }
        
        public override string[] FindUsersInRole(string roleName, string usernameToMatch)
        {
            return
                _surrogate.FindUsersInRole(roleName, usernameToMatch).ToArray();
        }
        
        public override string ApplicationName
        {
            get { return _surrogate.ApplicationName; }
            set { _surrogate.ApplicationName = value; }
        }
    }
&lt;/pre&gt;&lt;br /&gt;
L'idée du décorateur, vous l'aurez compris, est de déléguer l’exécution des méthodes au vrai RoleProvider passé sous forme de &lt;a href="http://msdn.microsoft.com/en-us/library/ms379564%28v=vs.80%29.aspx"&gt;Generic&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Maintenant définissons un RoleProvider qui se charge d'utiliser de manière sous-jacente deux RoleProvider :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public abstract class UnionRoleProvider&amp;lt;TPrimaryRoleProvider, TSecondaryRoleProvider&amp;gt; : RoleProviderDecorator&amp;lt;TPrimaryRoleProvider&amp;gt;
        where TPrimaryRoleProvider : RoleProvider, new()
        where TSecondaryRoleProvider : RoleProvider, new()
    {
        private TSecondaryRoleProvider _secondSurrogate;

        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException(&amp;quot;config&amp;quot;);

            base.Initialize(name, config);

            _secondSurrogate = new TSecondaryRoleProvider();
            InitializeInnerProvider(_secondSurrogate, name, config);
        }

        public override bool IsUserInRole(string username, string roleName)
        {
            return _surrogate.IsUserInRole(username, roleName) || _secondSurrogate.IsUserInRole(username, roleName);
        }

        public override string[] GetRolesForUser(string username)
        {
            return _surrogate.GetRolesForUser(username).Union(_secondSurrogate.GetRolesForUser(username)).ToArray();
        }

        public override void CreateRole(string roleName)
        {
            _surrogate.CreateRole(roleName);
            _secondSurrogate.CreateRole(roleName);
        }

        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
        {
            return _surrogate.DeleteRole(roleName, throwOnPopulatedRole) &amp;amp;&amp;amp; _surrogate.DeleteRole(roleName, throwOnPopulatedRole);
        }

        public override bool RoleExists(string roleName)
        {
            return _surrogate.RoleExists(roleName) || _secondSurrogate.RoleExists(roleName);
        }

        public override void AddUsersToRoles(string[] usernames, string[] roleNames)
        {
            _surrogate.AddUsersToRoles(usernames, roleNames);
            _secondSurrogate.AddUsersToRoles(usernames, roleNames);
        }

        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
        {
            _surrogate.RemoveUsersFromRoles(usernames, roleNames);
            _secondSurrogate.RemoveUsersFromRoles(usernames, roleNames);
        }

        public override string[] GetUsersInRole(string roleName)
        {
            return _surrogate.GetUsersInRole(roleName).Union(_secondSurrogate.GetUsersInRole(roleName)).ToArray();
        }

        public override string[] GetAllRoles()
        {
            return _surrogate.GetAllRoles().Union(_secondSurrogate.GetAllRoles()).ToArray();
        }

        public override string[] FindUsersInRole(string roleName, string usernameToMatch)
        {
            return
                _surrogate.FindUsersInRole(roleName, usernameToMatch)
                    .Union(_secondSurrogate.FindUsersInRole(roleName, usernameToMatch))
                    .ToArray();
        }
    }
&lt;/pre&gt;&lt;br /&gt;
Dans mon cas, seul un des deux RoleProvider doit pouvoir écrire dans son médium de stockage. &lt;br /&gt;
L'autre doit être en lecture seule. Pour ce faire, j'introduis un ReadOnlyRoleProvider : &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public class ReadOnlyRoleProvider&amp;lt;TSurrogateRoleProvider&amp;gt; : RoleProviderDecorator&amp;lt;TSurrogateRoleProvider&amp;gt;
        where TSurrogateRoleProvider : RoleProvider, new()
    {

        public override void CreateRole(string roleName){}

        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
        {
            return true;
        }

        public override void AddUsersToRoles(string[] usernames, string[] roleNames){}

        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames){}
&lt;/pre&gt;&lt;br /&gt;
Ça y est on a fait 90% du boulot.&lt;br /&gt;
&lt;br /&gt;
Dans le fichier web.config on veut écrire ceci : &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;roleManager enabled=&amp;quot;true&amp;quot; defaultProvider=&amp;quot;MyRoleProvider&amp;quot;&amp;gt;
      &amp;lt;providers&amp;gt;
        &amp;lt;clear/&amp;gt;
        &amp;lt;add name=&amp;quot;MyRoleProvider &amp;quot; type=&amp;quot;Providers.MyRoleProvider &amp;quot; connectionStringName=&amp;quot;cnx&amp;quot; applicationName=&amp;quot;MyApp&amp;quot; /&amp;gt;
      &amp;lt;/providers&amp;gt;
    &amp;lt;/roleManager&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Étant donné que l'on ne peut pas utiliser de classe générique dans la config, on va simplement en spécialiser une :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public class MyRoleProvider : UnionRoleProvider&amp;lt;SqlRoleProvider, SilentWindowsTokenRoleProvider&amp;lt;WindowsTokenRoleProvider&amp;gt;&amp;gt;
    {

        protected override void InitializeInnerProvider(RoleProvider innerProvider, string name, NameValueCollection config)
        {
            NameValueCollection cfg = config;
            if (innerProvider is ReadOnlyRoleProvider&amp;lt;WindowsTokenRoleProvider&amp;gt;)
            {
                cfg = new NameValueCollection(config);
                cfg.Remove(&amp;quot;connectionStringName&amp;quot;);
            }
            
            base.InitializeInnerProvider(innerProvider, name, cfg);
        }
    }
&lt;/pre&gt;&lt;br /&gt;
Ouf, 99% du boulot. Vous pouvez maintenant exécuter et ça va fonctionner... jusqu'à ce que vous utilisiez une des méthodes suivantes : &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;GetUsersInRole&lt;/li&gt;
&lt;li&gt;GetAllRoles&lt;/li&gt;
&lt;li&gt;FindUsersInRole&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Tout simplement parce que le  &lt;a href="http://msdn.microsoft.com/fr-fr/library/system.web.security.windowstokenroleprovider.aspx"&gt;WindowsTokenRoleProvider&lt;/a&gt; ne supporte pas ces opérations.&lt;br /&gt;
Ok, voici le tout dernier % à réaliser : &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public class SilentWindowsTokenRoleProvider&amp;lt;TSurrogateRoleProvider&amp;gt; : ReadOnlyRoleProvider&amp;lt;TSurrogateRoleProvider&amp;gt;
        where TSurrogateRoleProvider : RoleProvider, new()
    {

        public override string[] GetUsersInRole(string roleName)
        {
            return new string[]{};
        }

        public override string[] GetAllRoles()
        {
            return new string[]{};
        }

        public override string[] FindUsersInRole(string roleName, string usernameToMatch)
        {
            return new string[]{};
        }
    }
&lt;/pre&gt;&lt;br /&gt;
Voila 100% de la solution; beaucoup de code aujourd'hui, j'espère que ça ne vous a pas trop démotivé.&lt;br /&gt;
&lt;br /&gt;
Si vous avez une solution autre, ou contestez mon approche n'hésitez pas à laisser un commentaire.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-4921929042336737796?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=XChjOD7qSck:xxpVwI4wt_0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=XChjOD7qSck:xxpVwI4wt_0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=XChjOD7qSck:xxpVwI4wt_0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/XChjOD7qSck" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/4921929042336737796/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=4921929042336737796" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/4921929042336737796" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/4921929042336737796" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/XChjOD7qSck/implementer-une-securite-base-de-roles.html" title="Implémenter une sécurité à base de rôles avec Windows Authentication &amp; SQL Server" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/10/implementer-une-securite-base-de-roles.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-5058619291898102502</id><published>2011-10-07T16:55:00.001+02:00</published><updated>2011-10-17T15:57:45.962+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Afterthought" /><category scheme="http://www.blogger.com/atom/ns#" term="EntityFramework.Patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework" /><category scheme="http://www.blogger.com/atom/ns#" term="AOP" /><title type="text">Entity Framework et AOP</title><content type="html">&lt;p&gt;Cela fait des mois que je repousse la publication d'un post sur l'&lt;a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming"&gt;AOP&lt;/a&gt;, car je ne voulais pas vous resservir le sempiternel exemple de mise en place d'une gestion de log applicatif simplifiée. &lt;br /&gt;
Si vous voulez vous rafraichir les idées sur le sujet je vous conseille de jeter un œil sur l'article d'&lt;a href="http://ayende.com/blog/3474/logging-the-aop-way"&gt;Ayende Rahien sur le sujet&lt;/a&gt;&lt;br /&gt;
&lt;/p&gt;Avec le framework .NET, il existe au moins 6 façons différentes d'ajouter un brin d'AOP dans vos programmes; &lt;br /&gt;
Pour mémoire il s'agit de : &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Remoting Proxies&lt;/li&gt;
&lt;li&gt;Dériver votre classe de ContextBoundObject&lt;/li&gt;
&lt;li&gt;Passer par un dynamique proxy ( ex : Castle Dynamic Proxy)&lt;/li&gt;
&lt;li&gt;Utiliser l'API de profiling de .NET&lt;/li&gt;
&lt;li&gt;Injection d'IL après compilation&lt;/li&gt;
&lt;li&gt;Injection d'IL au runtime&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Dans cet article on s'intéressera particulièrement a l'injection post compilation, tout simplement car c'est la plus performante (le code lié à l'aspect est directement inscrit dans l'assembly finale et rien ne le distingue du reste du code) et aussi car c'est la façon la plus sexy a mon gout de faire de l'AOP (c'est une raison comme une autre, non?).&lt;br /&gt;
&lt;br /&gt;
Bon revenons à nos moutons.&lt;br /&gt;
&lt;br /&gt;
Sur presque tous les projets sur lesquels je suis intervenu ces dernières années, lorsqu'on modélise les entités qui devront être persistées en base, on leur adjoint au moins quatre propriétés :&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Created By (string)&lt;/li&gt;
&lt;li&gt;Created (datetime)&lt;/li&gt;
&lt;li&gt;Last Updated By (string)&lt;/li&gt;
&lt;li&gt;Last Updated (datetime)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
J'ai pour habitude de nommer cette construction, une entité "Auditable", ce qui se traduit en code par l'interface suivante : &lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public interface IAuditable
    {
        string CreatedBy { get; set; }
        DateTime Created { get; set; }
        string UpdatedBy { get; set; }
        DateTime? Updated { get; set; }
    }
&lt;/pre&gt;&lt;br /&gt;
Vous l'aurez compris, l'idée ici, est de stocker la date et l'utilisateur ayant créé ou modifié l'entité en question et ceci a chaque accès base. &lt;br /&gt;
Je vous laisse imaginer le travail rébarbatif que cela peut vite devenir si l'on doit tout gérer à la main et si notre modèle est composé de dizaines voire de centaines d'entités.&lt;br /&gt;
&lt;br /&gt;
Je vous propose donc une idée afin de se faciliter la vie grâce à l'AOP. &lt;br /&gt;
Il est à noter que bien que l'exemple ci-dessous s’appuie sur Entity Framework, le mécanisme est très certainement transposable (avec adaptation) aux autres ORM.&lt;br /&gt;
&lt;br /&gt;
On commence par utiliser Entity Framework Code First, et on ajoute notre framework AOP préféré&lt;br /&gt;
&lt;pre class="brush:powershell"&gt;Install-Package EntityFramework
Install-Package Afterthought
&lt;/pre&gt;&lt;br /&gt;
&lt;blockquote&gt;En attendant qu'un de mes patch soit accepté et intégré à &lt;a href="https://github.com/vc3/Afterthought"&gt;Afterthought&lt;/a&gt;, il vous faudra remplacer la dll d'Afterthought par la mienne disponible &lt;a href="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/44/afterthought.zip"&gt;ici&lt;/a&gt;.&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
Nuget a rajouté quelques dll et références dans votre projet et modifié également le post build event de votre projet; &lt;br /&gt;
Désormais à chaque compilation, Afterthought scannera les assemblies à la recherche de taches d'injection d'IL à effectuer.&lt;br /&gt;
&lt;br /&gt;
Voyons comment demander à Afterthought d'injecter l'interface IAuditable sur nos entités.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public class AuditableAmender&amp;lt;T&amp;gt; : Amendment&amp;lt;T, T&amp;gt;
    {

        public AuditableAmender()
        {
            Properties.Add&amp;lt;string&amp;gt;(&amp;quot;CreatedBy&amp;quot;);
            Properties.Add&amp;lt;DateTime&amp;gt;(&amp;quot;Created&amp;quot;);
            Properties.Add&amp;lt;string&amp;gt;(&amp;quot;UpdatedBy&amp;quot;);
            Properties.Add&amp;lt;DateTime?&amp;gt;(&amp;quot;Updated&amp;quot;);

            Implement&amp;lt;IAuditable&amp;gt;();
        }
    }
&lt;/pre&gt;&lt;br /&gt;
Le code me semble assez clair sans avoir a revenir longuement dessus; On demande simplement à Afterthought d'injecter les propriétés nécessaires à l'implémentation de l'interface IAuditable.&lt;br /&gt;
&lt;br /&gt;
Bien créons un attribut de marquage, que nous placerons sur nos entités :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;[AttributeUsage(AttributeTargets.Class)]
    public class AuditableAttribute : Attribute { }
&lt;/pre&gt;&lt;br /&gt;
il nous reste encore deux tâches à réaliser; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Préciser les assemblies à introspecter&lt;/li&gt;
&lt;li&gt;Permettre à Afterthought de découvrir les classes qui doivent être modifiées et surtout comment.&lt;/li&gt;
&lt;/ul&gt;Cela se fait dans une même classe : &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;[AttributeUsage(AttributeTargets.Assembly)]
    public class AmendAttribute : Attribute, IAmendmentAttribute
    {
        IEnumerable&amp;lt;ITypeAmendment&amp;gt; IAmendmentAttribute.GetAmendments(Type target)
        {
            if (target.GetCustomAttributes(typeof(AuditableAttribute), true).Length &amp;gt; 0)
            {
                ConstructorInfo constructorInfo = typeof(AuditableAmender&amp;lt;&amp;gt;).MakeGenericType(target).GetConstructor(Type.EmptyTypes);
                if (constructorInfo != null)
                    yield return (ITypeAmendment)constructorInfo.Invoke(new object[0]);
            }
        }
    }
&lt;/pre&gt;En clair, pour chaque classe qui implémente IAuditable, on va faire appel à la classe AuditableAmender (créée précédemment) pour modifier la classe.&lt;br /&gt;
En appliquant cet attribut sur l'assembly qui contient vos entités, Afterthought effectuera son travail d'injection.&lt;br /&gt;
&lt;br /&gt;
Désormais si l'on applique l'attribut Auditable sur une de nos entités comme suit :&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;[Auditable]
    public class Product
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }

    public class Context : DbContext
    {
        public virtual DbSet&amp;lt;Product&amp;gt; Products { get; set; }

        public Context()
        {
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges&amp;lt;Context&amp;gt;());
        }
    }
&lt;/pre&gt;&lt;br /&gt;
Ce qui produit bien en base la table suivante : &lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/44/EF_Table.png" alt="table"/&gt;&lt;br /&gt;
&lt;br /&gt;
et dans l'assembly finale (vu avec Reflector)&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/44/Asm.png" alt="assembly"/&gt;&lt;br /&gt;
&lt;br /&gt;
Évidemment, en généralisant ce principe il est possible de facilement faire évoluer votre modèle sans avoir à travailler parfois de manière répétitive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Vous retrouverez cette fonctionnalité (il vous suffit de marquer votre entité avec l'attribut) dans la librairie &lt;a href="http://efpatterns.codeplex.com/"&gt;EntityFramework.Patterns&lt;/a&gt; que je maintiens et disponible via &lt;a href="http://nuget.org/List/Packages/EntityFramework.Patterns"&gt;nuget&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Que pensez-vous de cette technique?&lt;br /&gt;
Utilisez-vous un autre framework (&lt;a href="http://www.sharpcrafters.com/"&gt;Postsharp&lt;/a&gt;) pour réaliser ce genre de tâche?&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-5058619291898102502?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=Gwxgl7FDQts:Vb0WnE2mtog:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=Gwxgl7FDQts:Vb0WnE2mtog:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Gwxgl7FDQts:Vb0WnE2mtog:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/Gwxgl7FDQts" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/5058619291898102502/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=5058619291898102502" title="4 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5058619291898102502" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5058619291898102502" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/Gwxgl7FDQts/entity-framework-et-aop.html" title="Entity Framework et AOP" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/10/entity-framework-et-aop.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-7833601605957993703</id><published>2011-09-26T23:21:00.000+02:00</published><updated>2011-09-26T23:21:31.607+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="SignalR" /><title type="text">Live charting avec SignalR</title><content type="html">&lt;p&gt;&lt;a href="https://github.com/SignalR"&gt;SignalR&lt;/a&gt; is awesome ! Oui il va falloir vous habituer à entendre dire que cette librairie est un petit bijou.&lt;/p&gt;&lt;br /&gt;
&lt;img alt="tweet signalr" src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/43/SignalR_awesome.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;&lt;b&gt;Mais qu'est-ce qu'elle a de si bien cette librairie SignalR ?&lt;/b&gt;&lt;/p&gt;SignalR fournit une couche d'abstraction au-dessus des &lt;a href="http://en.wikipedia.org/wiki/WebSocket"&gt;WebSocket&lt;/a&gt; et des &lt;a href="http://en.wikipedia.org/wiki/Long_polling#Long_polling"&gt;long polling connections&lt;/a&gt; pour les développeurs .NET et fonctionne sous IIS sans avoir à installer un autre service à côté.&lt;br /&gt;
&lt;br /&gt;
Jusqu'alors il existait bien des solutions commerciales de ces technos dans l'écosystème .NET mais aucune n'avait vraiment convaincu, souvent par manque d'intégration forte entre le client et le serveur; rendant la communication entre les deux fastidieuse.&lt;br /&gt;
Avec SignalR c'est tout le contraire, le code serveur et le code client ne semble faire qu'un. Les lignes de code glissent du serveur vers le navigateur, sans aucune lourdeur. C'est &lt;b&gt;SIMPLE&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Comme d'hab, rien de mieux qu'un petit bout de code pour démontrer ça.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bon, si vous avez lu le titre vous avez une petite idée de ce que l'on va coder...&lt;br /&gt;
&lt;br /&gt;
Coté composants techniques, évidement SignalR pour la communication client/serveur et &lt;a href="http://www.highcharts.com/"&gt;Highchart&lt;/a&gt; coté client pour dessiner le chart.&lt;br /&gt;
&lt;br /&gt;
Après avoir créé un nouveau projet WebForm ou MVC ajoutez le package SignalR via &lt;a href="http://nuget.org/"&gt;nuget&lt;/a&gt;.&lt;br /&gt;
Intéressons-nous au code javascript. (&lt;i&gt;A noter que le code lié à la configuration du chart à été omis a des fins de clarté.&lt;/i&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:js"&gt;$(function () {
     var stockExchangeServer = $.connection.stockExchange;

    stockExchangeServer.drawShareValue = function (id, content) {

        if (id != this.Id) {
            return;
        }

        // set up the updating of the chart.
        var series = chart.series[0];
        var x = new Date(parseInt(content[0].Date.substr(6))).getTime(),
                y = content[0].Price;

        series.addPoint([x, y], true, true);
    };

    $.connection.hub.start(function () {
        stockExchangeServer.connect();
            .done(function (success) {
                if (success === false) {
                    console.log(":(");
                }
                console.log("connected");
            });
    });
});
&lt;/pre&gt;&lt;br /&gt;
Pour initier la communication avec le serveur, il suffit comme vous pouvez le voir d'utiliser la méthode &lt;code&gt;$.connection.hub.start()&lt;/code&gt;; &lt;br /&gt;
On se contente alors de faire appel à la méthode &lt;code&gt;connect&lt;/code&gt;; nous implémenterons cette dernière côté serveur.... oui vous avez bien lu, côté serveur.&lt;br /&gt;
&lt;br /&gt;
Remarquez également la définition de la méthode &lt;code&gt;drawShareValue()&lt;/code&gt; qui se charge de dessiner un nouveau point dans le chart, nous ferons appel à elle dans le code serveur.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Côté serveur, nous allons définir un hub, la classe de base qui abstrait la communication client/serveur dans l'api SignalR.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:csharp"&gt;public class StockExchange : Hub
    {
        private Timer _timer;

        private double _fowlerPrice = 10.2;

        private double VaryPrice()
        {
            Random rnd = new Random();
            _fowlerPrice = _fowlerPrice + (rnd.Next(-1, 2) * rnd.NextDouble());
            return _fowlerPrice;
        }

        public bool Connect()
        {
            // Set unique id for client.
            Caller.Id = Context.ClientId;

            _timer = new Timer { Interval = 1000 };

            _timer.Elapsed += (sender, e) =&amp;gt; Send(
                new List&amp;lt;SharePrice&amp;gt;(new[]
                                         {
                                             new SharePrice
                                                 {
                                                     Date = DateTime.Now,
                                                     Price = VaryPrice(),
                                                     Share = new Share {Name = "Fowler-Corp"}
                                                 }
                                         }));
            _timer.Start();

            return true;
        }

        public void Send(IEnumerable&amp;lt;SharePrice&amp;gt; sp)
        {
            Clients.drawShareValue(Context.ClientId, sp);
        }
    }
&lt;/pre&gt;&lt;br /&gt;
Avez-vous remarqué la méthode Connect()? On y a fait appel à partir du code JS.&lt;br /&gt;
Et l'appel à drawShareValue(), fait bien référence à la méthode que l'on à définit dans le javascript. Enorme, non?&lt;br /&gt;
&lt;br /&gt;
Tout cela est possible parce que SignalR utilise dans ses fondements le typage &lt;a href="http://en.wikipedia.org/wiki/C_Sharp_4.0#Dynamic_member_lookup"&gt;dynamic&lt;/a&gt; à laquelle vient s'ajouter une résolution de Propriété/Méthode "simple" par convention, évitant ainsi d'avoir à écrire du code verbeux.&lt;br /&gt;
&lt;br /&gt;
Au final, voici ce que l'on peut obtenir...&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/43/chart_crop.png" alt="chart"/&gt;&lt;br /&gt;
&lt;br /&gt;
Bon ok, l'image ne bouge pas, il faut imaginer qu'un point vient s'ajouter chaque seconde dans le graph :)&lt;br /&gt;
&lt;br /&gt;
Pour ceux qui voudrait jeter un coup d’œil à la solution entière, vous pouvez la récupérer sur &lt;a href="https://github.com/fmichellonet/SignalR.Samples.MVCLiveChart"&gt;Github&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Avez-vous utilisé d'autres technos/framework pour faciliter les communications "temps réel" entre le serveur et le browser?&lt;br/&gt;&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-7833601605957993703?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=SRLHWXzOgU0:P7z_a63uzbM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=SRLHWXzOgU0:P7z_a63uzbM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=SRLHWXzOgU0:P7z_a63uzbM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/SRLHWXzOgU0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/7833601605957993703/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=7833601605957993703" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7833601605957993703" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7833601605957993703" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/SRLHWXzOgU0/live-charting-avec-signalr.html" title="Live charting avec SignalR" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/09/live-charting-avec-signalr.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-3820879386763448703</id><published>2011-07-13T17:07:00.002+02:00</published><updated>2011-07-13T17:12:03.051+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EntityFramework.Patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="ORM" /><title type="text">EntityFramework.Patterns : Repository &amp; Unit Of Work</title><content type="html">&lt;p&gt;
Je vous propose un très rapide post pour faciliter la prise en main des Patterns Repository&lt;T&gt; et Unit Of Work disponibles dans &lt;a href=""&gt;EntityFramework.Patterns&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;Pour simplifier le sujet, le but du pattern Repository est de donner au développeur une passerelle de requêtage unifiée, via des opérations (le plus souvent) atomiques.
Unit Of Work, est la quant à lui pour valider transactionnellement un ensemble de modifications faites sur les données.&lt;/p&gt;
&lt;p&gt;Pour la version longue vous pourrez trouver votre bonheur sur le site de &lt;a href="http://martinfowler.com/"&gt;Martin Fowler&lt;/a&gt; &lt;a href="http://martinfowler.com/eaaCatalog/repository.html"&gt;ici pour le Repository&lt;/a&gt; et &lt;a href="http://martinfowler.com/eaaCatalog/unitOfWork.html"&gt;ici pour Unit Of Work&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;Partons d'un modèle simplissime comme celui ci-dessous :
&lt;pre class="brush:csharp"&gt;

public class Context : DbContext
{
    public virtual DbSet&amp;lt;Product&amp;gt; Products { get; set; }
    public virtual DbSet&amp;lt;ProductCategory&amp;gt; Categories { get; set; }

    public Context()
    {
        Database.SetInitializer(new DropCreateDatabaseAlways&amp;lt;Context&amp;gt;());
    }
}

public class Product
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int? ProductCategoryId { get; set; }
    public virtual ProductCategory ProductCategory { get; set; }
}

public class ProductCategory
{
    public int Id { get; set; }
    public string Name { get; set; }
}
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Commençons par créer le Repository
&lt;pre class="brush:csharp"&gt;
using(Context ctx = new Context())
{
    DbContextAdapter adapter = new DbContextAdapter(ctx);
    IRepository&amp;lt;Product&amp;gt; productRepo = new Repository&amp;lt;Product&amp;gt;(adp);
    ...
}
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Interrogeons la base pour ramener l'ensemble des produits :
&lt;pre class="brush:csharp"&gt;
IEnumerable&amp;lt;Product&amp;gt; lst = productRepo.GetAll();
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Ramenons le premier élément dont le nom commence par "Bike"&lt;/p&gt;
&lt;pre class="brush:csharp"&gt;
Product prod = productRepo.First(p =&amp;gt; p.Name.StartsWith(&amp;quot;Bike&amp;quot;));
&lt;/pre&gt;
&lt;p&gt;L'utilisation de la méthode Single a pour effet de ramener un seul élément de la base de données; mais lève une exception si plusieurs éléments répondent aux critères demandés.
&lt;pre class="brush:csharp"&gt;
 productRepo.Single(p =&amp;gt; p.Name.StartsWith(&amp;quot;Roc&amp;quot;))
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Find(), permet de filtrer en fonction de plusieurs critères :
&lt;pre class="brush:csharp"&gt;
IEnumerable&amp;lt;Product&amp;gt; lst = productRepo.Find(
                p =&amp;gt; p.Id &amp;lt; 100 &amp;amp;&amp;amp; p.Name.Contains(&amp;quot;o&amp;quot;) &amp;amp;&amp;amp; p.Name.Length &amp;lt; 20);
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Toutes ces méthodes acceptent optionnellement un ensemble de liens de navigation inter entités 
&lt;pre class="brush:csharp"&gt;params Expression&amp;lt;Func&amp;lt;T, object&amp;gt;&amp;gt;[] includeProperties&lt;/pre&gt;
définissant les jointures à effectuer lors du requêtage.
Ainsi :
&lt;pre class="brush:csharp"&gt;
productRepo.First(p =&amp;gt; p.ProductCategoryId != null , p =&amp;gt; p.ProductCategory);
&lt;/pre&gt;
charge le produit et sa catégorie associée en une seule requete SQL; Cette façon de faire nous protège du fameux problème du &lt;a href="http://stackoverflow.com/questions/97197/what-is-the-n1-selects-problem"&gt;Select N+1&lt;/a&gt; lié au &lt;a href="http://en.wikipedia.org/wiki/Lazy_loading"&gt;lazy loading&lt;/a&gt; utilisé par défaut avec Entity Framework.
&lt;/p&gt;
&lt;p&gt;Après l’interrogation de la base passons a la persistance de nos données. Pour cela nous allons faire appel au pattern UnitOfWork.
L'insertion d'un nouvel élément prend cette forme :
&lt;pre class="brush:csharp"&gt;
using(...)
{
   ...
   IUnitOfWork unitOfWork = new UnitOfWork(adp);
   Product p = new Product{Name = "Skateboard"};
   productRepo.Insert(p);
   unitOfWork.Commit();
}
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Vous l'aurez compris la mise à jour et la suppression sont aussi simple que ca : 
&lt;pre class="brush:csharp"&gt;
Product p = productRepo.First(c =&amp;gt; c.Name == &amp;quot;Bike&amp;quot;);
p.Name = "New bike";
productRepo.Update(p);

Product delete = productRepo.First(p =&amp;gt; p.Name.StartsWith(&amp;quot;To be&amp;quot;)); 
productRepo.Delete(delete);

unitOfWork.Commit();
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;Dans les prochains jours je vous montrerais comment injecter Repository et Unit of work dans une couche Service par exemple avec un conteneur DI comme &lt;a href="http://ninject.org/"&gt;NInject&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-3820879386763448703?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=RVyKMF2a1rM:os99bzXKgmY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=RVyKMF2a1rM:os99bzXKgmY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RVyKMF2a1rM:os99bzXKgmY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/RVyKMF2a1rM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/3820879386763448703/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=3820879386763448703" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/3820879386763448703" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/3820879386763448703" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/RVyKMF2a1rM/entityframeworkpatterns-repository-unit_13.html" title="EntityFramework.Patterns : Repository &amp; Unit Of Work" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/07/entityframeworkpatterns-repository-unit_13.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-7405101182765635229</id><published>2011-07-07T18:32:00.001+02:00</published><updated>2011-07-07T18:39:26.839+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EntityFramework.Patterns" /><title type="text">Release d'EntityFramework.Patterns</title><content type="html">&lt;p&gt;Bon ça y est je me suis décidé à trouver un toit pour &lt;a href="http://efpatterns.codeplex.com/"&gt;EntityFramework.Patterns&lt;/a&gt;, une librairie qui s'adossant à &lt;a href="http://msdn.microsoft.com/en-us/data/aa937723"&gt;Entity Framework 4.1&lt;/a&gt;, propose l'implémentation de patterns couramment nécessaire lorsqu'on utilise un &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping"&gt;ORM&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Je n'ai toujours pas cédé aux appels des sirènes de &lt;a href="https://github.com/"&gt;Github&lt;/a&gt;; EntityFramework.Patterns est donc hébergé sur &lt;a href="http://www.codeplex.com/"&gt;Codeplex&lt;/a&gt;.
Vous trouverez également la librairie sur &lt;a href="http://nuget.org/List/Search?packageType=Packages&amp;searchCategory=All+Categories&amp;searchTerm=EntityFramework.Patterns&amp;sortOrder=package-download-count&amp;pageSize=10"&gt;nuget&lt;/a&gt;... d'ailleurs elle y était présente bien avant la création du repository sur codeplex.
&lt;/p&gt;
&lt;p&gt;
Pour l'installer via nuget, rien de plus simple :
&lt;pre class="brush: ps"&gt;
install-package EntityFramework.Patterns
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
A l'heure actuelle, vous trouverez deux patterns d'infrastructure :
&lt;ul&gt;
&lt;li&gt;Repository&lt;/li&gt;
&lt;li&gt;Unit Of work&lt;/li&gt;
&lt;/ul&gt;

&lt;a href="http://wekeroad.com/post/7102729511/a-simple-example-thats-incredibly-complex"&gt;Rob Conery&lt;/a&gt; les définissaient ainsi récemment : 

&lt;blockquote&gt;
The Repository Pattern is all about encapsulating calls to your DB as methods to do a thing. These calls are (typically) atomic.
&lt;/blockquote&gt;
&lt;br/&gt;
Tout est dit! L'avantage est simple, couplé avec &lt;a href="http://blog.ploeh.dk/2010/09/20/InstrumentationWithDecoratorsAndInterceptors.aspx"&gt;un/des décorateurs&lt;/a&gt; il sera facile d'ajouter des comportements transverses (cache, securité, log etc...)

&lt;blockquote&gt;
UnitOfWork is - well it’s a way of transactionally flushing changes to a persistence store (aka Database)
&lt;/blockquote&gt;
&lt;br/&gt;
Ce qui permet de découpler facilement la gestion d'état des entités et le requêtage.
&lt;/p&gt;

&lt;p&gt;Des patterns d'infrastructure pour l'instant, qui seront rapidement suivit par les patterns suivants :
&lt;ul&gt;
&lt;li&gt;Repository Decorator&lt;/li&gt;
&lt;li&gt;Audit log&lt;/li&gt;
&lt;li&gt;Audit trail&lt;/li&gt;
&lt;li&gt;Archived entity&lt;/li&gt;
&lt;li&gt;Internationalized entity&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;
Dans un tout prochain post je présenterais ces deux patterns Repostitory&amp;lt;T&amp;gt; et UnitOfWork.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-7405101182765635229?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=ufbE-H8uiiU:aoetKy95Ld8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=ufbE-H8uiiU:aoetKy95Ld8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=ufbE-H8uiiU:aoetKy95Ld8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/ufbE-H8uiiU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/7405101182765635229/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=7405101182765635229" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7405101182765635229" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7405101182765635229" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/ufbE-H8uiiU/release-dentityframeworkpatterns.html" title="Release d'EntityFramework.Patterns" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/07/release-dentityframeworkpatterns.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-535820351817854973</id><published>2011-07-07T16:51:00.000+02:00</published><updated>2011-07-07T16:51:38.029+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Electronique" /><category scheme="http://www.blogger.com/atom/ns#" term="Micro Framework" /><title type="text">FEZ Domino</title><content type="html">&lt;p&gt;Un rapide post pour vous faire partager ma joie de ce jour.&lt;/p&gt;
&lt;p&gt;J'ai enfin reçu la commande que j'avais passé sur &lt;a href="http://www.robotshop.com/eu/"&gt;Roboshop&lt;/a&gt; il y a bientôt un mois (ils déconnent un peu chez Roboshop sur les délai...)
Bref, entre autre dans le colis :
&lt;ol&gt;
&lt;li&gt;Micro-contrôleur &lt;a href="http://www.ghielectronics.com/catalog/product/133"&gt;Fez Domino&lt;/a&gt;
   &lt;ul&gt;
     &lt;li&gt;Processeur 72Mhz 32-bit ARM7 LPC2388&lt;/li&gt;
     &lt;li&gt;~148KB free Flash&lt;/li&gt;
     &lt;li&gt;~62KB free RAM&lt;/li&gt;
   &lt;/ul&gt;
   &lt;br/&gt;
   &lt;img alt="fez domino" src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/42/FEZ_Domino.JPG"/&gt;
&lt;/li&gt;
   &lt;br/&gt;
&lt;li&gt;Un servo controlleur &lt;a href="http://www.lynxmotion.com/p-395-ssc-32-servo-controller.aspx"&gt;SSC-32&lt;/a&gt;
   &lt;ul&gt;
     &lt;li&gt;Peut gérer jusqu'à 32 servo moteurs.&lt;/li&gt;
   &lt;/ul&gt;
&lt;br/&gt;
   &lt;img alt="SSC-32" src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/42/SSC32.JPG"/&gt;
&lt;/li&gt;
&lt;br/&gt;
&lt;/ol&gt;
C'est vraiment petit ces trucs la, pour vous donner une idée, les voici à côté d'une pile 9V.
&lt;br/&gt;&lt;br/&gt;
&lt;img alt="Domino &amp; SSC-32" src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/42/Domino&amp;SSC32.JPG"/&gt;
&lt;/p&gt;
&lt;p&gt;Mon premier défit va être de tenter le portage d'un &lt;a href="http://en.wikipedia.org/wiki/Dependency_injection"&gt;conteneur DI&lt;/a&gt; sur cette plateforme. Je sens que ça va être chaud!&lt;/p&gt;
&lt;p&gt;Ensuite, je crois que je vais tenter la construction d'un &lt;a href="http://fr.wikipedia.org/wiki/Robot_hexapode"&gt;Hexapode&lt;/a&gt;... d’où l'achat du SSC-32.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-535820351817854973?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=nBjykBhQDV8:8OfV37pLScQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=nBjykBhQDV8:8OfV37pLScQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=nBjykBhQDV8:8OfV37pLScQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/nBjykBhQDV8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/535820351817854973/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=535820351817854973" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/535820351817854973" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/535820351817854973" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/nBjykBhQDV8/fez-domino.html" title="FEZ Domino" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/07/fez-domino.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-7742361934671179583</id><published>2011-06-21T23:32:00.003+02:00</published><updated>2011-07-11T15:46:40.827+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="Nuget" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title type="text">Custom ASP.NET MVC Project Template</title><content type="html">&lt;p&gt;Récemment, Phil Haack nous présentait dans un très bon post &lt;a href="http://haacked.com/archive/2011/06/06/creating-a-custom-asp-net-mvc-project-template.aspx"&gt;comment ajouter un template MVC3 personnalisé&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Dans ce post il lève le voile sur l'intégration de &lt;a href="http://nuget.org/"&gt;nuget&lt;/a&gt; dans Visual Studio. On y apprend que malheureusement par manque de temps l'intégration n'est que minimaliste et que seul les packages présent sur la machine (%ProgramFiles%\Microsoft ASP.NET\ASP.NET MVC 3\Packages) ne peuvent être installés.&lt;/p&gt;
&lt;p&gt;Après avoir fait un peu joujou avec, voici quelques points complémentaires : 
&lt;ul&gt;
&lt;li&gt;Pour télécharger un package nuget (extension nupkg), vous pouvez utiliser &lt;a href="http://nuget.codeplex.com/releases/view/59864"&gt;nuget package explorer&lt;/a&gt;&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Il n'y a pas de résolution de dépendance entre package. Vous devez donc les ordonner dans la section WizardData :
&lt;pre class="brush: csharp"&gt;
&amp;lt;WizardData&amp;gt;
    &amp;lt;packages&amp;gt;
        &amp;lt;package id=&amp;quot;jQuery&amp;quot; version=&amp;quot;1.5.1&amp;quot; /&amp;gt;
        &amp;lt;package id=&amp;quot;jQuery.Validation&amp;quot; version=&amp;quot;1.8.0&amp;quot; /&amp;gt;
        &amp;lt;package id=&amp;quot;jQuery.UI.Combined&amp;quot; version=&amp;quot;1.8.11&amp;quot; /&amp;gt;
    &amp;lt;/packages&amp;gt;
&amp;lt;/WizardData&amp;gt;
&lt;/pre&gt;
&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Les template de quickstart (plusieurs projets) fonctionnent dans cette configuration et peuvent tirer parti de l'installation de packages via nuget.&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Il m'est arrivé a plusieurs reprise de noter que la commande 
&lt;pre class="brush: ps"&gt;
devenv /installvstemplates
&lt;/pre&gt; ne suffisait a rafraichir le cache de template de Visual Studio. Un reboot de la machine remet tout dans l'ordre.&lt;/li&gt;&lt;br/&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;Happy Nuget!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-7742361934671179583?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=yqeFPv2o4Ec:rGLA-gET-EY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=yqeFPv2o4Ec:rGLA-gET-EY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=yqeFPv2o4Ec:rGLA-gET-EY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/yqeFPv2o4Ec" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/7742361934671179583/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=7742361934671179583" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7742361934671179583" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7742361934671179583" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/yqeFPv2o4Ec/custom-aspnet-mvc-project-template.html" title="Custom ASP.NET MVC Project Template" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/06/custom-aspnet-mvc-project-template.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-4414461101769599008</id><published>2011-05-17T21:00:00.005+02:00</published><updated>2011-06-21T23:35:11.192+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Nuget" /><category scheme="http://www.blogger.com/atom/ns#" term="Obsidian" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title type="text">Quickstart &amp; Nuget</title><content type="html">&lt;p&gt;Dans mon &lt;a href="http://mymemoryleaks.blogspot.com/2011/05/project-template-quickstart-et-vsix.html"&gt;précédent post&lt;/a&gt; j’effleurais le sujet des gains de productivité que pouvais procurer les templates et autres Quickstart dans vos développement de tous les jours.&lt;/p&gt;
&lt;p&gt;Prenons le cas d’un Quickstart, qui je le rappelle n’est autre qu’une solution templatisée. Imaginons que l’on souhaite utiliser 3 ou 4 librairies externes .NET bien sentie et pourquoi pas une ou deux librairies javascript s’il s’agit d’une solution Web.&lt;/p&gt;
&lt;p&gt;En m’appuyant sur &lt;a href="http://nuget.codeplex.com/"&gt;Nuget&lt;/a&gt; lors de la création des templates de projet composant le Quickstart, les dépendances pourrons être facilement être mise à jour par les développeurs à posteriori toujours grâce à Nuget. Rien de magique dans tout ça, en fait chaque projet est doté de son propre fichier 'packages.config' (repository nuget pour le projet) relatant la version des librairies référencées.&lt;/p&gt;
&lt;p&gt;Voici ce que j’aimerais mettre en place en plus : 
&lt;ul&gt;
&lt;li&gt;Mise à jour automatique de nuget avant toute autre opération.&lt;/li&gt;
&lt;li&gt;Téléchargement et installation automatisée des dépendances référencées pour chaque projet.&lt;/li&gt;
&lt;li&gt;Mise à jour automatique des dépendances lors de la première installation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Infos complémentaires :&lt;/p&gt;
&lt;p&gt;Microsoft depuis le &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=82cbd599-d29a-43e3-b78b-0f863d22811a&amp;displaylang=en"&gt;MVC3 Tool Update&lt;/a&gt; du 12 Avril 2011 propose un nouveau template de projet MVC3 basé lui aussi sur nuget. La technique utilisée est quelque peu différente de celle que je vous présente ici, mais ne permet pas la mise à jour automatique des dépendances à l’installation.&lt;/p&gt;
&lt;p&gt;Je reviendrais surement très rapidement sur cette façon de faire dans un prochain billet.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Pour réaliser ces différents points il nous faudra coder un &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard%28v=VS.100%29.aspx"&gt;Wizard&lt;/a&gt; custom.&lt;/p&gt;
&lt;p&gt;La première tâche consistant à déployer nuget.exe est simplissime. Il nous suffit de l’embarquer dans les ressources de notre Wizard, puis au runtime extraire l’exécutable et le copier par exemple dans le dossier « packages » au sein de la solution. Pour info, le dossier « package » est utilisé par nuget pour y stocker les dépendances qu’il a téléchargé.&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
DirectoryInfo packageDirInfo = _solutionDirInfo.CreateSubdirectory("packages");
string _nugetFilePath = Path.Combine(packageDirInfo.FullName, "Nuget.exe");
File.WriteAllBytes(_nugetFilePath, Resources.NuGet);
&lt;/pre&gt;
&lt;p&gt;
Notez que le dossier package doit absolument se trouvé dans le même répertoire que votre fichier sln, si vous voulez pouvoir profiter de la mise à jour des packages. Il s’agit d’une restriction imposé par nuget lui-même
&lt;/p&gt;
&lt;p&gt;
Nuget déployé, il est possible de le mettre à jour automatiquement en exécutant la ligne de commande suivante :
&lt;/p&gt;
&lt;pre class="brush: ps"&gt;nuget update&lt;/pre&gt;
&lt;p&gt;Dans notre Wizard on pourra utiliser le code suivant : &lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
Process nugetProc = new Process
            {
                StartInfo = new ProcessStartInfo(_nugetFilePath)
                {
                    Arguments = "update",
                    RedirectStandardError = true,
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    CreateNoWindow = true
                },
            };
            nugetProc.Start();
            StreamReader output = nugetProc.StandardOutput;
            StreamReader error = nugetProc.StandardError;
            nugetProc.WaitForExit();
&lt;/pre&gt;
&lt;p&gt;
Concernant l’installation des dépendances de chaque projet se fera simplement en utilisant une fois de plus une ligne de commande ; que l’on créera en C# de la manière suivante : 
&lt;/p&gt;
&lt;pre class="brush: csharp"&gt;
Process nugetProc = new Process
            {
                StartInfo = new ProcessStartInfo(_nugetFilePath)
                {
                    Arguments = string.Format("install {0}", _packageFilePath),
                    RedirectStandardError = true,
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    CreateNoWindow = true,
                    WorkingDirectory = new FileInfo(_nugetFilePath).DirectoryName
                 },
            };
            nugetProc.Start();
&lt;/pre&gt;
&lt;p&gt;
L’idée ici est en fait d’exécuter 1 fois pour chacun de vos projets la commande suivante : &lt;/p&gt;
&lt;pre class="brush: ps"&gt;nuget install %path/to%/packages.config&lt;/pre&gt;
&lt;p&gt;
Reste encore la tache de mettre à jour toutes les dépendances. Malheureusement, pour l’instant nuget.exe ne propose pas encore de commande permettant la mise à jour des dépendances. Cependant un récent &lt;a href="#"&gt;post&lt;/a&gt;, &lt;a href="http://haacked.com/"&gt;Phil Haack&lt;/a&gt; annonce la disponibilité de cette option pour la version de 1.4 de nuget.
&lt;/p&gt;
&lt;p&gt;En attendant cette fonctionnalité, nous pouvons nous en sortir en installant par default le package &lt;a href="http://nuget.org/List/Packages/NuGetPackageUpdater"&gt;NuGetPackageUpdater&lt;/a&gt;. Ce dernier vous offre la possibilité d’exécuter la commande 'Update-Package' qui se chargera d’effectuer la mise à jour de toutes les dépendances de la solution.&lt;/p&gt;
&lt;p&gt;J’espère qu’en suivant ces instructions vous pourrez construire des Templates qui se mettrons à jour tout seul.&lt;/p&gt;
&lt;p&gt;Pour ceux qui souhaiteraient jeter un coup d’œil plus approfondi au code que je viens de présenter, il est disponible sur &lt;a href="http://www.codeplex.com/"&gt;Codeplex&lt;/a&gt; avec l’ensemble des briques du Quikstart &lt;a href="http://obsidian.codeplex.com/"&gt;Obsidian&lt;/a&gt; sur lequel je travaille actuellement.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-4414461101769599008?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=r-x1Xv0880g:XJ2NsqFld74:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=r-x1Xv0880g:XJ2NsqFld74:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=r-x1Xv0880g:XJ2NsqFld74:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/r-x1Xv0880g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/4414461101769599008/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=4414461101769599008" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/4414461101769599008" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/4414461101769599008" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/r-x1Xv0880g/quickstart-nuget.html" title="Quickstart &amp; Nuget" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/05/quickstart-nuget.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-7767491471490552912</id><published>2011-05-13T23:29:00.000+02:00</published><updated>2011-05-13T23:29:16.839+02:00</updated><title type="text">Project Template, Quickstart et VSIX</title><content type="html">&lt;p&gt;Dernièrement j’ai fait mumuse avec les template de fichiers et projets que l’on peut créer dans Visual Studio.&lt;/p&gt;
&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/41/coccinelle.png" alt="coccinelle"/&gt;
&lt;p&gt;Pour ceux qui ne connaissent pas, les template de fichier vous permettent de définir l’ossature d’un type de fichier que vous utilisez souvent.  Une fois créé vous retrouverez votre template dans le menu de Visual Studio « Add new Item ».&lt;/p&gt;

&lt;p&gt;Par extension les projects template vous permettent de définir la structure d’un type projet, afin de prendre en compte les conventions de votre équipe par exemple. Vous y définissez l’ensemble des fichiers présent dès la création du projet.&lt;/p&gt;

&lt;p&gt;Ce qui est très intéressant, c'est que cela permet d'avoir des projets prêts à l'emploi dans votre environnement, avec par exemple &lt;a href="http://nlog-project.org/"&gt;NLog&lt;/a&gt;&amp;nbsp;&lt;a href="http://www.blogger.com/post-create.g?blogID=1146316188254265608"&gt;et votre conteneur &lt;/a&gt;&lt;a href="http://martinfowler.com/articles/injection.html"&gt;DI&lt;/a&gt; &lt;a href="http://www.castleproject.org/"&gt;préféré&lt;/a&gt;. Si vous êtes expérimenté cela vous évitera quelques copier-coller,  si par contre vous ne connaissez pas bien une des briques technique cela vous évitera un tas de problématique.&lt;/p&gt;

&lt;p&gt;Quoi qu'il en soit voici quelques astuces sur ces templates :&lt;p/&gt;

&lt;ol&gt;&lt;br/&gt;
&lt;li&gt;Bien que le &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=21307c23-f0ff-4ef2-a0a4-dca54ddb1e21"&gt;SDK&lt;/a&gt; de Visual Studio vous propose des projets de type Item Template et Project Template, le plus simple reste d’utiliser le menu File -&amp;gt; Export Template de Viual Studio pour générer votre précieux template.&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Pour créer un quickstart, qui n’est autre qu’un template de solution (plusieurs projets), je vous conseille de : &lt;/li&gt;
&lt;ol&gt;&lt;br/&gt;
&lt;li&gt;Exporter vos différents projets template et extraire les archives zip correspondante dans un même dossier.&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Ajouter dans ce dossier de travail un fichier .vstemplate reprenant cette structure&lt;/li&gt;&lt;br/&gt;
&lt;pre class="brush: xml"&gt;
&amp;lt;VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="ProjectGroup"&amp;gt;
  &amp;lt;TemplateData&amp;gt;
    &amp;lt;Name&amp;gt;Ma solution&amp;lt;/Name&amp;gt;
    &amp;lt;Description&amp;gt;Ma description&amp;lt;/Description&amp;gt;
    &amp;lt;ProjectType&amp;gt;CSharp&amp;lt;/ProjectType&amp;gt;
    &amp;lt;ProjectSubType&amp;gt;&amp;lt;/ProjectSubType&amp;gt;
    &amp;lt;SortOrder&amp;gt;1000&amp;lt;/SortOrder&amp;gt;
    &amp;lt;CreateNewFolder&amp;gt;false&amp;lt;/CreateNewFolder&amp;gt;
    &amp;lt;LocationField&amp;gt;Enabled&amp;lt;/LocationField&amp;gt;
    &amp;lt;EnableLocationBrowseButton&amp;gt;true&amp;lt;/EnableLocationBrowseButton&amp;gt;
    &amp;lt;Icon&amp;gt;monicone_100x100.ico&amp;lt;/Icon&amp;gt;
  &amp;lt;/TemplateData&amp;gt;
  &amp;lt;TemplateContent&amp;gt;
    &amp;lt;ProjectCollection&amp;gt;
      &amp;lt;ProjectTemplateLink ProjectName="Web"&amp;gt;
        Web\MyTemplate.vstemplate
      &amp;lt;/ProjectTemplateLink&amp;gt;
      &amp;lt;ProjectTemplateLink ProjectName="Domain"&amp;gt;
        Domain\MyTemplate.vstemplate
      &amp;lt;/ProjectTemplateLink&amp;gt;
      &amp;lt;ProjectTemplateLink ProjectName="DAL"&amp;gt;
        DAL\MyTemplate.vstemplate
      &amp;lt;/ProjectTemplateLink&amp;gt;
      &amp;lt;ProjectTemplateLink ProjectName="IServices"&amp;gt;
        IServices\MyTemplate.vstemplate
      &amp;lt;/ProjectTemplateLink&amp;gt;
      &amp;lt;ProjectTemplateLink ProjectName="Services"&amp;gt;
        Services\MyTemplate.vstemplate
      &amp;lt;/ProjectTemplateLink&amp;gt;
    &amp;lt;/ProjectCollection&amp;gt;
  &amp;lt;/TemplateContent&amp;gt;
&amp;lt;/VSTemplate&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Vous pouvez y mettre autant de référence a des projects que vous le souhaitez en ajoutant des balises ProjectTemplateLink.&lt;/p&gt;
&lt;li&gt;Créez une archive zip du dossier de travail et placez la dans le dossier %VSInstallDir%\Common7\IDE\ProjectTemplates\. Après redémarrage de Visual Studio le nouveau template sera dispo.&lt;/li&gt;&lt;br/&gt;
&lt;/ol&gt;
&lt;li&gt;Dans le fichier vstemplate de votre Quickstart, la première occurrence à un projet sera par convention le startup project.&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Pour étendre avec du code custom vos project template il vous faudra :&lt;/li&gt;&lt;br/&gt;
&lt;ol&gt;
&lt;li&gt;Créer une assembly et implémenter l’interface &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard%28v=VS.100%29.aspx"&gt;Microsoft.VisualStudio.TemplateWizard.IWizard&lt;/a&gt;&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Ajouter la balise WizardExtension dans le fichier .vstemplate de votre project template&lt;/li&gt;&lt;br/&gt;
&lt;pre class="brush: xml"&gt;
&amp;lt;VSTemplate Version=&amp;quot;3.0.0&amp;quot; xmlns=&amp;quot;http://schemas.microsoft.com/developer/vstemplate/2005&amp;quot; Type=&amp;quot;Project&amp;quot;&amp;gt;
  …
  &amp;lt;WizardExtension&amp;gt;
    &amp;lt;Assembly&amp;gt;MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=952e5fc020f3b126&amp;lt;/Assembly&amp;gt;
    &amp;lt;FullClassName&amp;gt;MyAssembly.Wizard&amp;lt;/FullClassName&amp;gt;
  &amp;lt;/WizardExtension&amp;gt;
&amp;lt;/VSTemplate&amp;gt;
&lt;/pre&gt;
&lt;/ol&gt;
&lt;li&gt;Il est possible de faire appel à une assembly custom dans un template de type quickstart, mais attention, la plupart des appels que vous ferez sur les objects EnvDTE et plus particulièrement &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.project.aspx"&gt;EnvDTE.Project&lt;/a&gt; fréquemment utilisés dans la méthode &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.templatewizard.iwizard.projectitemfinishedgenerating.aspx"&gt;IWizard. ProjectFinishedGenerating&lt;/a&gt; vous renverront des valeurs nulles.&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;La façon la plus simple de créer un VSIX de déploiement est d’utiliser le projet de type VSIX Project  (Visual C# -&gt; Extensibility -&gt; VSIX Project). Le &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=21307c23-f0ff-4ef2-a0a4-dca54ddb1e21"&gt;SDK&lt;/a&gt; doit être installé.&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Dans le designer de VSIX, le champ ID comporte un GUID… n’y touchez surtout pas !&lt;/li&gt;&lt;br/&gt;
&lt;li&gt;Il est possible de définir dans quelle catégorie de template se trouvera l’élément que vous déployez via votre VSIX en renseignant le champ Add to subfolder.&lt;/li&gt;&lt;br/&gt;
&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/41/subfolder.png" alt="subfolder"/&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-7767491471490552912?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=uNLEFcaj3Hg:-d_yPA4T0bI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=uNLEFcaj3Hg:-d_yPA4T0bI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=uNLEFcaj3Hg:-d_yPA4T0bI:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/uNLEFcaj3Hg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/7767491471490552912/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=7767491471490552912" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7767491471490552912" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7767491471490552912" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/uNLEFcaj3Hg/project-template-quickstart-et-vsix.html" title="Project Template, Quickstart et VSIX" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/05/project-template-quickstart-et-vsix.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-6643593530380600053</id><published>2011-03-31T23:04:00.003+02:00</published><updated>2011-06-21T23:36:32.252+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="Nuget" /><title type="text">Quickstart Telerik Extensions for ASP.NET MVC via Nuget</title><content type="html">&lt;p&gt;Sans nul doute &lt;a href="http://scribefire-next/"&gt;Nuget&lt;/a&gt; a grandement am&amp;eacute;lior&amp;eacute; le process de d&amp;eacute;ploiement/configuration/utilisation de biblioth&amp;egrave;ques tierces dans l'&amp;eacute;cosyst&amp;egrave;me .NET.&lt;/p&gt;&lt;p&gt;Malheureusement, certain package ne sont pas parfait, et nécessite que l'on trifouille encore un peu dans la config pour que tout soit fonctionnel.&lt;br /&gt;J'en ai personnellement fait l'exp&amp;eacute;rience lorsque j'ai tent&amp;eacute; d'utiliser les &lt;a href="http://www.telerik.com/products/aspnet-mvc.aspx"&gt;MVC Extensions de Telerik&lt;/a&gt; via Nuget, une excellente librairie de composants graphiques soit dit en passant.&lt;/p&gt;&lt;p&gt;Vous l'aurez compris, l'id&amp;eacute;e de ce post est de pr&amp;eacute;senter les manipulations &amp;agrave; faire pour pouvoir finaliser l'installation de la librairie de Telerik.&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/40/nuget.png" alt="nuget"/&gt;&amp;nbsp;&amp;nbsp;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/40/Telerik-MVC.jpg" alt="telerik mvc extensions"/&gt;&lt;/p&gt;&lt;p&gt;On commence par demander l'installation du package :&lt;/p&gt;&lt;pre class="brush: ps"&gt;
Install-Package TelerikMvcExtensions
&lt;/pre&gt;&lt;p&gt;Pas d'inquiétude, si cela prend un peu de temps, c'est normal; il y a un paquet de fichier a rapatrier puis &amp;agrave; ajouter dans la solution.&lt;/p&gt;&lt;p&gt;Une fois que c'est fait, si vous ouvrez une vue, vous vous rendrez compte que malheureusement, l'intellisense ne vous propose rien de nouveau. Pire, s'il vous prenait l'envie de copier coller un exemple de code issue du site de Telerik, vous auriez un joli plantage.&lt;/p&gt;&lt;p&gt;Pour corriger tout ça, on va trifouiller dans le web.config. Ci-dessous les &amp;eacute;l&amp;egrave;ments &amp;agrave; ajouter :&lt;/p&gt;&lt;pre class="brush:xml"&gt;

&amp;lt;configuration&amp;gt;
  &amp;lt;configSections&amp;gt;
    &amp;lt;sectionGroup name=&amp;quot;telerik&amp;quot;&amp;gt;
      &amp;lt;section name=&amp;quot;webAssets&amp;quot; type=&amp;quot;Telerik.Web.Mvc.Configuration.WebAssetConfigurationSection, Telerik.Web.Mvc&amp;quot; requirePermission=&amp;quot;false&amp;quot; /&amp;gt;
    &amp;lt;/sectionGroup&amp;gt;

    &amp;lt;sectionGroup name=&amp;quot;system.web.webPages.razor&amp;quot; type=&amp;quot;System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;
      &amp;lt;section name=&amp;quot;host&amp;quot; type=&amp;quot;System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; /&amp;gt;
      &amp;lt;section name=&amp;quot;pages&amp;quot; type=&amp;quot;System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; requirePermission=&amp;quot;false&amp;quot; /&amp;gt;
    &amp;lt;/sectionGroup&amp;gt;
  &amp;lt;/configSections&amp;gt;

  &amp;lt;system.web&amp;gt;
    &amp;lt;pages&amp;gt;
      &amp;lt;namespaces&amp;gt;
        &amp;lt;add namespace=&amp;quot;Telerik.Web.Mvc.UI&amp;quot; /&amp;gt;
      &amp;lt;/namespaces&amp;gt;
    &amp;lt;/pages&amp;gt;

    &amp;lt;httpHandlers&amp;gt;
      &amp;lt;add verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;asset.axd&amp;quot; validate=&amp;quot;false&amp;quot; type=&amp;quot;Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc&amp;quot; /&amp;gt;
    &amp;lt;/httpHandlers&amp;gt;
  &amp;lt;/system.web&amp;gt;

  &amp;lt;system.webServer&amp;gt;

    &amp;lt;handlers&amp;gt;
      &amp;lt;remove name=&amp;quot;asset&amp;quot; /&amp;gt;
      &amp;lt;add name=&amp;quot;asset&amp;quot; preCondition=&amp;quot;integratedMode&amp;quot; verb=&amp;quot;GET,HEAD&amp;quot; path=&amp;quot;asset.axd&amp;quot; type=&amp;quot;Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc&amp;quot; /&amp;gt;
    &amp;lt;/handlers&amp;gt;

  &amp;lt;/system.webServer&amp;gt;

  &amp;lt;telerik&amp;gt;
    &amp;lt;webAssets useTelerikContentDeliveryNetwork=&amp;quot;false&amp;quot; /&amp;gt;
  &amp;lt;/telerik&amp;gt;

  &amp;lt;system.web.webPages.razor&amp;gt;
    &amp;lt;host factoryType=&amp;quot;System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;
    &amp;lt;pages pageBaseType=&amp;quot;System.Web.Mvc.WebViewPage&amp;quot;&amp;gt;
      &amp;lt;namespaces&amp;gt;
        &amp;lt;add namespace=&amp;quot;System.Web.Mvc&amp;quot; /&amp;gt;
        &amp;lt;add namespace=&amp;quot;System.Web.Mvc.Ajax&amp;quot; /&amp;gt;
        &amp;lt;add namespace=&amp;quot;System.Web.Mvc.Html&amp;quot; /&amp;gt;
        &amp;lt;add namespace=&amp;quot;System.Web.Routing&amp;quot; /&amp;gt;
        &amp;lt;add namespace=&amp;quot;Telerik.Web.Mvc.UI&amp;quot; /&amp;gt;
      &amp;lt;/namespaces&amp;gt;
    &amp;lt;/pages&amp;gt;
  &amp;lt;/system.web.webPages.razor&amp;gt;

&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;&lt;p&gt;Ouf! ca y est on a rajout&amp;eacute; tout ce qu'il nous manquait.&lt;/p&gt;&lt;p&gt;En ouvrant de nouveau une vue, l'intellisense devrait se mettre a vous proposer de nouvelles choses dans le namespace Telerik. Parfois, l'intellisense reste muet et je n'ai pas trouv&amp;eacute; d'autres alternatives que de redemarrer mon Visual Studio 2010.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Edit -- 18/04&lt;/b&gt;&lt;br/&gt;
Evidemment, il nous faut également modifier la master page afin d'y ajouter les styles et les scripts de Telerik.
&lt;pre class="brush:html"&gt;
&amp;lt;head&amp;gt;
    ...
    @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group =&amp;gt; group.Add(&amp;quot;telerik.common.css&amp;quot;).Add(&amp;quot;telerik.windows7.css&amp;quot;).Add(&amp;quot;telerik.rtl.css&amp;quot;).Combined(true).Compress(true)))
&amp;lt;/head&amp;gt;

&amp;lt;/body&amp;gt;
@(Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group =&amp;gt; group.Combined(true).Compress(true)))
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Ok, ok m'sieur Michellonet c'est bien beau tout ça, mais pourquoi j'irais utiliser la librairie de Telerik... en deux mots!&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Tout simplement parce que la grille est géniale, elle a toutes les fonctionnalités que l'on peut attendre d'une grille Web 3.0 :p&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-6643593530380600053?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=0haiOdszAro:7-MaGofRrxA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=0haiOdszAro:7-MaGofRrxA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=0haiOdszAro:7-MaGofRrxA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/0haiOdszAro" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/6643593530380600053/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=6643593530380600053" title="1 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/6643593530380600053" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/6643593530380600053" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/0haiOdszAro/quickstart-telerik-extensions-for.html" title="Quickstart Telerik Extensions for ASP.NET MVC via Nuget" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/03/quickstart-telerik-extensions-for.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-7247112430802839676</id><published>2011-03-22T19:38:00.002+01:00</published><updated>2011-03-23T00:47:07.367+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mercurial" /><title type="text">Mercurial : Régler les problèmes de certificats SSL.</title><content type="html">&lt;p&gt;Ce n'est pas dans mon habitude de poster des conseils sur des outils et leur configuration, mais cette fois je vais faire une petite entorse au r&amp;egrave;glement; tout simplement car j'ai pas mal gal&amp;eacute;r&amp;eacute; pour r&amp;eacute;soudre ce soucis, et si ce post permet d'aider une seule personne alors cela en aura valu le coup.&lt;/p&gt;&lt;p&gt;Bref, depuis la version 1.7 le niveau de s&amp;eacute;curit&amp;eacute; de Mercurial &amp;agrave; &amp;eacute;t&amp;eacute; revu &amp;agrave; la hausse, et donc &amp;eacute;videment des petits tracas pour nous utilisateurs de &lt;a href="http://tortoisehg.bitbucket.org/"&gt;Tortoise HG&lt;/a&gt; &amp;amp; &lt;a href="http://visualhg.codeplex.com/"&gt;Visual HG&lt;/a&gt; sous Windows. En r&amp;eacute;sum&amp;eacute;, les connexions HTTPS utilisant des certificats auto sign&amp;eacute;s (Self-signed certificates) ne sont plus accept&amp;eacute;s par le controleur de code source.&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/39/Tortoise.jpg" alt="" /&gt;&lt;/p&gt;&lt;p&gt;La &lt;a href="http://mercurial.selenic.com/wiki/CACertificates"&gt;documentation&lt;/a&gt; stipule qu'il est possible de rajouter dans le fichier cacert.pem de Tortoise le certificat que vous souhaitez autoriser; Le probl&amp;egrave;me est qu'il va vous falloir utiliser &lt;a href="http://www.openssl.org/"&gt;openssl&lt;/a&gt;, non pr&amp;eacute;sent en standard sur un Windows. Je vous avouerais que je n'ai m&amp;ecirc;me pas tent&amp;eacute; de le t&amp;eacute;l&amp;eacute;charger et de l'utiliser; Alors peut-&amp;ecirc;tre est-ce facilement faisable sous Windows... personnellement j'avais peur de me lancer dans une gal&amp;egrave;re de plus.&lt;/p&gt;&lt;p&gt;Par contre, laissez-moi vous montrer une fa&amp;ccedil;on de faire beaucoup plus simple, pour nous Windowsien de base et tout aussi s&amp;eacute;curis&amp;eacute;e.&lt;/p&gt;&lt;p&gt;L'id&amp;eacute;e est d'ajouter l'empreinte num&amp;eacute;rique du serveur h&amp;eacute;bergeant le repository dans la configuration de Tortoise; la doc &amp;eacute;tant un peu l&amp;eacute;g&amp;egrave;re sur ce point, voici les &amp;eacute;tapes pour y arriver.&lt;/p&gt;&lt;p&gt;Bon, tout d'abord ouvrez votre &lt;a href="http://www.mozilla-europe.org/fr/"&gt;navigateur pr&amp;eacute;f&amp;eacute;r&amp;eacute;&lt;/a&gt; et rendez-vous sur la home page de votre repository. En cliquant sur le petit cadenas en bas de votre fen&amp;ecirc;tre vous devriez avoir une fen&amp;ecirc;tre comme celle-ci qui s'ouvre :&lt;/p&gt;&lt;p&gt;&lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/39/Certificat.png' dojotype='dojox.image.Lightbox' group='1' title='Certificat'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/39/Certificat_thumb.png' alt='Certificat'/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Le bouton "afficher certifat" ouvre une nouvelle fen&amp;ecirc;tre dans laquelle vous copierez l'empreinte num&amp;eacute;rique SHA1. Cette empreinte identifie de mani&amp;egrave;re unique le serveur hebergeant votre repository Mercurial.&lt;/p&gt;&lt;p&gt;Ensuite, ouvrez Tortoise hg Workbench, puis dans la fen&amp;ecirc;tre de configuration, &amp;eacute;ditez le fichier de configuration mercurial.ini.&lt;/p&gt;&lt;p&gt;&lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/39/mercurial_ini.png' dojotype='dojox.image.Lightbox' group='2' title='Config'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/39/mercurial_ini_thumb.png' alt='Config'/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Il ne reste plus qu'&amp;agrave; ajouter une section hostfingerprints reprenant l'adresse de votre server ainsi que son empreinte.&lt;/p&gt;&lt;p&gt;&lt;span lang="EN-US"&gt;[hostfingerprints]&lt;br /&gt;mercurial.devolis.com = ..:..:..:..:02:76:B5:29:65:47:A1:43:8E:0F:F5:13:03:AC:9D:0A&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Voil&amp;agrave; enregistrez le fichier et tout devrait d&amp;eacute;sormais fonctionner comme avant.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-7247112430802839676?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=LsLHprVwLrU:TdyWYqbOnBY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=LsLHprVwLrU:TdyWYqbOnBY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LsLHprVwLrU:TdyWYqbOnBY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/LsLHprVwLrU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/7247112430802839676/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=7247112430802839676" title="1 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7247112430802839676" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7247112430802839676" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/LsLHprVwLrU/mercurial-regler-les-problemes-de.html" title="Mercurial : Régler les problèmes de certificats SSL." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/03/mercurial-regler-les-problemes-de.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-5361820150316189616</id><published>2011-02-28T23:47:00.001+01:00</published><updated>2011-02-28T23:48:12.133+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC" /><title type="text">Razor plugin pour SyntaxHighlighter</title><content type="html">&lt;p&gt;Comme beaucoup d'entre vous j'utilise l'excellent &lt;a href="http://alexgorbatchev.com/SyntaxHighlighter/"&gt;SyntaxHighlighter&lt;/a&gt; d'Alex Gorbatchev, pour mettre en forme les snippets de code sur mon blog.&lt;/p&gt;&lt;p&gt;Bien qu'il dispose de nombreux plugin de prise en charge de language, parfois tr&amp;egrave;s &amp;eacute;sot&amp;eacute;rique, je n'ai encore rien vu pour le language pr&amp;eacute;f&amp;eacute;r&amp;eacute; de tous ceux qui font du MVC 3 ou du WebMatrix, j'ai nomm&amp;eacute; &lt;a href="http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax"&gt;razor&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/38/razor.jpg" alt="razor" /&gt;&lt;/p&gt;&lt;p&gt;Du coup, je me suis lanc&amp;eacute; et voici une toute premi&amp;egrave;re version t&amp;eacute;l&amp;eacute;chargeable &lt;a href="http://fabrice.michellonet.free.fr/MyMemoryLeaks/SH3/scripts/shBrushRazor.js"&gt;ici&lt;/a&gt;&lt;/p&gt;&lt;p&gt;et voici un exemple de mise en forme&lt;/p&gt;&lt;pre class="brush: razor;"&gt;
@model CustomMVCScaffolder.Models.Employee

@* This partial view defines form fields that will appear when creating and editing entities *@
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.NationalIdNumber)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.NationalIdNumber)
    @Html.ValidationMessageFor(model =&amp;gt; model.NationalIdNumber)&lt;/div&gt;

@foreach (var ourItem in ourList) {
   if (ourItem != ourList.First()) {
      &lt;span&gt;outItem.Name&lt;/span&gt;
   }
}

@Html.ActionLink("Edit", "Edit", new {  id=item.UserName  }) |
@Html.ActionLink("Details", "Details", new {  id=item.UserName  }) |
@Html.ActionLink("Delete", "Delete", new {  id=item.UserName  })        

@Html.Hidden("UserName", Model.UserName)
&lt;/pre&gt;&lt;p&gt;Voici comment l'utiliser :&lt;/p&gt;&lt;pre class="brush: html;"&gt;
  &amp;lt;pre style="brush:razor"&amp;gt;
    @Html.Hidden("UserName", Model.UserName)
  &amp;lt;/pre&amp;gt;
&lt;/pre&gt;&lt;p&gt;J'esp&amp;egrave;re que cette petite contribution &amp;agrave; la communaut&amp;eacute; viendra enjoliver les snippets de code que l'on voit &amp;ccedil;a et l&amp;agrave;.&lt;/p&gt;&lt;p&gt;Ho... j'oubliais, si vous avez des propositions pour am&amp;eacute;liorer la mise en forme, je suis preneur.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-5361820150316189616?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=IldX6FHViO0:i0bF4ei8GLQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=IldX6FHViO0:i0bF4ei8GLQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=IldX6FHViO0:i0bF4ei8GLQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/IldX6FHViO0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/5361820150316189616/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=5361820150316189616" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5361820150316189616" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5361820150316189616" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/IldX6FHViO0/razor-plugin-pour-syntaxhighlighter.html" title="Razor plugin pour SyntaxHighlighter" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/02/razor-plugin-pour-syntaxhighlighter.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-8492476905843542405</id><published>2011-02-22T23:52:00.003+01:00</published><updated>2011-02-22T23:58:10.098+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MSBuild" /><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title type="text">Transformations web.config d'une Web application.</title><content type="html">&lt;p&gt;On a tous connu ce cas de figure, ou l'on doit déployer une application web sur une plateforme autre que celle sur laquelle on développe (serveur de dev, recette, prod etc...);&lt;br /&gt;A minima on se retrouve à modifier les chaines de connexions vers la/les bases de données, au mieux on a prévu une copie tweakée du web.config par plateforme (avec le gros inconvénient d'avoir maintenant plusieurs fichiers à maintenir en parallèle), on fait ça dans l'urgence et hop ça plante :p.&lt;br /&gt;Surement un petit bout de configuration non que l'on a oublié de reporté dans ce fichier de conf spécifique à l'environnement visé. Ça sent le vécu, tout ça !&lt;/p&gt;&lt;p&gt;Réjouissez-vous ce temps est révolu!&lt;/p&gt;&lt;p&gt;Dans Visual Studio 2010, il possible de mettre en œuvre des transformations sur les fichiers de configuration. L'idée est d'avoir un fichier web.config servant de base, puis pour chaque Configuration de Solution (Debug, Release, etc..) un fichier de transformation contient les modifications apportés vis à vis du fichier de base.&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/37/solution.jpg"/&gt;&lt;/p&gt;&lt;p&gt;Si l'on ajoute deux Configurations de solutions, par exemple Recette et Prod, puis que l'on clique sur Add Config Transform deux nouveaux fichiers apparaissent Web.Recette.config &amp; Web.Prod.config&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/37/configTranform.jpg"/&gt;&lt;/p&gt;&lt;p&gt;L'idée de ce billet n'est pas d'expliquer en détail la syntaxe de transformation bien expliquée sur &lt;a href="http://msdn.microsoft.com/en-us/library/dd465326.aspx"&gt;MSDN&lt;/a&gt;; mais afin de poursuivre l'exemple voici mon web.config initial&lt;/p&gt;&lt;pre class="brush:xml"&gt;
&lt;connectionStrings&gt;
    &lt;add name="appDBConn" connectionString="data source=(localhost);Integrated Security=SSPI;initial catalog=MyDb" providerName="System.Data.SqlClient" /&gt;
&lt;/connectionStrings&gt;
&lt;/pre&gt;&lt;p&gt;et la transformation pour l'environnement de recette :&lt;/p&gt;&lt;pre class="brush:xml"&gt;
&lt;connectionStrings&gt;
&lt;add name="appDBConn" connectionString="data source=SRV_RECETTE;Integrated Security=SSPI;initial catalog=MyDb" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
&lt;/connectionStrings&gt;
&lt;/pre&gt;&lt;p&gt;Bon maintenant la mauvaise nouvelle (haaa ? j'vous avais pas dit qu'il y avait une mauvaise nouvelle?), c'est que la transformation du fichier de config ne se fait pas lors du build.&lt;br /&gt;Malheureusement, elle n’a lieu que lorsqu'on utilise webDeploy.&lt;br /&gt;La bonne nouvelle? C’est qu'en trafiquant un peu le csproj on peut lancer la tache MSBuild en charge de la transformation.&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/37/editProject.jpg"/&gt;&lt;/p&gt;&lt;p&gt;Allez tout en bas du fichier et modifiez-le comme suit : &lt;/p&gt;&lt;pre class="brush:xml"&gt;
&lt;Target Name="AfterBuild"&gt;
    &lt;MakeDir Directories="obj\$(ConfigurationName)" /&gt;
&lt;TransformXml Condition="Exists('obj\$(ConfigurationName)')" Source="Web.config" Transform="$(ProjectConfigTransformFileName)" Destination="obj\$(ConfigurationName)\Web.config" /&gt;
&lt;/Target&gt;
&lt;/pre&gt;&lt;p&gt;A partir de maintenant après chaque build le fichier web.config sera transformé et copié dans le répertoire obj/Nom_De_La_Config/web.config&lt;/p&gt;&lt;p&gt;Voilà, c'est tout pour ce soir, j’espère que cette astuce vous facilitera la vie lors de vos futurs déploiements.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-8492476905843542405?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=CfyNMO-DCr8:11KfaQeInqU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=CfyNMO-DCr8:11KfaQeInqU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=CfyNMO-DCr8:11KfaQeInqU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/CfyNMO-DCr8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/8492476905843542405/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=8492476905843542405" title="3 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/8492476905843542405" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/8492476905843542405" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/CfyNMO-DCr8/transformations-webconfig-d-web.html" title="Transformations web.config d&amp;#39;une Web application." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/02/transformations-webconfig-d-web.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-5736814822113597342</id><published>2011-02-18T22:13:00.010+01:00</published><updated>2011-02-28T23:47:42.087+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC" /><title type="text">MVC3 - Utiliser facilement le Datepicker de JQuery.</title><content type="html">&lt;p&gt;Un des points apportant le plus de productivit&amp;eacute; dans le framework ASP.NET MVC est surement l'avènement des Display &amp;amp; Editor Templates.&lt;/p&gt;&lt;p&gt;Je m'explique si vous suivez les best practices et que vos vues ressemblent plus ou moins &amp;agrave; cela :&lt;/p&gt;&lt;pre class="brush:razor"&gt;
@model CustomMVCScaffolder.Models.Employee

@* This partial view defines form fields that will appear when creating and editing entities *@
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.NationalIdNumber)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.NationalIdNumber)
    @Html.ValidationMessageFor(model =&amp;gt; model.NationalIdNumber)&lt;/div&gt;
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.Login)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.Login)
    @Html.ValidationMessageFor(model =&amp;gt; model.Login)&lt;/div&gt;
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.JobTitle)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.JobTitle)
    @Html.ValidationMessageFor(model =&amp;gt; model.JobTitle)&lt;/div&gt;
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.BirthDate)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.BirthDate)
    @Html.ValidationMessageFor(model =&amp;gt; model.BirthDate)&lt;/div&gt;
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.Maried)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.Maried)
    @Html.ValidationMessageFor(model =&amp;gt; model.Maried)&lt;/div&gt;
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.Gender)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.Gender)
    @Html.ValidationMessageFor(model =&amp;gt; model.Gender)&lt;/div&gt;
&lt;div class="editor-label"&gt;
    @Html.LabelFor(model =&amp;gt; model.HireDate)&lt;/div&gt;
&lt;div class="editor-field"&gt;
    @Html.EditorFor(model =&amp;gt; model.HireDate)
    @Html.ValidationMessageFor(model =&amp;gt; model.HireDate)&lt;/div&gt;
&lt;/pre&gt;&lt;p&gt;alors au runtime, le framework choisira le composant graphique HTML (Input, select etc...) le plus adapt&amp;eacute; &amp;agrave; afficher les propriétés du model et ca sur toutes vos vues.&lt;/p&gt;&lt;p&gt;La bonne nouvelle, c'est que l'on peut cr&amp;eacute;er nous m&amp;ecirc;me des templates pour les nouveaux types et encore mieux modifier les templates li&amp;eacute;s aux types de base (int, string, DateTime etc..)&lt;/p&gt;&lt;p&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Stop le blabla, place au Datepicker.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Ok, on commence par cr&amp;eacute;er dossier un EditorTemplates sous Views/Shared et on y place une nouvelle vue que l'on nommera DateTime.cshtml.&lt;/p&gt;&lt;p&gt;&lt;img src="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/36/sol_explo.jpg" alt="adding an editor" /&gt;&lt;/p&gt;&lt;pre class="brush:razor"&gt;
@using MVCTest
@model DateTime?

@Html.Datepicker("", Model.HasValue ? Model.Value.ToShortDateString() : string.Empty, 0)
&lt;/pre&gt;&lt;p&gt;Remarquez la simplicit&amp;eacute;, on ne fait qu'appeler une m&amp;eacute;thode d'extension (que nous allons &amp;eacute;tudier de suite) et on formatte tr&amp;egrave;s l&amp;eacute;g&amp;egrave;rement la date (ToShortDateString).&lt;/p&gt;&lt;p&gt;Rajoutons une classe dans notre projet comportant le code suivant :&lt;/p&gt;&lt;pre class="brush:csharp"&gt;
using System.Collections.Generic;
using System.Web.Mvc;

namespace MVCTest
{
    public static class JQueryHtmlHelpers
    {
        public static MvcHtmlString Datepicker(this HtmlHelper htmlHelper, string name, object value)
        {
            return System.Web.Mvc.Html.InputExtensions.TextBox(htmlHelper, name, value, new Dictionary { { "class", "datepicker" } });
        }
    }
}
&lt;/pre&gt;&lt;p&gt;Dans cette m&amp;eacute;thode d'extension, on se contente de demander le rendu d'une TextBox (input html) a laquelle on applique la class css datepicker.&lt;br /&gt;Vous l'aurez compris il ne nous reste plus qu'a &amp;eacute;crire un peu de JQuery dans la master page pour que toute les texbox du site ayant la class datepicker se transforment par magie en DatePicker.&lt;/p&gt;&lt;pre class="brush:js"&gt;
$(document).ready(function () {
    $(".datepicker").datepicker();
});
&lt;/pre&gt;&lt;p&gt;Voila ce que ça donne :&lt;/p&gt;&lt;p&gt;&lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/36/Avant.jpg' dojotype='dojox.image.Lightbox' group='av_ap' title='Avant'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/36/Avant_thumb.jpg' alt='Avant'/&gt;&lt;/a&gt;&amp;nbsp;&lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/36/Apres.jpg' dojotype='dojox.image.Lightbox' group='av_ap' title='Apres'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/36/Avant_thumb.jpg' alt='Apres'/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Je vous laisse imaginer tous les widgets que l'on peut intégrer facilement!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-5736814822113597342?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=LxkgvZDt2SQ:dQlIyu5f9nY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=LxkgvZDt2SQ:dQlIyu5f9nY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=LxkgvZDt2SQ:dQlIyu5f9nY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/LxkgvZDt2SQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/5736814822113597342/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=5736814822113597342" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5736814822113597342" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5736814822113597342" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/LxkgvZDt2SQ/mvc3-utiliser-facilement-le-datepicker.html" title="MVC3 - Utiliser facilement le Datepicker de JQuery." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/02/mvc3-utiliser-facilement-le-datepicker.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-72780912620664610</id><published>2011-01-20T00:18:00.003+01:00</published><updated>2011-01-20T14:39:34.402+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SSAS" /><category scheme="http://www.blogger.com/atom/ns#" term="SSRS" /><title type="text">Analysis Services Report Pack</title><content type="html">&lt;p&gt;Avant-hier, mon client m'a demandé s'il était possible d'avoir une "cartographie" de sa base OLAP que nous sommes en train de construire. &lt;/p&gt;&lt;p&gt;Par cartographie, il entendait a minima avoir un listing de toutes les mesures, dimensions et niveaux existants. Ma première réaction fut de vérifier si &lt;a href="http://bidshelper.codeplex.com/"&gt;BIDS Helper&lt;/a&gt; n'avait pas ce genre de feature cachée dans un coin. Circulez rien à voir de très intéressant de ce côté-là!&lt;/p&gt;&lt;p&gt;Je me suis ensuite rué sur Google pour voir s'il n'y avait pas un SQL Server Report Pack comme celui qui était apparu pour SQL Server 2005, mais axé Analysis Services. Rien non plus en direct de chez Redmond.&lt;br /&gt;Par contre en creusant un peu je suis tombé sur l'excellent blog de la société &lt;a href="http://capstonebi.blogspot.com/"&gt;Capstone&lt;/a&gt; et leur superbe &lt;a href="http://capstonebi.blogspot.com/2009/11/analysis-services-2008-metadata-report.html"&gt;Analysis Services 2008 Metadata Report Pack&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Voici un aperçu du rendu des rapports Reporting Services mis à disposition : &lt;/p&gt;&lt;p&gt;&lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/root.jpg' dojotype='dojox.image.Lightbox' group='Reports' title='Database'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/root_thumb.jpg' alt='Database'/&gt;&lt;/a&gt; &lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Cube_Det.jpg' dojotype='dojox.image.Lightbox' group='Reports' title='Cube'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Cube_Det_thumb.jpg' alt='Cube'/&gt;&lt;/a&gt; &lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Dimension_Det.jpg' dojotype='dojox.image.Lightbox' group='Reports' title='Dimension'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Mining_Model_thumb.jpg' alt='Dimension'/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Et pour faire plaisir à mon ami &lt;a href="http://fjehl.blogspot.com/"&gt;François&lt;/a&gt;, il y a même des infos sur le Data Mining : &lt;/p&gt;&lt;p&gt;&lt;a href='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Mining_Model.jpg' dojotype='dojox.image.Lightbox' group='Reports' title='Mining Model'&gt;&lt;img src='http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Mining_Model_thumb.jpg' alt='Dimension'/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Pour installer le pack il vous faudra créer un serveur lié dans SQL Server; Voici le script SQL a mettre en adéquation avec la configuration de votre machine : &lt;/p&gt;&lt;pre class="brush:sql"&gt;
EXEC master.dbo.sp_addlinkedserver @server = N'SSAS_METADATA', @srvproduct=N'SSAS', @provider=N'MSOLAP', @datasrc=N'localhost', @provstr=N'Provider=MSOLAP.4', @catalog=N'Adventure Works DW 2008R2'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'SSAS_METADATA',@useself=N'False',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
&lt;/pre&gt;&lt;p&gt;Puis déployer les rapports sur Reporting Services.&lt;/p&gt;&lt;p&gt;Je me permets de reposter l'ensemble de la solution de &lt;a href="http://capstonebi.blogspot.com/2009/11/analysis-services-2008-metadata-report.html"&gt;Dan Meyers&lt;/a&gt; &lt;a href="http://fabrice.michellonet.free.fr/MyMemoryLeaks/Posts/35/Analysis%20Services%202008%20Metadata%20Report%20Pack.zip"&gt;ici&lt;/a&gt;; version dans laquelle j'ai corrigé les connexions en dur par une connexion vers le serveur lié.&lt;/p&gt;&lt;p&gt;En dehors de répondre au besoin ponctuel de mon client, je me dis que ces rapports pourraient très bien trouver leur place dans une documentation technique à réaliser en fin de projet.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-72780912620664610?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=rrD2Ok6ByfM:QSuEqZ1i4Xo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=rrD2Ok6ByfM:QSuEqZ1i4Xo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=rrD2Ok6ByfM:QSuEqZ1i4Xo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/rrD2Ok6ByfM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/72780912620664610/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=72780912620664610" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/72780912620664610" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/72780912620664610" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/rrD2Ok6ByfM/analysis-services-report-pack.html" title="Analysis Services Report Pack" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/01/analysis-services-report-pack.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-5474396911224764744</id><published>2011-01-18T23:22:00.007+01:00</published><updated>2011-01-19T00:33:23.225+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IIS" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title type="text">Injection HTML à base d'HTTPModule</title><content type="html">&lt;p&gt;Dernièrement j'ai &amp;eacute;chang&amp;eacute; avec mon Boss, J&amp;eacute;r&amp;ocirc;me, sur les possibilit&amp;eacute;s d'enrichir un site web non d&amp;eacute;vellop&amp;eacute; en .NET mais qui serait host&amp;eacute; dans IIS.&lt;br /&gt;On pourrait se mettre à apprendre le Python... mais voila on est un peu fain&amp;eacute;ant :)&lt;/p&gt;&lt;p&gt;Une des solutions que je lui ai propos&amp;eacute; &amp;eacute;tais de tirer parti du m&amp;eacute;canisme d'extensibilit&amp;eacute; du pipeline de IIS7 afin d'intervenir directement sur le code HTML renvoy&amp;eacute; au navigateur.&lt;/p&gt;&lt;p&gt;&lt;div align='center'&gt;&lt;img src="http://fc09.deviantart.net/fs49/f/2009/179/6/7/67d8d599f0b79628e410f38b21028f90.jpg" width="600" height="300" alt="Green Injection"/&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Je me propose donc de présenter dans les grandes lignes comment mettre en place ce genre de solution.&lt;br /&gt;Pour illustrer mes propos simplement nous allons nous rajouter un div en fin de page, le div contenant l'heure du système.&lt;/p&gt;&lt;p&gt;On commence par créer notre HTTPModule et on répond à l'évenement BeginRequest : &lt;/p&gt;

&lt;pre class="brush:csharp"&gt;
using System;
using System.IO;
using System.Web;

namespace InjectorModule
{
    public class Injector : IHttpModule
    {
        private HttpApplication _application;

        public void Init(HttpApplication context)
        {
            context.BeginRequest += OnBeginRequest;
            _application = context;
        }

        private void OnBeginRequest(object sender, EventArgs e)
        {
            Stream filter = FilterFactory.GetFilter(_application);
            if (filter == null)
                return;

            _application.Response.Filter = filter;
        }

        public void Dispose() {}
    }
}
&lt;/pre&gt;
&lt;p&gt;On d&amp;eacute;l&amp;egrave;gue &amp;agrave; une factory le role de cr&amp;eacute;er ou non un filter en fonction de r&amp;egrave;gles qui ne sont pas connues par le Module.&lt;br /&gt;Le module reste ainsi une brique uniquement technique technique.&lt;/p&gt;&lt;p&gt;Passons &amp;agrave; la factory&lt;/p&gt;&lt;pre class="brush:csharp"&gt;
using System.IO;
using System.Web;

namespace InjectorModule
{
    internal static class FilterFactory
    {
        public static Stream GetFilter(HttpApplication application)
        {
            if (application == null || application.Response.ContentType == null)
                return null;

            if (application.Response.ContentType.ToUpperInvariant().Contains("HTML"))
                return new AppendDateTimeFilter(application.Response.Filter, application.Request.ContentEncoding);

            return null;
        }
    }
}
&lt;/pre&gt;&lt;p&gt;Ici pas de r&amp;egrave;gles m&amp;eacute;tiers compliqu&amp;eacute;es, on ajoute un Filter si le content type est de type HTML.&lt;/p&gt;&lt;p&gt;Et finalement voici l'impl&amp;eacute;mentation du Filter qui tranforme la r&amp;eacute;ponse envoy&amp;eacute;e aux navigateurs :&lt;/p&gt;&lt;pre class="brush:csharp"&gt;
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace InjectorModule
{
    internal class AppendDateTimeFilter : Stream
    {

        private readonly Stream _inputStream;
        private readonly Encoding _encoding;
        private readonly StringBuilder _responseHtml;

        public AppendDateTimeFilter(Stream input, Encoding contentEncoding)
        {
            _inputStream = input;
            _encoding = contentEncoding;
            _responseHtml = new StringBuilder();
        }

        #region Filter overrides

        public override bool CanRead
        {
            get { return true; }
        }

        public override bool CanSeek
        {
            get { return true; }
        }

        public override bool CanWrite
        {
            get { return true; }
        }

        public override void Close()
        {
            _inputStream.Close();
        }

        public override void Flush()
        {
            _inputStream.Flush();
        }

        public override long Length
        {
            get { return 0; }
        }

        public override long Position { get; set; }

        public override long Seek(long offset, SeekOrigin origin)
        {
            return _inputStream.Seek(offset, origin);
        }

        public override void SetLength(long length)
        {
            _inputStream.SetLength(length);
        }

        public override int Read(byte[] buffer, int offset, int count)
        {
            return _inputStream.Read(buffer, offset, count);
        }
        #endregion

        public override void Write(byte[] buffer, int offset, int count)
        {
            try
            {
                string bufferContent = _encoding.GetString(buffer);

                // Wait for the closing tag
                Regex eof = new Regex("", RegexOptions.IgnoreCase);

                _responseHtml.Append(bufferContent);
                if (!eof.IsMatch(bufferContent))
                    return;

                // Transform the response and write it back out
                string finalHtml = _responseHtml
                                        .Replace("", string.Format(@"
&lt;div&gt;{0}&lt;/div&gt;

", DateTime.Now))
                                        .ToString();

                // Send.
                byte[] data = _encoding.GetBytes(finalHtml);
                _inputStream.Write(data, 0, data.Length);
            }
            catch (Exception) { }

        }

    }
}
&lt;/pre&gt;&lt;p&gt;Pour tester rien de plus simple, on compile l'assembly, on la place dans le dossier bin du site web que l'on veux trafiquer.&lt;br /&gt;Dans notre cas, nous avons aussi du cr&amp;eacute;er le dossier bin car non existant dans l'appli Web Python.&lt;br /&gt;Le fait de placer l'assembly dans un dossier bin, est une contrainte technique impos&amp;eacute;e par IIS; je n'ai pas trouv&amp;eacute; d'alternatives et a priorit il n'y a pas de configuration qui pourrait influer sur cette contrainte.&lt;br /&gt;Finalement dans le gestionnaire IIS, rendez vous dans la section Modules de votre application Web.&lt;br /&gt;En ouvrant la fenetre d'ajout de modules, votre assembly sera d&amp;eacute;sormais pr&amp;eacute;sente; S&amp;eacute;lectionnez la, et pointez votre navigateur sur ce dernier.&lt;/p&gt;&lt;p&gt;Tadam!!! l'heure s'affiche tout en bas :)&lt;/p&gt;&lt;p&gt;J'esperes que cette solutions vous ouvre de nouvelles possibilit&amp;eacute;s.&lt;/p&gt;&lt;p&gt;Un dernier mot pour vous conseiller l'excellente librairie &lt;a href="http://htmlagilitypack.codeplex.com/"&gt;htmlagilitypack&lt;/a&gt; qui vous donnera les moyens de parser facilement un document HTML, m&amp;ecirc;me malform&amp;eacute;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-5474396911224764744?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=RtQlAPzTTms:OVFmPMLEiq0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=RtQlAPzTTms:OVFmPMLEiq0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=RtQlAPzTTms:OVFmPMLEiq0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/RtQlAPzTTms" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/5474396911224764744/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=5474396911224764744" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5474396911224764744" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5474396911224764744" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/RtQlAPzTTms/injection-html-base-d.html" title="Injection HTML à base d&amp;#39;HTTPModule" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2011/01/injection-html-base-d.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-483606607216912621</id><published>2010-10-26T00:12:00.002+02:00</published><updated>2010-10-26T15:40:43.118+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title type="text">Identity ou UniqueIdentifier (Guid) ?</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;Je dois être maudit ! Cela fait prés de 3 ans que sur tous les projets sur lesquels j’interviens, le sempiternel &lt;a href='http://fr.wikipedia.org/wiki/Troll_%28Internet%29'&gt;troll&lt;/a&gt; du &lt;u&gt;Identity vs Guid&lt;/u&gt; revient me hanter.&lt;/p&gt;

&lt;p/&gt;&lt;div align='center'&gt;&lt;img src='http://img145.imageshack.us/img145/9742/grandecart.jpg'/&gt;
&lt;/div&gt;&lt;p&gt;

&lt;/p&gt;&lt;p&gt;Non, non, non… je ne suis pas un ayatollah de la base de donnée… je n’ai rien contre les GUID ! Mais pourtant j’ai quand même du mal à comprendre pourquoi on a tendance à en coller partout, même quand ca n’a aucun sens… et ca j’ai vraiment du mal… &lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;u&gt;Mettons notre casquette de dba (je sais… beurk !)&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Le Guid c’est le mal (sauf pour la réplication ou l’on n’a pas le choix)… car :&lt;/p&gt;

&lt;p/&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;en production, on a vu plus simple que d’écrire des jointures sur des choses aussi imbitables, et anti-mémorisable que B2F62BF0-5CE0-408c-B749-F37D76AF5629.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Les perfs sont juste pourries par rapports à celles que l’on obtiendrait avec un int. J’en entends déjà plus d’un ricaner et prêt à me soutenir le contraire….Bien ! Rendez-vous sur ce &lt;a href='http://blog.developpez.com/sqlpro/p7436/langage-sql-norme/guid-versus-auto-increment-le-verdict/'&gt;benchmark&lt;/a&gt;, et prenez même 10 minutes pour lancer le test chez vous… c’est flagrant !Ce qui est étonnant, c’est qu’un grand nombre de développeurs, y compris des gens très brillant, passent à côté de ce point… certain m’ont déjà soutenu le contraire… au secours !&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;

&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;Mettons notre casquette de développeur : &lt;/u&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Le Guid c’est la meilleure invention depuis le garbage collector… ! Si si je fais mon &lt;a href='http://fr.wikipedia.org/wiki/Gloubi-boulga'&gt;gloubi-boulga&lt;/a&gt; et puis je referme le capot, ca marche à tout les coups… c’est génial le GUID.&lt;/p&gt;

&lt;p&gt;Dans une architecture en couche, je peux générer des Id dans ma couche client, associer des entités entre elles… puis :&lt;/p&gt;

&lt;p&gt;Si j’ai envie de les persister, pas de soucis et pas d’aller retour avec la le tiers de persistance (base de données), mes identifiants sont à coup sur uniques.&lt;/p&gt;

&lt;p&gt;Si j’ai envie d’annuler tout ce que j’ai fais, bah je cache méthodiquement tout sous le tapis (lisez : je laisse travailler le garbage collector).&lt;/p&gt;
&lt;p&gt;Tandis qu’un Int en tant qu’identifiant, qu’est ce que c’est embêtant…  je crée une entité sur mon client mais tant que je n’ai pas fait d’aller retour avec ma base de donnée, je n’ai aucun moyen de savoir son identifiant…&lt;/p&gt;
&lt;p&gt;Vous voulez associer un produit et sa catégorie de produit tout deux nouvellement crées ? Possible, mais on va devoir écrire un peu de code et faire des allers-retours avec la base.&lt;/p&gt;

&lt;p&gt;Bref… vu d’en haut l’identity c’est chiant… on est d’accord.&lt;/p&gt;

&lt;p&gt;PS : Pour ceux qui me diraient qu’on est pas obligé de faire des applications en couches séparées… bah…. ils ont raison, mais sur un projet un minimum important ca devient vite difficile à maintenir de tout coder dans la form (aussi bien web que win)… faut que vous jetiez un coup d’œil au &lt;a href='http://fr.wikipedia.org/wiki/TDD'&gt;TDD&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Voila, c’est la que commence à mon sens notre vrai travail. Il nous faut estimer les avantages et les inconvénients des deux approches, et faire un choix entre la performance pure de la base et grosso modo la vitesse de développement de l’application… en ces temps ou le mot d’agilité et dans la bouche de tous, le choix est vite fait…  Promis m’sieur y’a quelques temps j’arrivais encore à faire le grand écart…&lt;/p&gt;

&lt;p&gt;Bon tout ca c’est bien beau, mais alors quelqu’un pourrait m’expliquer pourquoi il m’arrive de tomber sur des bases qui sont truffées de GUID (seul type de donnée utilisé comme clé primaire des tables) lorsque celles-ci sont attaquées par une application en mode client-serveur ? Franchement, la, ca me dépasse !&lt;/p&gt;

&lt;p&gt;Bon, aller pour ceux qui ont réussi à me lire jusqu’ici, voici quelques liens supplémentaires sur le sujet :
&lt;/p&gt;&lt;p&gt;&lt;a href='http://www.sqlskills.com/BLOGS/KIMBERLY/post/GUIDs-as-PRIMARY-KEYs-andor-the-clustering-key.aspx'&gt;Les racines des problèmes que posent les GUID avec les index Clustered&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/ms189786%28SQL.90%29.aspx'&gt;la fonction SQL-SERVER NEWSEQUENTIALID()&lt;/a&gt; si on adore les GUID dans SQL et que l’on ne peut s’en passer.&lt;/p&gt;

&lt;p&gt;Et le meilleur pour la fin, je vous laisse réfléchir sur la phrase suivante trouvée dans la &lt;a href='http://msdn.microsoft.com/en-us/library/ms190215.aspx'&gt;MSDN &lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p/&gt;&lt;p&gt;Consider using the IDENTITY property when global uniqueness is not required, or when having a serially incrementing key is preferred.&lt;/p&gt;&lt;p/&gt;&lt;/blockquote&gt;

&lt;p&gt;Evidemment, si certain d’entre vous on envie de troller sur le sujet… les commentaires sont fait pour ca :)&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-483606607216912621?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=FosVyD-ZQf8:O9x0SaLbGWE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=FosVyD-ZQf8:O9x0SaLbGWE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=FosVyD-ZQf8:O9x0SaLbGWE:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/FosVyD-ZQf8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/483606607216912621/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=483606607216912621" title="3 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/483606607216912621" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/483606607216912621" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/FosVyD-ZQf8/identity-ou-uniqueidentifier-guid.html" title="Identity ou UniqueIdentifier (Guid) ?" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/10/identity-ou-uniqueidentifier-guid.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-310183282094609834</id><published>2010-04-27T19:55:00.002+02:00</published><updated>2010-04-28T17:23:35.575+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Autre" /><title type="text">JetBrains supporte l'Open Source</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;Comme vous le savez sûrement, la version 5 de &lt;a href='http://www.jetbrains.com/resharper/index.html'&gt;Resharper&lt;/a&gt; est disponible depuis quelques temps, évidement pour supporter la version 2010 de Visual Studio; même si le produit est installable sur un Visual Studio 2008. Le but de ce post, n'est pas juste de vous annoncer la mise à dispo d'un soft et d'en faire la pub, c'est vraiment pas mon genre, et encore moins le but de ce blog.&lt;/p&gt;
&lt;p&gt;Bon retour en arrière de quelques mois, je tombe (presque) par hasard sur le page de licensing de Resharper (à l'époque version 4.5) et je me disais que ca serait sûrement un bon investissement; Après tout, un code écrit plus vite, et avec moins de bugs (&lt;a href='http://stackoverflow.com/questions/304258/access-to-modified-closure-2'&gt;Modified Closure&lt;/a&gt;), c'est bon pour mes clients, ma boite et puis pour moi aussi au final. Bref, plusieurs type de licences sont listées sur le site, dont une Licence Open Source &lt;b&gt;GRATUITE&lt;/b&gt;...&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Ouarf ouarf ouaf, s'écrit mon côté pessimiste...&lt;/p&gt;&lt;p&gt;Ça c'est de la bonne pub gratuite.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;J'approfondis un peu, il est dit qu'il faut présenter son projet Open Source, prouver sa participation dans le projet et une commission décidera si une licence gratuite sera attribuée etc...&lt;/p&gt;
&lt;blockquote&gt;Bon ok, en gros derrière dois y avoir une vieille boite mail que plus personne ne lit, et de toute façon ca m'étonnerait que les mecs aient le temps et l'envie de faire autre chose que coder pour leurs softs... alors de la à aller jeter un œil sur les projets Open Source soumis, puis faire une commission faudrait pas pousser quand même&lt;/blockquote&gt;
&lt;p&gt;Je vous l'accorde, ce jour la je devais être en mode Christophe... un peu beaucoup bougon! :) &lt;/p&gt;
&lt;p&gt;Bon, pas très grave tout ca, car très peu de temps après je démarre une nouvelle mission (mon client actuel), et il se trouve que Resharper fait partie du toolkit de tout les développeurs... Ouf, j'vais pouvoir faire illusion, et faire croire que je sais un peu programmer.&lt;/p&gt;
&lt;p&gt;Pas mal de temps passe, la question de l'acquisition de Resharper n'est plus trop d'actualité, jusqu'à ce que les betas de la version 5 ne commencent a être mise à dispo. Et puis lorsque la version finale sort, je ne peux m'empêcher de l'installer, pour 30 jours seulement en version demo... sniff.&lt;/p&gt;
&lt;p&gt;Alors, il y a moins d'une semaine, je me lance, et soumet à la fameuse commission mon pet projet actuel (&lt;a href='http://claymore.codeplex.com/'&gt;Claymore&lt;/a&gt;), sans trop de conviction. Et figurez vous qu'a peine 3 jours après (un dimanche exactement... bah oui les commissions de développeurs c'est en dehors des heures de travail) la bonne nouvelle tombe dans ma boite mail... j'ai le droit a une version Full de Resharper 5.0 pendant 1 an grâce à ce projet Open Source.&lt;/p&gt;
&lt;p&gt;Donc déjà, je vous demande pardon mesdames et messieurs de chez JetBrains d'avoir douté de votre parole. Merci de cet effort que vous consentez pour améliorer la qualité du code Open Source. Et puis, j'suis sur que mes clients actuels et futures vous remercieront aussi... j'ferais moins de bugs grâce a vous.&lt;/p&gt;
&lt;p&gt;Moralité, si vous avez un bout de code qui vaut le coup d'être mis à dispo des autres, et qui de toute façon ne vous rendra pas millionnaire, publiez-le, il vous permettra peut être d'avoir une licence gratuite de Resharper.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update [28 Avril 2010] : &lt;/b&gt;Jérôme m'a fait remarquer que mon lien vers l'exemple de Modified Closure était erroné. C'est corrigé.&lt;/p&gt;
&lt;div align='center'&gt;&lt;img src='http://www.jetbrains.com/idea/../styles2/../img/banners/rs5_sb.png'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-310183282094609834?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=Jfn2PJGIDeE:_Cz0k2Bq2G0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=Jfn2PJGIDeE:_Cz0k2Bq2G0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Jfn2PJGIDeE:_Cz0k2Bq2G0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/Jfn2PJGIDeE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/310183282094609834/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=310183282094609834" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/310183282094609834" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/310183282094609834" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/Jfn2PJGIDeE/jetbrains-supporte-l-source.html" title="JetBrains supporte l&amp;#39;Open Source" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/04/jetbrains-supporte-l-source.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-5133934878337889191</id><published>2010-04-23T00:22:00.001+02:00</published><updated>2010-04-23T00:42:08.183+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CIL" /><title type="text">Overriding et Shadowing de méthodes en IL.</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;En ce moment je fais joujou avec les &lt;a href='http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes_members.aspx'&gt;opcodes&lt;/a&gt; &lt;a href='http://fr.wikipedia.org/wiki/Common_Intermediate_Language'&gt;CIL&lt;/a&gt; qui se cachent sous notre bon vieux C#.&lt;/p&gt;
&lt;p&gt;En voulant surcharger et cacher (shadow) successivement deux propriétés hérités, j'ai remarqué que le compilo générait une suite de metadata assez déroutante. Prenons l'exemple suivant : &lt;/p&gt;
&lt;pre class='brush:csharp'&gt;public class BaseClass
    {
        public int Prop1 { get; set; }
        public virtual int Prop2 { get; set; }
        public virtual int Prop3 { get; set; }
    }

    public class DerivClass : BaseClass
    {
        public int Prop1 { get; set; }
        public new int Prop2 { get; set; }
        public new virtual int Prop3 { get; set; }
    }
&lt;/pre&gt;
&lt;p&gt;Du coté de la classe de base on obtient les metadata suivantes sur le getter :
&lt;/p&gt;&lt;p&gt;
non virtual : &lt;/p&gt;&lt;pre class='brush:csharp'&gt;.method public hidebysig specialname instance int32 get_Prop1() cil managed&lt;/pre&gt;
virtual     : &lt;pre class='brush:csharp'&gt;.method public hidebysig specialname newslot virtual instance int32 get_Prop2() cil managed&lt;/pre&gt;
remarquez l'utilisation conjointes des metadata virtual et newslot, je reviendrais dessus juste après.&lt;p&gt;

Côté classe dérivée on obtient cela : 
&lt;/p&gt;&lt;p&gt;
non virtual : &lt;/p&gt;&lt;pre class='brush:csharp'&gt;.method public hidebysig specialname instance int32 get_Prop1() cil managed&lt;/pre&gt;
new         : &lt;pre class='brush:csharp'&gt;.method public hidebysig specialname instance int32 get_Prop2() cil managed&lt;/pre&gt;
virtual new : &lt;pre class='brush:csharp'&gt;.method public hidebysig specialname newslot virtual instance int32 get_Prop3() cil managed&lt;/pre&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Oulaaa... c'est la que ca se corse!!
Dans la classe de base, comme je vous le faisait remarquer précédemment, le compilo utilise conjointement les metadata virtual et newslot. Logiquement, on aurait pu s'attendre a voir uniquement le virtual. 
&lt;/p&gt;&lt;p&gt;Dans la classe dérivée, le shadowing non virtuel &lt;/p&gt;&lt;pre class='brush:csharp'&gt;public new int Prop2 { get; set; }&lt;/pre&gt; produit des metadata token strictement identiques à une propriété normale; et le shadowing virtuel produit un IL identique à propriété virtuelle.
&lt;p/&gt;&lt;p&gt;De ces constatation on peut en déduire que : 
Le token newslot, ne suffit pas à affirmer qu'il s'agit d'une shadowing methode (le getter non-virtuel de la classe de base et le getter new de la classe dérivée ayant les mêmes metadata).&lt;/p&gt;&lt;p&gt;Par contre, si une méthode contient le token virtual mais pas le newslot, alors c'est qu'il s'agit a coup sur d'un overriding et pas un shadowing.&lt;/p&gt;&lt;p&gt;Par déduction, on peut donc penser que si une méthode n'est pas un overriding (le token newslot est présent), alors il n'y a shadowing que si la signature [type de retour, nom et paramètres de la méthode] de la méthode existe également dans la classe de base.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-5133934878337889191?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=-5THqNLbWFo:ALXEjY8RqAk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=-5THqNLbWFo:ALXEjY8RqAk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=-5THqNLbWFo:ALXEjY8RqAk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/-5THqNLbWFo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/5133934878337889191/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=5133934878337889191" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5133934878337889191" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/5133934878337889191" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/-5THqNLbWFo/overriding-et-shadowing-de-methodes-en.html" title="Overriding et Shadowing de méthodes en IL." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/04/overriding-et-shadowing-de-methodes-en.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-3318019944939466331</id><published>2010-04-21T23:37:00.001+02:00</published><updated>2010-04-21T23:39:10.855+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Claymore" /><title type="text">Interagir avec les pages ASP.NET avant l'Init.</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;Au cours du développement de &lt;a href='http://claymore.codeplex.com/'&gt;Claymore&lt;/a&gt;, pour la partie ASP.NET plus précisément, j'ai eu besoin de trouver un &lt;a href='http://fr.wikipedia.org/wiki/Hook_%28informatique%29'&gt;hook&lt;/a&gt; me donnant la possibilité d'interagir avec les pages avant les events que l'on trouve sur l'objet Page.&lt;/p&gt;&lt;p&gt;J'ai tout d'abord pensé tripatouiller dans le fichier Global.asax... sans finalement avoir trouvé ce que je souhaitais. Par contre, en fouillant un peu du côté des &lt;a href='http://msdn.microsoft.com/fr-fr/library/9b9dh535.aspx'&gt;HttpModule&lt;/a&gt; je suis arrivé à la solution suivante :&lt;/p&gt;
&lt;pre class='brush:csharp'&gt;
using System;
using System.Reflection;
using System.Web;
using System.Web.UI;

namespace Claymore.Web
{
    /// &amp;lt;summary&amp;gt;
    /// 
    /// &amp;lt;/summary&amp;gt;
    public class ClaymoreHttpModule : IHttpModule
    {
        #region Fields

        private HttpApplication _application;

        #endregion

        /// &amp;lt;summary&amp;gt;
        /// Initializes a module and prepares it to handle requests.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="context"&amp;gt; &amp;lt;/param&amp;gt;An &amp;lt;see cref="T:System.Web.HttpApplication"/&amp;gt; that provides access to the methods, properties, and events common to all application objects within an ASP.NET application
        public void Init(HttpApplication context)
        {
            if(context == null)
                throw  new ArgumentNullException("context");

            _application = context;

            context.PostMapRequestHandler += onPostMapRequestHandler;
        }


        /// &amp;lt;summary&amp;gt;
        /// Disposes of the resources (other than memory) used by the module that implements &amp;lt;see cref="T:System.Web.IHttpModule"/&amp;gt;.
        /// &amp;lt;/summary&amp;gt;
        public void Dispose(){}

        /// &amp;lt;summary&amp;gt;
        /// Handle PostMapRequest event.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="sender"&amp;gt; &amp;lt;/param&amp;gt;The sender.
        /// &amp;lt;param name="e"&amp;gt; &amp;lt;/param&amp;gt;The &amp;lt;see cref="System.EventArgs"/&amp;gt; instance containing the event data.
        private void onPostMapRequestHandler(object sender, EventArgs e)
        {
            Page pageHandler;
            if ((pageHandler = _application.Context.Handler as Page) != null)
                pageHandler.PreInit += HandlePreInit;
        }

        /// &amp;lt;summary&amp;gt;
        /// Handles the pre init event.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="sender"&amp;gt; &amp;lt;/param&amp;gt;The sender.
        /// &amp;lt;param name="e"&amp;gt; &amp;lt;/param&amp;gt;The &amp;lt;see cref="System.EventArgs"/&amp;gt; instance containing the event data.
        protected virtual void HandlePreInit(object sender, EventArgs e)
        {
            Page page = sender as Page;
            if (page != null){
                // Et voila, on a un pointeur sur une page, et l'on peut interagir avec elle avant l'événement Init.
                // Ajouter du code ici.
            }
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;L'un d'entre vous connaîtrait-il une solution équivalente à base de &lt;a href='http://msdn.microsoft.com/en-us/library/5c67a8bd%28VS.71%29.aspx'&gt;HttpHandler&lt;/a&gt; ou autre?&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-3318019944939466331?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=5rCaordtOoU:K9HX-LcpxRQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=5rCaordtOoU:K9HX-LcpxRQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=5rCaordtOoU:K9HX-LcpxRQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/5rCaordtOoU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/3318019944939466331/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=3318019944939466331" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/3318019944939466331" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/3318019944939466331" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/5rCaordtOoU/interagir-avec-les-pages-aspnet-avant-l.html" title="Interagir avec les pages ASP.NET avant l&amp;#39;Init." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/04/interagir-avec-les-pages-aspnet-avant-l.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-3467548966815323308</id><published>2010-04-05T23:15:00.001+02:00</published><updated>2010-04-05T23:29:51.776+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WCF" /><title type="text">Benchmark WCF vs ASMX, Remoting, WSE, Enterprise Services.</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;Je relais assez peu souvent les infos glanées sur tel ou tel site, préférant vous montrer un peu de code :)&lt;/p&gt;&lt;p&gt;Ceci dit ce soir je fais une exception, en vous encourageant vivement a jeter un coup d'œil au &lt;a href='http://msdn.microsoft.com/en-us/library/bb310550.aspx'&gt;benchmark des technos de mise en réseau&lt;/a&gt; que nous, développeurs .NET, avons à notre dispositions.&lt;/p&gt;&lt;p&gt;Le bench, étudie de manière approfondie chaque techno, et la compare dans un scenario viable et réaliste de leurs utilisations.&lt;/p&gt;&lt;p&gt;Je ne peux m'empêcher de vous donner une idée de ce qu'il en ressort :&lt;/p&gt;&lt;blockquote&gt;To summarize the results, WCF is 25%—50% faster than ASP.NET Web Services, and approximately 25% faster than .NET Remoting. Comparison with .NET Enterprise Service is load dependant, as in one case WCF is nearly 100% faster but in another scenario it is nearly 25% slower. For WSE 2.0/3.0 implementations, migrating them to WCF will obviously provide the most significant performance gains of almost 4x.&lt;/blockquote&gt;
&lt;p&gt;Donc , lorsque vous entamerez un nouveau projet, sans contraintes techniques spécifiques sur la partie mise en réseau, il n'y a plus d'excuse... c'est WCF ou rien :p&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-3467548966815323308?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=OM47Vf77IKw:AyNCG8iDM7I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=OM47Vf77IKw:AyNCG8iDM7I:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=OM47Vf77IKw:AyNCG8iDM7I:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/OM47Vf77IKw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/3467548966815323308/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=3467548966815323308" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/3467548966815323308" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/3467548966815323308" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/OM47Vf77IKw/benchmark-wcf-vs-asmx-remoting-wse.html" title="Benchmark WCF vs ASMX, Remoting, WSE, Enterprise Services." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/04/benchmark-wcf-vs-asmx-remoting-wse.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-7008553822497889512</id><published>2010-03-31T22:37:00.001+02:00</published><updated>2010-03-31T22:37:59.235+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVP" /><category scheme="http://www.blogger.com/atom/ns#" term="Claymore" /><title type="text">Version 1.1.0.0 de Claymore</title><content type="html">&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;Suite à la &lt;a href='http://claymore.codeplex.com/Thread/View.aspx?ThreadId=205281'&gt;demande&lt;/a&gt; d'un utilisateur sur &lt;a href='http://claymore.codeplex.com'&gt;Codeplex&lt;/a&gt; de pouvoir utiliser Claymore avec le Compact Framework, j'ai ajouté cette feature dans la librairie; Plus précisément, il existe désormais une assembly qui vise spécifiquement cette version du Framework.&lt;/p&gt;&lt;p&gt;Les classes du Namespace &lt;a href='http://msdn.microsoft.com/en-us/library/2a1tyt9s%28v=VS.90%29.aspx'&gt;Configuration&lt;/a&gt; n'existant pas dans le Compact Framework, j'ai donc du ajouter une API permettant de configurer par code, le fonctionnement de la librairie, tout comme il est possible de le faire en passant par une configuration dans le fichier app.config ou web.config.&lt;/p&gt;&lt;p&gt;J'en ai profité pour designer l'API de configuration en suivant les conventions des &lt;a href='http://en.wikipedia.org/wiki/Fluent_interface'&gt;Fluent interfaces&lt;/a&gt;; Ce type d'écriture semblant être de plus en plus apprécié des développeurs que nous sommes.&lt;/p&gt;&lt;p&gt;Bon téléchargement, et n'hésitez pas à me dire ce que vous en pensez.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-7008553822497889512?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=4Y3cdHJE8_I:2_K_tLyCFzQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=4Y3cdHJE8_I:2_K_tLyCFzQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=4Y3cdHJE8_I:2_K_tLyCFzQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/4Y3cdHJE8_I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/7008553822497889512/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=7008553822497889512" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7008553822497889512" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/7008553822497889512" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/4Y3cdHJE8_I/version-1100-de-claymore.html" title="Version 1.1.0.0 de Claymore" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/03/version-1100-de-claymore.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-6631070130298957797</id><published>2010-02-19T00:43:00.000+01:00</published><updated>2010-02-19T00:44:13.490+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVP" /><category scheme="http://www.blogger.com/atom/ns#" term="Claymore" /><title type="text">Claymore - Framework MVP</title><content type="html">&lt;p&gt;Non non non, vous ne rêvez pas... non non je ne suis pas mort!
Ça faisait bien longtemps que je n'avais pas eu et pas pris le temps de mettre à jour ce blog... Qui as dit que les enfants n'était pas chronophages? :)&lt;/p&gt;
&lt;p&gt;Depuis près de deux ans, les missions sur lesquelles j'interviens sont très souvent liées au développement Winform et malheureusement à chaque fois c'est le même constat; les forms et/ou usercontrol sont un joli mélange de code métier et de gestion d'interface graphique, sans parler des cas ou l'on retrouve même le code d'accès aux données fourré au beau milieu de ce jolie petit monde.&lt;/p&gt;
&lt;p&gt;Pourtant, cela fait bien longtemps que l'on connait les patterns &lt;a href="http://fr.wikipedia.org/wiki/Mod%C3%A8le-Vue-Contr%C3%B4leur"&gt;MVC&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Model_View_Presenter"&gt;MVP&lt;/a&gt; et depuis quelques temps le &lt;a href="http://en.wikipedia.org/wiki/MVVM"&gt;MVVM&lt;/a&gt; qui prend son essor avec &lt;a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation%3EWPF%3C/a%3E%20et%20%3Ca%20href=" http:="" en.wikipedia.org="" wiki="" silverlight=""&gt;Silverlight&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;En demandant aux architectes ou Lead techniques de ces projets, ce qui avait justifié de ne pas appliquer un des ces patterns, la réponse est presque toujours la même :
L'implémentation de ces modèles dans les applications rallonge (parfois beaucoup) les temps de développement, demande des compétences un peu plus high level de la part des développeurs, et la montée en compétence sur les frameworks existants est parfois très lente.&lt;/p&gt;
&lt;p&gt;Entre nous, avant de pouvoir appréhender et amortir le temps d'apprentissage d'un framework comme &lt;a href="http://msdn.microsoft.com/en-us/library/aa480450.aspx"&gt;Smart Client - Composite UI Application Block&lt;/a&gt; de Microsoft, le projet à intérêt à s'étaler sur un an au minimum.&lt;/p&gt;
&lt;p&gt;Afin de rester impartial, je ne m'étendrais pas sur les autres framework MVP qui peuvent se trouver sur la toile.
&lt;/p&gt;&lt;p&gt;Bref, il me semblait qu'il serait intéressant d'avoir un framework MVP simple d'utilisation dans mon escarcelle pour les prochains projets.
J'ai donc commencé à écrire ça dans mon coin; Aujourd'hui &lt;a href="http://claymore.codeplex.com/"&gt;Claymore&lt;/a&gt; me semble assez mûre pour le mettre à disposition des autres, et je l'ai donc publié sur &lt;a href="http://claymore.codeplex.com/"&gt;codeplex&lt;/a&gt;. Évidemment, &lt;a href="http://claymore.codeplex.com/"&gt;Claymore&lt;/a&gt; fonctionne avec les projets Winform mais je n'ai pu m'empêcher d'ajouter aussi le support des projets ASP.NET.&lt;/p&gt;
&lt;p&gt;J'espère que ce framework saura vous aider à découpler les couches métiers des couches UI...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-6631070130298957797?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=jXjAOlK8NWg:5HYqa8pWeZ4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=jXjAOlK8NWg:5HYqa8pWeZ4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=jXjAOlK8NWg:5HYqa8pWeZ4:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/jXjAOlK8NWg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/6631070130298957797/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=6631070130298957797" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/6631070130298957797" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/6631070130298957797" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/jXjAOlK8NWg/claymore-framework-mvp.html" title="Claymore - Framework MVP" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2010/02/claymore-framework-mvp.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-9209336605279329112</id><published>2009-08-03T09:43:00.007+02:00</published><updated>2009-08-03T17:28:42.432+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio" /><title type="text">Code source du framework .NET</title><content type="html">&lt;p&gt;Cela fait plus d'un an et demi que le site &lt;a href='http://referencesource.microsoft.com/'&gt;Microsoft Reference Source Code Center&lt;/a&gt; à vu le jour. Rappelons que ce dernier à pour but de mettre à disposition le code source des assembly suivantes :
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Mscorlib.DLL&lt;/li&gt;
&lt;li&gt;System.DLL&lt;/li&gt;
&lt;li&gt;System.Data.DLL&lt;/li&gt;
&lt;li&gt;System.Drawing.DLL&lt;/li&gt;
&lt;li&gt;System.Web.DLL&lt;/li&gt;
&lt;li&gt;System.Web.Extensions.DLL&lt;/li&gt;
&lt;li&gt;System.Windows.Forms.DLL&lt;/li&gt;
&lt;li&gt;System.XML.DLL&lt;/li&gt;
&lt;li&gt;WPF (UIAutomation*.dll, System.Windows.DLL, System.Printing.DLL, System.Speech.DLL, WindowsBase.DLL, WindowsFormsIntegration.DLL, Presentation*.dll, et quelques autres...)&lt;/li&gt;
&lt;li&gt;Microsoft.VisualBasic.DLL&lt;/li&gt;&lt;/ul&gt;&lt;p/&gt;&lt;p&gt;Depuis lors Visual Studio 2008 à été mis à jour afin d'offrir la possibilité de debugger en direct les sources du framework .NET.
Pour ceux qui aurait loupé l'info au moment de la sortie (peut-être que l'info n'a  pas été assez bien relayée), voici un &lt;a href='http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx'&gt;tutoriel&lt;/a&gt; de Shawn Burke qui vous permettra de configurer votre IDE préféré.&lt;/p&gt;&lt;p&gt;Pour les utilisateurs de VS2005 ou bien des version Express de Visual Studio, alors &lt;a href='http://www.codeplex.com/NetMassDownloader'&gt;.NET Mass Downloader&lt;/a&gt; est l'outil qu'il vous faut car il vous permettra de remplir le cache de code source utilisé par l'IDE et en prime vous autorisera de travailler même lorsque vous n'êtes pas connecté à Internet.&lt;/p&gt;&lt;p&gt;Voila donc quelques cas ou vous pourrez vous permettre d'oublier &lt;a href='http://www.red-gate.com/products/reflector'&gt;Reflector&lt;/a&gt; :D.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-9209336605279329112?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=g52IBmEWSuo:_Vyp6scAybU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=g52IBmEWSuo:_Vyp6scAybU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=g52IBmEWSuo:_Vyp6scAybU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/g52IBmEWSuo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/9209336605279329112/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=9209336605279329112" title="0 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/9209336605279329112" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/9209336605279329112" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/g52IBmEWSuo/code-source-du-framework-net.html" title="Code source du framework .NET" /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2009/08/code-source-du-framework-net.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1146316188254265608.post-2039276419130551459</id><published>2009-07-22T22:56:00.007+02:00</published><updated>2009-07-23T16:16:36.099+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Autre" /><title type="text">Nouveau skin.</title><content type="html">&lt;p&gt;Voila! après quelques nuits plutôt courtes je suis heureux de mettre en ligne ce nouveau thème pour mon blog.&lt;/p&gt;&lt;p&gt;Certains lecteurs m'ayant dit que sur l'ancienne version la fonte était trop petite et sombre, j'ai essayé de trouver un compromis entre la mode du flashy qui sévit de plus en plus sur la toile et mon penchant pour le gothisme... Finalement, je suis reparti sur un autre concept... Bref, vos yeux devraient moins saigner si vous lisez ces lignes sur le blog directement. Quand à ceux qui trouvent que le blog a basculé dans le mode Hacker (comprenez fonte blanche sur fond noir) et bien il vous reste toujours &lt;a href='http://www.google.fr/reader'&gt;Google Reader&lt;/a&gt; :)&lt;/p&gt;&lt;p&gt;Il y a aussi quelques améliorations au menu : &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Passage à la version 1.3.1 de dojo sur le CDN fournit par Google&lt;/li&gt;&lt;li&gt;Passage à la version 2.0.320 de SyntaxHighlighter&lt;/li&gt;&lt;li&gt;Mise en place d'un style pour les blockquote sans l'utilisation d'image; Cela ne fonctionne qu'avec les navigateurs de dernière génération.&lt;/li&gt;&lt;/ul&gt;J'espère que vous aimerez autant que j'ai pris de plaisir a le mettre en place.&lt;p/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1146316188254265608-2039276419130551459?l=mymemoryleaks.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=Je7ctmes8Ac:XsgJu4aLtCs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?i=Je7ctmes8Ac:XsgJu4aLtCs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/MemoryLeaks?a=Je7ctmes8Ac:XsgJu4aLtCs:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/MemoryLeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MemoryLeaks/~4/Je7ctmes8Ac" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mymemoryleaks.blogspot.com/feeds/2039276419130551459/comments/default" title="Publier les commentaires" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1146316188254265608&amp;postID=2039276419130551459" title="2 commentaires" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/2039276419130551459" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1146316188254265608/posts/default/2039276419130551459" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MemoryLeaks/~3/Je7ctmes8Ac/nouveau-skin.html" title="Nouveau skin." /><author><name>Fabrice Michellonet</name><uri>http://www.blogger.com/profile/10201820062243684793</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp1.blogger.com/_yYUu3sWKdtU/SE76j2im4AI/AAAAAAAACFA/OgO15yojzu8/S220/Fabrice_MICHELLONET.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://mymemoryleaks.blogspot.com/2009/07/nouveau-skin.html</feedburner:origLink></entry></feed>

