Dec2008
8

Visual Studio Add-in - RockScroll

by nmgomes

A few months ago Scott Hanselman bring to all community fellows a new Visual Studio add-in called RockScroll.

RockScroll was an internal tool from Microsoft but Scott convinced Microsoft to allow him to make it available to community as a "Works on my machine" tool. This means that RockScroll is released with exactly zero warranty or support.

But what does this tool anyway? Simply replace the default vertical scrollbar  with an improved one where the background is the thumbnail of the current code file.

Well, better take a look.

rockscroll

As you can see this add-in let you know where you are editing in a more accurate way and, beside this, you can also easily locate comment lines, breakpoints and changed lines.

The only point I dislike is related to regions. Since the thumbnail is generated based on the file content, if you have collapsed regions you will find difficult to scroll exactly where you want.

You can use it in both in Visual Studio 2005 and Visual Studio 2008. The Visual Studio 2010 will be shipped with a similar scrollbar(probably an improved version of RockScroll).

I've been using it in VS 2005 since was made available and I can say I didn't notice any related problem or performance hit.

You can get it here. Go try it now.

I made this post draft in September and forgot to publish it. Since then I redirect all colleagues and friends that notice I was using this add-in to this blog. Only a few days ago I notice the post wasn't there so, to them, my apologies.

Filed in: Tools

Nov2008
16

DreamSpark

by nmgomes

"DreamSpark is simple, it's all about giving students Microsoft professional-level developer and design tools at no charge so you can chase your dreams and create the next big breakthrough in technology - or just get a head start on your career"

I dont know since when DreamSpark is available but this is another great Microsoft program.

So, if you are a student no more excuses are allowed. To learn better and faster, simply use the RampUp MSDN program and download all required software from DreamSpark.

Filed in: General

Nov2008
16

Tech'Ed EMEA 2009

by nmgomes

Tech'Ed 2008 its over but the next year event is already schedule to 2-6 November 2009.

Next year event will change its location to Messe Berlin, Germany.

Who knows if I'll be there too ... ;-)

Filed in: TechEd

Nov2008
5

Tech·Ed EMEA 2008 Developers: Meet Me In Barcelona

by nmgomes

For the first time I'll be there ... nice.

Filed in: Events | TechEd

Nov2008
4

To yield or not yield

by nmgomes

Some time ago, Chris Massey challenged everyone to discuss about four interesting .NET performance questions. One of those questions was "When processing some data into a list, is it faster to build up a collection and return it as an enumerator, or use yield to create the enumerator 'on the fly'?".

Well, I also post a little contribution and surprisingly my post was one of the winners, so I won a free license to ANTS Profiler 4.

Filed in: .NET

Aug2008
25

ASP.NET Health Monitoring - Building an EventLogWebEventProvider - Part 3

by nmgomes

On my previous posts on this health monitoring series I explain to you how and why I made my own EventLogWebEventProvider and which benefits you can achieve by using this provider or by making your own.

Now I'll write about how to use this new provider in one application.

Well, almost everything have been written about this topic and Microsoft has one good article on "How To: Use Health Monitoring in ASP.NET 2.0" so I wont even try to explain all the possible scenarios and configurations, I will simply explain the standard scenario.

Typically I simply want to keep track on two Web Event types:

  1. the ones related to application errors
  2. an the others related to application life cycle

As far as I notice there are many people that simply track those from point 1.

Another decision to make is where to store these Web Events data, You do this by choosing a Web Event provider.

ASP.NET give us out-of-the-box several providers and you can make your own provider. Once your provider is done you can use it just like all the others.

In this example I will use the newly created provider.

Now that I know exactly what to track and where to store it I can update my configuration.

All health monitoring configuration data is stored in the system.web\healthMonitoring section and my standard configuration will look like:

<healthMonitoring enabled="true">
  <providers>
    <add name="ExtendedEventLogWebEventProvider" type="NG.Web.Management.EventLogWebEventProvider, NG.Web" source="MyEvtLogSource" />
  </providers>
  <rules>
    <clear />
    <add name="Application Lifetime Events Default" eventName="Application Lifetime Events" provider="ExtendedEventLogWebEventProvider" profile="Default" />
    <add name="All Errors Default" eventName="All Errors" provider="ExtendedEventLogWebEventProvider" profile="Default" />
  </rules>
</healthMonitoring>

Notice the source attribute from the ExtendedEventLogWebEventProvider, using it you can set which EventLog source to use.

Remember that when you create a EventLog source you can choose to create a brand new EventLog and if you choose so, all entries written by this provider in this application context will be isolated from all the others providing one easy way for visual tracking and filtering.

With the health monitoring data in place you should now be able to see the entries appearing in EventLog.

Filed in: ASP.NET

Aug2008
24

ASP.NET Health Monitoring - Building an EventLogWebEventProvider - Part 2

by nmgomes

In the first post of this series I've manage to find the correct eventId for each Web Event type, and by this time the major problem has been solved, but I cannot yet write a correct entry into the EventLog.

I still have to decided the best severity type and category to apply.

Severity

If you look at entries in the EventLog generated by the default EventLogWebEventProvider you will find that they are marked mainly as Information and a few of them are also marked as Warning but no one is ever marked as Error.

Since I'm making my own provider I will take this chance to map the EventLog entry severity type according to the source Web Event.More...

Filed in: ASP.NET

Aug2008
18

SQL Server - Undocumented Stored Procedure sp_MSforeachtable

by nmgomes

I'm not an every day SQL Server user but I use SQL Server regularly since 7.0 version until the 2005 version (not yet tried 2008 in a serious way) and from time to time I still find some nice hidden gems.

A few days ago I needed to created a cleanup script for an application and one of the tasks was to drop all tables that match a specific name pattern.

My first thought was to use a cursor to loop or a dynamic SQL statement ...

... but this time I decided to google for some other approach, and I found the amazing undocumented sp_MSforeachtable stored procedure from the master database.

It does the same but it requires considerably less code and improves the script readability.

Below is the syntax for calling the sp_MSforeachtable SP: More...

Filed in: MS SQL