Community Blogs

Browse by Tags

Related Posts

  • New article: How to detect and avoid memory and resources leaks in .NET applications

    My new article, which I've been preparing over the last few months, is now available. It's about memory and resources leaks in .NET . You'll find it in English on MSDN and in French on DotNetGuru.org . It's also available in PDF in English and in French . Here is the table of content: Introduction Leaks? Resources? What do you mean? How to detect leaks and find the leaking resources Common memory leak causes Common memory leaks causes demonstrated How to avoid leaks Tools Conclusion Resources Despite what a lot of people believe, it's easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your...


  • Adhoc testing of .NET RIA Services

    Suddenly my Silverlight 3 application breaks during development process. Cause I have installed Visual Studio 2010 a few hours before, I was sure: must be something with 2010 . After uninstall and reinstall SP1 everything worked fine, except .NET RIA services :-( So back to structured trouble shoothing. What is the first point, the database- SQL Profiler shows no requests. Second point is Entity model. Till now I do not know any point to interactive test a model. Next point is the RIA Service. But how to call a RIA Service in Browser? I took fiddler to figure it out http://localhost:51240/ClientBin/DataService.axd/test3-Web-DomainService1/GetCustomers Server and Port: here ASP.NET Web Dev Server ClientBin directory dataservice.axd – you can...


  • Major Hack: Repository Tests With NHibernate And SQLite on a CI Server

    I recently setup my first continuous integration build server using JetBrains’ TeamCity product, and it couldn’t have been much simpler. However I kept running into an issue with my test projects whenever I was using NHibernate or SQLite (very useful or regression tests against an in-memory database). The Problem Everything would run correctly locally using MSTest, but when TeamCity ran the tests I would get the following error: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of...


  • Common Web.Config transformations with Visual Studio 2010

    I’ve been playing with Visual Studio 2010 Beta a little and one of my favorite new features (and there are many) is the new web.config transformation feature.  Web.config transformations are setup so there is one configuration “delta” for each build configuration that you have (default are Debug and Release).  When you build your solution (as a package, when you publish, etc) your original web.config is transformed according to the settings in your web.debug.config file (assuming the debug configuration). There are plenty of blogs and msdn references out there for you to look at but I thought I’d write a quick post that would get you up to date on how to do the some common web.config transformations. First, A Tiny Iota (That guy was...


  • XMLAuto version 2010

    Ten years ago, I played with OLE Automation so we can write things such as the following, where Document represents an XML document: String name = Document.Bookstore.Book[1].Author.LastName; Document.Bookstore.Book[1].Author.LastName = "NewName"; The experiment was named XMLAuto . I wanted to implement this again with C# 4's dynamic keyword, but I won't have to do it. Mark Michaelis and Michael Stokesbary already played with this (last year). I find it's an interesting way to learn how to implement IDynamicObject . Read More...


  • Save Your Codeplex Repository Credentials

    I recently setup my first project ever in CodePlex and naturally I am very excited about its tight integration with TFS since my group uses TFS internally for source control as well.  Connecting to CodePlex through the Visual Studio Team Explorer is very easy, you just use one of the tfs0x.codeplex.com servers as your target, and then give them a variation of your username and password to connect. The prompt for your password will come up every time you open VS, and there is no option to save your credentials.  I like security as much as the next guy, but after a while this becomes tedious and it was proving to be a stumbling block to adoption among some team members. How To Store Your Credentials The solution I came up with was to...


  • Visual Studio 2008 with TFS Explorer broken with SP1

    When working in on a fresh Visual Studio 2008 SP1 install I needed to use TFS (as always) so I installed the TFS Team Explorer client from the TFS disk and I kept getting the following error whenever trying to view/edit Work Items: Could not load type 'Microsoft.TeamFoundaton.WorkItemTracking.Client.WorkItemTypeDeniedOrNotExistException' from assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client, Version=9.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. After trying several fixes on different boxes, I think it is really a simple versioning problem, where VS SP1 upgrades some TFS dlls and then the old TFS client get installed and can’t load the correct dlls. I have not tested this, but I bet if you install TFS Team...


  • Base Class Object Equality for NHibernate Objects

    In any project where you use an ORM you often have all of your domain classes inherit from a common base class.  Among other things, your base class often contains your identity property.  Mine has a protected IdT (this is the Id type) field called id, and a public getter called ID. 1: protected IdT id; 2:   3: public virtual IdT ID 4: { 5: get { return id; } 6: } One important and complex question is how to handle equality of two domain objects.  This becomes very important for caching, using HashSets, and more. Before I share my solution I will mention that there are many implementations of base class equality out there, with S#arp Architecture’s standing out in my mind as a great though complex (maybe enterprise-level...


  • A UrlHelper Extension For Creating Absolute Action Paths in ASP.NET MVC

    ASP.NET MVC comes with a UrlHelper class in the System.Web.Mvc.Controller.Url namespace, which you can access through the Url property of any controller.  This provides some handy methods to get the url of an action or route, among other things.  For example, Url.Action(“About”, “Home”) will return the string “/Home/About”, which is the relative url of the About action on the Home controller. I recently had a need to generate an absolute Url (to put in an email), so I wrote a quick extension method to the UrlHelper class that I thought might be useful to someone else.  The code is as follows: 1: public static class UrlExtensions 2: { 3: public static string AbsoluteAction( this UrlHelper url, string action, string controller,...


  • Please help Microsoft in the effort to address the challenge of H1N1 in Schools

    Office Live Workspaces helped students continue their schoolwork while they stayed home during an outbreak of the swine flu. Address the classroom challenge of H1N1 If the H1N1 flu virus keeps your students away from the classroom, continue the learning online by using Office Live Workspace to: share assignments distribute handouts post presentations enable group collaboration Use this free online service to publish and share Microsoft Office Word documents, Office Excel spreadsheets, and PowerPoint...( read more ) Read More...


Page 1 of 13 (125 items) 1 2 3 4 5 Next > ... Last »
Microsoft Communities