Click here to Skip to main content
15,891,905 members
Articles / Web Development / ASP.NET
Article

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

Rate me:
Please Sign up or sign in to vote.
2.83/5 (12 votes)
20 Apr 20032 min read 165.8K   3K   80   16
A .NET web based code repository for storing, searching, browsing and administering categorized projects.

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.

XML
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


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralNeed the binary! Pin
Janaka Fernando6-Sep-04 1:32
Janaka Fernando6-Sep-04 1:32 
GeneralASP.NET - Parser Error Pin
v_ganeshraju11-May-04 11:01
v_ganeshraju11-May-04 11:01 
GeneralParser Error Pin
Mahesh Varma3-Nov-03 0:59
Mahesh Varma3-Nov-03 0:59 
GeneralInstall problems Pin
aguaybana11-May-03 12:52
aguaybana11-May-03 12:52 
GeneralParser Error. Pin
e1design8-Apr-03 20:50
e1design8-Apr-03 20:50 
GeneralRe: Parser Error. Pin
Paul Ford21-Apr-03 17:58
Paul Ford21-Apr-03 17:58 
QuestionMIssing File? Pin
rab3413-Mar-03 9:26
rab3413-Mar-03 9:26 
AnswerRe: MIssing File? Pin
resolvo9-May-03 5:05
resolvo9-May-03 5:05 
GeneralWeb.config Suggestion Pin
Heath Stewart10-Jan-03 3:38
protectorHeath Stewart10-Jan-03 3:38 
Generalurgent........ Pin
newb7-Jan-03 11:55
newb7-Jan-03 11:55 
GeneralRe: urgent........ Pin
Anonymous7-Jan-03 19:27
Anonymous7-Jan-03 19:27 
GeneralRe: urgent........ Pin
Paul W Ford7-Jan-03 19:30
sussPaul W Ford7-Jan-03 19:30 
GeneralRe: urgent........ Pin
Anonymous10-Jan-03 11:52
Anonymous10-Jan-03 11:52 
GeneralNice work, needs an installer :) Pin
Steve Cox25-Oct-02 8:19
Steve Cox25-Oct-02 8:19 
GeneralArticle Pin
Paul Ingles24-Oct-02 23:05
Paul Ingles24-Oct-02 23:05 
GeneralRe: Article Pin
Jason McBurney23-Apr-03 12:47
Jason McBurney23-Apr-03 12:47 

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

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