Click here to Skip to main content
Licence 
First Posted 23 Oct 2002
Views 144,140
Downloads 2,867
Bookmarked 78 times

CodeBank - A small centralized code repository built using the .NET framework.

By Paul Ford | 20 Apr 2003
A .NET web based code repository for storing, searching, browsing and administering categorized projects.
4 votes, 33.3%
1
1 vote, 8.3%
2
2 votes, 16.7%
3
3 votes, 25.0%
4
2 votes, 16.7%
5
2.73/5 - 12 votes
μ 2.83, σa 2.83 [?]

Introduction

After first discovering CodeProject and using it, I was yet again amazed at the value that such sites provide developers. Reviewing the site and its features reminded me of all the times I had wished that I had not made personal code folders. When we all do this, teams of developers seem to write duplicate versions of code, whether it be a string splitter or something much more complicated. Being a beginner to .NET development, I decided to write a simple code repository and host it on the my website, so that I can paste my code snippets in a location that I can always gain access to, and so CodeBank was born.

Configuration

First we need to ensure your machine meets the following prerequisites:

  • IIS is installed
  • SQL Server 2000 is installed
  • The .NET framework is installed
  • Any patches are installed with respect to the above 3 items.

Note that if you installed Visual Studio in order to debug on this machine, and the machine is a PDC (Domain Server) you will not be able to use the interactive debugging. Microsoft disabled this feature for security reasons.

When you have downloaded the zip file to a temporary location, you should have a directory labeled codebank. Please follow the tasks in order for the site to be operational.

  • Copy the CodeBank directory to your root web directory. e.g. d:\inetpub\wwwroot\codebank.
  • Create an IIS virtual directory for the following:
    • Codebank - virtual directory for CodeBank.
    • ProjectCaseStudies - virtual directory where case studies are uploaded for each project you create.
    • ProjectUploads - virtual directory where code files are uploaded for each project you create.
  • Ensure that IIS and ASPNET users have access to be able to write to projectcasestudies and projectuploads.
  • Set these shares to Everyone initially. When the application uploads correctly, you can adjust the security accordingly.
  • Start up SQL Server 2000 Enterprise manager and create a blank database named codebank
  • Right click the newly created database codebank and select to restore a database from backup.
  • Navigate to the codebank\sql directory and select the file named codebank.bak.
  • Click OK to restore
  • Navigate to the Web.Config file located in the root of codebank directory and make the appropriate changes to the <APPSETTINGS> entries

Web.config

In adherence with good coding standards, Microsoft recommends placing custom settings in the web.config file. I felt it was a relevant place for the database and other web settings. Please ensure that you change these according to your database username, password and respective file paths.

appSettings
  add key="CONNECTION_STRING" 
    value="server=servername or ip address;database=codebank;
                 user id=your username;password=your password" 
  add key="FILE_PATH" 
    value="x:\your web directory path\codebank\projectuploads\" 
  add key="FILE_VIRTUAL_DIRECTORY" 
    value="http://<your domain or machine name>/codebank/projectuploads/" 
  add key="CASE_PATH" 
     value="x:\<your web directory path>\codebank\projectcasestudies\" 
  add key="CASE_VIRTUAL_DIRECTORY" 
    value="http://<your domain or machine name>/codebank/projectcasestudies/" 
appSettings

Thanks

I would like to mention a thanks to CodeProject for inspiration and special thanks to my former colleague James Coleman for his direction.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Paul Ford

Web Developer

United States United States

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralNeed the binary! PinmemberJanaka Fernando2:32 6 Sep '04  
GeneralASP.NET - Parser Error Pinsussv_ganeshraju12:01 11 May '04  
GeneralParser Error PinsussMahesh Varma1:59 3 Nov '03  
GeneralInstall problems Pinmemberaguaybana13:52 11 May '03  
GeneralParser Error. Pinmembere1design21:50 8 Apr '03  
GeneralRe: Parser Error. PinmemberPaul Ford18:58 21 Apr '03  
QuestionMIssing File? Pinmemberrab34110:26 3 Mar '03  
AnswerRe: MIssing File? Pinmemberresolvo6:05 9 May '03  
GeneralWeb.config Suggestion PinmemberHeath Stewart4:38 10 Jan '03  
Generalurgent........ Pinsussnewb12:55 7 Jan '03  
GeneralRe: urgent........ PinsussAnonymous20:27 7 Jan '03  
GeneralRe: urgent........ PinsussPaul W Ford20:30 7 Jan '03  
GeneralRe: urgent........ PinsussAnonymous12:52 10 Jan '03  
GeneralNice work, needs an installer :) PinsussSteve Cox9:19 25 Oct '02  
GeneralArticle PinmemberPaul Ingles0:05 25 Oct '02  
GeneralRe: Article PinmemberJason McBurney13:47 23 Apr '03  

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.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120209.1 | Last Updated 21 Apr 2003
Article Copyright 2002 by Paul Ford
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid