Browse by Tags
All Tags »
TipsAndTricks (
RSS)
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...
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...
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...
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...
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...
Filed under: ASP.NET, Web, VisualStudio, Windows, WindowsVista, VisualStudio2008, Windows7, VisualStudio2010, TipsAndTricks, VisualStudio2005, CodeProject
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...
Using Visual Studio macros to change the current project as the startup project and start it.
...
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...
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...
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...
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...
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...
Filed under: .NET, C#, Microsoft, MSDN, VisualStudio, Testing, LINQ, VisualStudio2008, VisualStudio2010, TipsAndTricks, .NET2.0, .NET3.5, .NET4.0
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...
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...
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...
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...
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...
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...