Skip to content

Instantly share code, notes, and snippets.

@TimMurphy
Forked from davidfowl/dotnetlayout.md
Last active May 19, 2016 11:58
Show Gist options
  • Save TimMurphy/e4237a9c3a135d18cd57 to your computer and use it in GitHub Desktop.
Save TimMurphy/e4237a9c3a135d18cd57 to your computer and use it in GitHub Desktop.

To follow is my standard layout for .NET projects. It is a modification of David Fowler's dotnetlayout.md gist

$/
  artifacts/
  build/
  dependencies/
  docs/
  packages/
  samples/
  scripts/
  source/
  tests/
  .gitignore
  .gitattributes
  {solution}.sln
  build.cmd
  LICENSE.txt
  NuGet.config
  README.md

All folders are optional but most will be used.

  • artifacts - Build outputs go here. Doing a build.cmd generates artifacts here (nupkgs, dlls, pdbs, etc.)
  • build - Build customizations (custom msbuild files/psake/fake/albacore/etc) scripts
  • dependencies - Things that can NEVER exist in a nuget package or downloaded by script.
  • docs - Documentation stuff, markdown files, help files etc.
  • packages - NuGet packages
  • samples - Sample projects.
  • scripts - Scripts for the solution that are not directly related to the build. e.g. DeleteFilesNotUnderSourceControl.bat.
  • source - Main projects
  • tests - Test projects
  • build.cmd - Bootstrap the build for windows

.gitignore

########################
# Operating System
########################

*DS_Store
thumbs.db

########################
# Visual Studio
########################

.vs/
[Aa]rtifacts/
[Bb]in/
[Oo]bj/
[Pp]ackages/

*.cache
*.feature.cs
*.user
*.suo

########################
# Solution specific
########################

Visual Studio Solution Layout

THIS IS A WORK IN PROGRESS

To follow is my standard layout for Visual Studio Solution.

Solution
    \apps
        {app}.ConsoleApplication
        {app}.WebApplication
        {app}.WebApiApplication
        {app}.WPFApplication
    \samples
    \src
        {app}.API
        {app}.BLL
        {app}.DAL
        {app}.Library
    \tests
        {app}.Console.Specifications
        {app}.MVC.Specifications
        {app}.WebApi.Specifications
        {app}.WPF.Specifications
    \Solution Items (todo: rename)
  • {app}.Library potentially shared with all projects.
@dmitry-ra
Copy link

What a namespace do you use in {app}.Console project?
Namespace "app.Console" (as a project name) will interfere with Console class.

@TimMurphy
Copy link
Author

@dmitry excuse the late reply. I did get a notification of your comment.

You are right - updated appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment