Useful tips from this week's reading

by Jason Haley 15. July 2007 04:32

Lately I've been reading John Robbins' Debugging Microsoft .Net 2.0 Applications, and have started to put a list of tips together that I don't want to forget ... Some of these things, I've heard but forgotten and some things I just haven't gotten to until yesterday (ie. Ghostdoc).

Setting a shortcut to run with different credentials (works with .lnk files)

I've been meaning to look this tip up for a while now, due to the multiple service accounts and databases I use at work.  I believe I first heard it from Robert Hurlbut at Code Camp in his Develop as Non Admin chalk talk 2 or 3 years ago...

  1. Create the shortcut (right click and choose create shortcut)
  2. Right click on the short cut and choose the Shortcut tab
  3. Click the Advanced button
  4. Check the 'Run with different credentials'

Shortcut

NOTE: the 'Run with different credentials' check box will not be enabled on a normal user's desktop, so you might want to create a common directory for shortcuts that is available to all users.

How to find the hidden 'Run as' on control panel items

I found this tip really cool, because I find myself using either the MakeMeAdmin script or logging in as an administrator just to do something in the control panel.

  1. While logged in as a regular user, go to the control panel
  2. Hold down the shift key and right click on any item, the 'Run as..' option will now show

Control Panel RunAs

Setting windows explorer to launch folder windows in separate process

I'm hoping this tip will help me at work (where I have several shell plug-ins and we use TortoiseCvs) when some times a simple file delete causes windows explorer take the rest of the day off deleting that file ... or until I kill explorer.exe - which then causes the desktop and my quick launch menu's to get reset onto my primary monitor ...

  1. In windows explorer, go to Tools menu and choose Folder Options ...
  2. On the View tab, in the Advanced settings listing, make sure the 'Launch folder windows in a separate process' is checked

Download and use Roland Weigelt's GhostDoc for a quick start on your commenting

My commenting can some times use a little help ... especially if it is pretty clear what the method does, like the property shown below ... so in order to help at least create a simple comment I can now use GhostDoc - that way intellisense  has something to work with at least :)  It is also super easy to use - just right click and choose 'Document this'

GhostDoc

Here is a before and after ... just from a right click !!!

Before:

public new bool UseDefaultCredentials

{

    get

    {

        return base.UseDefaultCredentials;

    }

    set

    {

        base.UseDefaultCredentials = value;

        this.useDefaultCredentialsSetExplicitly = true;

    }

}

After:

/// <summary>
///
Gets or sets a value that indicates whether to set the <see cref="P:System.Web.Services.Protocols.WebClientProtocol.Credentials"></see> property to the value of the <see cref="P:System.Net.CredentialCache.DefaultCredentials"></see> property.
/// </summary>
///
<value></value>
///
<returns>true if the Credentials property is set to the value of the <see cref="P:System.Net.CredentialCache.DefaultCredentials"></see> property.</returns>
public new bool UseDefaultCredentials

...

Comments (0) | Post RSSRSS comment feed |

Categories:
Tags:

Comments are closed