Although not necessary for the development environment, I’d like to convey a few coding conventions
which are used throughout S#arp Architecture, the sample project, the Visual Studio project template and the CRUD scaffolding generator (which is completely customizable). The coding style and conventions generally follow the guidelines described by Brad Abrams at
http://blogs.msdn.com/brada/articles/361363.aspx, particularly when it comes to the use of PascalCasing and camelCasing for naming conventions. E.g.,
member variables are camelCase with no leading "_" and methods, properties and classes are PascalCase. The conventions for braces are described as follows in the VS settings.
Optionally, if you’d like to set your VS development environment to reflect some of the coding
style within S#arp Architecture code,
- Within VS 2008, set auto-formatting options appropriately:
- Go to Tools / Options and check "Show all settings"
- Expand Text Editor / C# / Formatting / New Lines and uncheck the following:
- Place open brace on new line for methods
- ...for anonymous methods
- ...for control blocks
- ...for anonymous types
- ...for object initializers
- ...for lambda expressions
- Expand Text Editor / HTML:
- Under Validation, set target to "XHTML 1.1"
- Under Miscellaneous:
- Uncheck "Auto ID elements on paste in Source view"
- Check "Format HTML on paste"
Installing and Configuring Prerequisites
- Install NUnit 2.5 for .NET 2.0; the installer can be found at /tools/NUnit 2.5.0.9222.msi
- The CRUD scaffolding generator that S#arp Architecture includes uses T4Toolbox 10.3, available from http://www.codeplex.com/t4toolboxhttp://www.codeplex.com/t4toolbox or conveniently located in the S#arp Architecture release as /tools/T4 Toolbox T4Toolbox.msi.
- Install the Visual Studio S#arp Architecture Project Template following the guidelines in the section entitled S#arp Architecture Project Template for Visual Studio 2008.
- Optionally install http://ASP.NET MVC 2.0. Note that this does not need be installed on production environments.
- Finally, if you’re interested in looking at the S#arp Architecture source code, you’ll need to run go.bat, found in the root of the download directory. This adds a required CommonAssemblyInfo.cs to the appropriate location for the S#arp Architecture codebase.
Configuring IIS 7 for ASP.NET MVC
The easiest way to configure IIS 7 for the ASP.NET MVC sample project is to modify IIS 7 to behave in classic mode for the configured virtual directory. To do so, make sure your virtual directory has been given an application name (assuming it’s not a root website), then set the application pool for it to the “classic mode” application pool.
Configuring IIS 6 for ASP.NET MVC
In contrast to earlier versions of ASP.NET MVC, it’s not trivially simple to configure IIS 6 to work nicely with the beta release and later. If you’re developing on Windows XP, it’s easiest to develop and test code via F5 debugging rather than trying to hack IIS 5.1 or 6.0 to run it in an XP development env’t. If you do need to host your ASP.NET MVC site on IIS 6.0, Phil Haack has a great tutorial at
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx.