Click here to Skip to main content
Click here to Skip to main content

C# Wizard Templates Integrated with SourceSafe

, 14 Aug 2005
Rate this:
Please Sign up or sign in to vote.
I was looking for some solution that may be helpful in creating Code Templates to be used across the development team(s) and that can also maintain the versioning/revision history as well as provide integration with SourceSafe.

Introduction

I was looking for some solution that may be helpful in creating Code Templates to be used across the development team(s) and that can also maintain the versioning/revision history as well as provide integration with SourceSafe.

Background

After surfing The Code Project, I found Building VS .NET Wizards - Part 1 by Michael Groeger (thanks); this article helped me reach the solution for creating the templates. Still the idea was not complete. As I mentioned earlier, I wanted the solution to be integrated with SourceSafe to maintain versioning/revisions. I have gone through MSDN and found the working of SourceSafe with code and hence the Wizard Templates are attached.

Using the Code

The usage of these templates is really very easy and the two steps work as follows:

  1. Simply backup your folders from <VisualStudioDir>\VC#\VC#Wizards
  2. Copy the New Wizard folders to the above mentioned folder

You are done.

Open Visual Studio .NET 2003 and use any of the following Wizards; you will see the difference.

  • CSharpAddClassWiz
  • CSharpAddReportWebServiceWiz
  • CSharpAddUserControlWiz
  • CSharpAddWebFormWiz
  • CSharpAddWebServiceWiz
  • CSharpAddWinFormWiz
  • CSharpAddWinServiceWiz
  • CSharpClassWiz
  • CSharpConsoleWiz
  • CSharpWebServiceWiz
  • CSharpWindowsServiceWiz

SourceSafe Integration

For SourceSafe configuration, follow the steps mentioned below.

You need to have SourceSafe configured at some machine accessible from your development machine. Use this article from the Microsoft Web site to learn more about how to configure SourceSafe to work with Versioning your code file.

Keyword Expansion

To integrate VSS with Visual Studio, you need to use Keyword Expansion. Keyword Expansion refers to the ability VSS has to replace certain sections of files with information relevant to the file such as the last time it was modified, who modified it or the date and time the last check in operation occurred. Typically, you will want to place the keywords in commented sections of code at the top of your source files so they do not affect compilation. Here is a quick table of all the VSS keywords and what information they provide.

Note: Keywords are case-sensitive, so be sure to capitalize them properly.

Keyword Information Provided
$Archive: $ VSS archive file location
$Author: $ User who last changed the file
$Date: $ Date and time of last check in
$Header: $ Logfile, Revision, Date, Author
$History: $ File history, VSS format
$JustDate: $ Date, without the time addendum
$Log: $ File history, RCS format
$Logfile: $ Same as Archive
$Modtime: $ Date and time of last modification
$Revision: $ VSS version number
$Workfile: $ File name
$NoKeywords: $ No keyword expansion for all keywords that follow

VSS will add comments to your code at check in time if configured to do so in srcsafe.ini. This is useful because it shows a nice file history right in the file header and, if the comments are added during check in, describes the nature of each change.

Now to provide this functionality, you need to add the following lines to srcsafe.ini. (Please note that this file is located at the server where SourceSafe is configured.)

Keyword_Masks = *.cs, *.htm, *.html, *.aspx, *.ascx
;updates keywords in a user's working directory with the new keyword information
;when a user updates or checks in a file.
Expand_Keywords_Locally = YES

[Keyword Comments]
*.cs = " /// "
*.aspx = " -- "
*.ascx = " -- " 

Now, you are done with SourceSafe integration.

History

I wanted to create an MSI to install this but could not spare time for this. Please provide me feedback after using the templates. Remember you can always modify the contents of the files as per your needs. Just a simple mail letting me know about you and your experience will be appreciated.

You can also discuss the article here.

History

  • 14th August, 2005: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Muneeb R. Baig
Chief Technology Officer
Pakistan Pakistan
Just learning.
http://about.me/muneebrbaig
Follow on   Twitter   LinkedIn

Comments and Discussions

 
GeneralMRB Prefix PinmemberNTulip15-Aug-05 1:52 
GeneralRe: MRB Prefix PinmemberMuneeb-ur-Rehman Baig15-Aug-05 2:14 
GeneralRe: MRB Prefix PinmemberNTulip15-Aug-05 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 14 Aug 2005
Article Copyright 2005 by Muneeb R. Baig
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid