Visual Studio

XML Comments

by Warlock on Nov.24, 2009, under .NET, C#, Visual Studio

Today I was looking for a reference for the proper notation for the cref attribute of the <see cref="..."> C# XML comment tag, and after finding it, I thought I’d post it here for future reference.

The cref (code reference) tag is prefaced by a single character, then a colon, followed by the reference in question. The character defines what is being referenced, as defined by the table below.

Character Description
N Namespace
T Type (class, interface, struct, enum, delegate)
F Field (member variable, constant, etc)
P Property (including indexers and indexed properties)
M Method (including special methods like constructors – #ctor – operators, etc)
E Event
! Error string

The full reference for the prefixes is available here, with the full XML comment documentation available here. The Code Project also has an article on the topic.

1 Comment :, , , more...

Visual Studio 2003 Web Projects Not Loading?

by Warlock on Apr.03, 2008, under .NET, Visual Studio

Took me a while to find a solution to this problem.

I checked out a project from Visual Source Safe (using the VS2005 client) to my local drive and tried to open the solution.  The solution contained several projects, two of which were web projects.  I had previously checked out the project to this computer, and IIS had virtual directories mapped to the old location.  I changed the target of the virtual directories to my newly checked out location and figured that everything would be OK.  No dice.

The problem was that Visual Studio claimed it couldn’t find the project files.  The virtual directories were mapped correctly.  Directory permissions were OK.  Crazy.

After searching the web for a while I was able to locate something that works.  To resolve the problem do the following:

  1. Check out the project from source control (get latest).
  2. Map virtual directories to correct locations.
  3. Delete the project files for the web projects on the local computer (the .csproj and the .vspscc files for a C# web project).
  4. Delete the solution preferences files (the .suo file).  This only exists if you have previously tried to open the project locally.
  5. Launch Visual Studio and open the project.

Not exactly the most straight forward workaround.  But is seems to work.  Thankfully things seem a bit better in Visual Studio 2005.If I run into this problem again, I’ll record more specific error messages so Google will help locate the solution.  I’ll also try to get some screenshots.

Leave a Comment more...

A Back button for code navigation

by Warlock on Jul.30, 2007, under Visual Studio

If you’re using Visual Studio 2005, you’ve probably already fallen in love with its language-aware features, such as the rename feature (allowing you to rename a variable/method/etc and update all references to it) or find all references, that lists all places in the code that reference a variable/method/etc.

One of my favorite features is the “Go To Definition” option, which will take you to where a method/variable/enum/etc is defined.  It’s really useful when you’re exploring a codebase.  The problem is, oftentimes you’ll go to a definition, figure out what you need to, and then want to go back to where you were before.  What you need is a back button, much like in a web browser.  It took a little searching, but I finally found just such a feature.  Just press ctrl+- (control and the minus key).  This will navigate back in the code, just like a back button.  One thing to be aware of is that this only works when  you use the minus located to the right of the 0 (zero) key (in the main part of the keyboard).  Using the minus in the num pad won’t work.  Jumping around like this saves a bunch of time.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...