Published on

Steps in creating a new MVC application

Authors
  • avatar
    Name
    Mike Barram
    Twitter
  • Create the database
  • Create the project/solution in Visual Studio
    • don’t give the project the same name (in the same case) as one of the tables or the compiler will become confused between types and namespaces
    • choose MVC and optionally Web API and unit tests
    • leave authentication as Individual User Accounts
  • Create an application in IIS that points to the project
  • Change the Web properties for the project to use Local IIS
  • Update all Nuget packages in all projects in the solution
  • Add the CAS Nuget package
  • Web.config
    • Add <pages controlRenderingCompatibilityVersion=”4.0″ /> to System.Web
  • Add Nuget TinyMCE.JQuery
  • Add favicon.ico to root
  • Add logo.png and user.png to Content (remember to include them in the project)
  • Update Content\site.css from an application that the new project should look like
  • Create your data model
    • Don’t copy the connection string from another project as that will contain the details of the model in that project. Instead, create a new connection string for your model (you can copy the details of the server from an old connection string)
    • When editing the entity model diagram, you can change the Entity Container Name to something more friendly and that will change the name of the connection string in the web.config
    • If a connection string called “DefaultConnection” has been created in the web.config, you will want to update Models\IdentityModels.cs to use your main connection string instead of that one – this will be the connection string that you have just set the name of in the step above.
  • Start creating controllers and views…
  • Auditing – if you want to automatically set the values in certain fields if they have set names (e.g. createddate):