Updating Visual Studio 2015 CTP to the latest code bits – Part 2

For this post we will build a very basic ASP.NET MVC app using all the latest code and runtime from the beta3 nightly builds.

We continue on from the post Updating Visual Studio 2015 CTP to the latest code bits – Part 1.

Create an ASP.NET project called “TodoWeb” using the Empty template.

emptyproject

 

We will add just enough to get an MVC app running.

Let’s select the beta3 runtime before we forget.

selectkre

 

Add a Controllers directory to the project and update the project.json file like here:

"dependencies": {
  "Microsoft.AspNet.Server.IIS": "1.0.0-beta3-10905",
  "Microsoft.AspNet.Mvc": "6.0.0-beta3-12423"
},
"frameworks" : {
  // "aspnet50" : { },
  "aspnetcore50" : { }
}

Note we have two NuGet packages from the beta3 nightly build, that’s it. Also, I’m not relying on the full framework as it is commented out.

In our Startup class make sure  we have :

public void ConfigureServices(IServiceCollection services)
{
  services.AddMvc();
}

public void Configure(IApplicationBuilder app)
{
  app.UseMvc();
}

Add a using Microsoft.Framework.DependencyInjection directive to the Startup.cs file

 

ctrl-shift-A and add an MVC Controller to the the Controllers directory.

addcontroller

 

Now create a Views directory and add a Home sub-directory to that.

ctrl-shift-A and add an MVC View to the the \Views\Home directory.

Replace the contents of the Index.cshtml file with the following.
todoViewNotice the small amount of package dependencies we have apart from the runtime.dependancies

You should be able to build and run the app.

Looking at the output window you can see we are running beta3 versions of the runtime and packages. You can also see native assemblies being loaded.

debugoutput

In future posts we’ll add to this very basic ASP.NET MVC application.