Paulo Morgado

.NET Development & Architecture

This Blog

Syndication

Search

Tags

News

Unit Test Today! Get Typemock Isolator!

Projects

Books

 

Visitors

Visitor Locations

Community

Email Notifications

Archives

Profile

Disclaimer

The opinions and viewpoints expressed in this site are mine and do not necessarily reflect those of Microsoft, my employer or any community that I belong to. Any code or opinions are offered as is. Products or services mentioned are purchased by me, made available to me by my employer or the manufacturer/vendor which doesn't influence my opinion in any way.

Browse by Tags

All Tags » TipsAndTricks (RSS)
O Estranho Caso Do Computador Que Acordava Sozinho Misteriosamente
Normalmente, quando eu vou dormir, também ponho o meu computador a dormir. Mas, desde há alguns meses, o computador acordava sozinho e eu não conseguia percber porquê. Com a ajuda do Pete consegui perceber porquê: C:\>PowerCfg -LASTWAKE Wake History...

Posted Tue, Jul 20 2010 23:56 by Paulo Morgado | 1 comment(s)

The Strange Case Of The Mysterious Self Awaking Computer
Usually, when I go to sleep, I also put my desktop computer to sleep. But, for the last couple of months, the computer would always wake up by itself and I couldn’t figure out why. With the help of Pete I was able to find out: C:\>PowerCfg -LASTWAKE...

Posted Tue, Jul 20 2010 23:56 by Paulo Morgado | with no comments

How To Add And Remove SQL Server 2008 / 2008R2 Instances
After installing Visual Studio 2010 I, inadvertently ended up with SQL Server 2008 Express having already installed SQL Server 2008 Developer . Only when I was going to upgrade to SQL Server 2008R2 I found out I had two instances installed. I looked everywhere...

Posted Fri, Jul 2 2010 1:18 by Paulo Morgado | 40 comment(s)

Fixing Windows Virtual PC Missing “Create Virtual Machine” Folder Option
Some of my Windows 7 systems, after installing Windows Virtual PC , were missing the Create virtual machine option. Bob Comer directed me to this post from the Virtual PC Guy's Blog but, before trying the recipes in the post (which involved logging...

Posted Sun, Jun 20 2010 18:54 by Paulo Morgado | 1 comment(s)

Is Your ASP.NET Development Server Not Working?
Since Visual Studio 2005 , Visual Studio comes with a development web server: the ASP.NET Development Server . I’ve been using this web server for simple test projects since than with Visual Studio 2005 and Visual Studio 2008 in Windows XP Professional...

Posted Tue, Jun 15 2010 1:31 by Paulo Morgado | 3 comment(s)

Detecting User Regional Settings In The Web Browser
Recently, a friend of mine asked me something like: “How do I get the user’s regional settings for a request to a web server?” As far as I know, web browser only send an Accept-Language HTTP header and nothing more. You can take this and use the default...

Posted Mon, May 10 2010 2:07 by Paulo Morgado | 2 comment(s)

Visual Studio: Setting Up The Current Project And Run

Using Visual Studio macros to change the current project as the startup project and start it.

...

Posted Sun, Mar 28 2010 21:35 by Paulo Morgado | with no comments

Web Site Globalization With ASP.NET Routing
For those who don’t know, I have this web site http://PauloMorgado.NET/ that I use both as a web presence besides my blogs and a playfield. Because I write both in English and Portuguese, I wanted the web site to have both English and Portuguese versions...

Posted Sun, Jan 31 2010 23:29 by Paulo Morgado | with no comments

Coupling ASP.NET Session State With Forms Authentication
Today I was talking with João about a way to couple the lifetime of the ASP.NET   session state with the lifetime of Forms Authentication ticket . My idea was to store the session ID in the UserData property of the forms authentication ticket upon...

Posted Thu, Jan 28 2010 1:18 by Paulo Morgado | with no comments

Playing With LINQ: Getting Interface Property Implementations
Today, my friend Nuno was writing some code to get the PropertyInfo s of a class implementation of an interface. Given this interface: public interface ISomeInterface { int IntProperty { get ; set ; } string StringProperty { get ; } void Method(); } and...

Posted Wed, Jan 27 2010 2:22 by Paulo Morgado | with no comments

A TraceListener For Tests
In my code, I make extensive use of debug assertions (see System.Diagnostics.Debug.Assert ). These assertions are very helpful while debugging because you don’t need to step into every line of code to see if all pre-conditions are met. As soon as a pre...

Posted Sun, Jan 24 2010 23:59 by Paulo Morgado | with no comments

How To Set Elements Of An Array Of A Private Type Using Visual Studio Shadows
Visual Studio uses Publicize to create accessors public for private members and types of a type. But when you try to set elements of a private array of elements of a private type, things get complicated. Imagine this hypothetic class to test: public static...

Posted Tue, Jan 19 2010 0:26 by Paulo Morgado | with no comments

LINQ To SQL Tips & Tricks: String Operations
LINQ brought developers a very user friendly and domain independent style of writing queries. The fact that the way queries are written is domain independent doesn’t mean that any query will compile the same way or even run the same way. You’ll always...

Posted Tue, Oct 13 2009 1:51 by Paulo Morgado | with no comments

Tip: Connecting To A Database Using Windows Authentication With Different Credentials Using SQL Server Management Studio
It is a good security practice to use Windows Authentication to connect to SQL Server because you don’t need to write the password on some configuration file or registry entry. This practice also brings governance benefits. Managing users becomes part...

Posted Mon, May 4 2009 0:34 by Paulo Morgado | 14 comment(s)

VS REGEX: Commenting Generated Assert Instructions
Visual Studio's Unit Test generator generates a call to Assert.Inconclusive but, usually generates a call to another method of the Assert class. I find that very annoying because, some times, this makes the test fail instead of being reported as inconclusive...

Posted Sun, Oct 7 2007 23:56 by Paulo Morgado | 2 comment(s)

VS REGEX: Joining Concatenated Strings
I don't like to see constant strings being concatenated in source code. I know the compiler compiles it into a single string, but I think it sends out the wrong message. However, code generators (like Visual Studio's Unit Test generator) usually...

Posted Sun, Oct 7 2007 23:52 by Paulo Morgado | with no comments

Visual Studio Find And Replace Regular Expression Patterns
Visual Studio comes with the a specific set of regular expressions can be used in the Find what field of the its Find and Replace Window . This page is about a few expressions I've been using over time. Find And Replace Patterns Joining Concatenated...

Posted Sun, Oct 7 2007 23:30 by Paulo Morgado | 5 comment(s)

Visual Studio Find And Replace Regular Expression Patterns
Visual Studio comes with the a specific set of regular expressions can be used in the Find what field of the its Find and Replace Window . Over the time I've been using Visual Studio I've come up with some tricky regular expressions that I'll...

Posted Sat, Sep 8 2007 18:26 by Paulo Morgado | 2 comment(s)