aspnet5

A 12-post collection

VSCode: Creating an Application with Yeoman aspnet generators

Getting Started Visual Studio Code Go get Visual Studio Code! http://code.visualstudio.com, the all new cross platform development tool from Microsoft. Runtime You'll need DNX, formerly known as K or KRE (K Runtime Environment). You can get the full instructions on the ASP.NET Github repo. If you have been running the K Runtime, you can uninstall if you deem necessary; however DNX can and will run side by side. On OSX, the install is simple with Homebrew $ brew tap aspnet/dnx $ brew update $ brew install dnvm This will install the toooling you need (dnx, dnu, dnvm) as well as mono 4.0.1. generator-aspnet If you are starting a new project, it is recommended starting with the...


Using Gulp for ASP.NET 5 & Visual Studio 2015

The default "ASP.NET 5 Preview Starter Web" template has everything you need out of the gate to get started on your next ASP.NET 5 project. On top of the responsive design, which has a new carousel control, it is also touch ready using hammer.js and is using grunt as the task runner. Another popular task runner is gulp.js, and in the next release there will be a default template provided. However, in the meantime as a part of the yeoman generator project I wanted to not only provide an equivalent for the grunt template, but also one that could be built upon. gruntfile.js First let's take a quick look at the grunt file module.exports...


ASP.NET 5 - wwwroot folder optional

Updated - 1.30.2014 After looking at the kpm pack or publishing step of this solution, there is an undesired affect. All of the folders in the root, now that this is the folder we are working in, will be published to the destination folders. Being approot & wwwroot (yes this is still created), this includes the bowercomponents, nodeemodules, your API code etc. Although IIS will keep you from browsing to the *.cs and other extensions for security sake, it is still not a clean solution. I have updated the dev branch of the git repository where wwwroot is put back in, and the gulpfile.js task called optimize now will publish the necessary files to this folder on...


Building Web API using MVC 6 & MongoDB

This is a quick walkthrough on using ASP.NET 5 to build a Web API layer using MongoDB. The overall concept is not too dissimilar from previous examples you may have seen using X type of database, however there are some areas covered that are either new in MVC 6 that you may find you didn't know are there. Topics Covered ConfigurationModel config.json Environment Variables OptionsModel Dependency Injection (IServiceCollection) Forcing JSON or Removing XML Formatter, Content Negotiation MongoDB Installation (OSX & Windows) mongocsharpdriver (nuget package) Testing endpoints w/ Postman or Fiddler Project Creation Depending on your environment (Windows or OS X) or preference you have a choice on how you can create the ASP.NET project. Visual Studio 2015...


Gulp Your TypeScript in ASP.NET 5

CodeProject If you have done any typescript development in Visual Studio in previous versions, you more than like are using the Web Essentials add in to perform the compilation to Javascript. Another option is to add a gulp task now that we have gulp and grunt support within Visual Studio. The other value add is if you are a non Visual Studio user this solution works just the same. Project Creation In Visual Studio 2015, File > New Project > ASP.NET Web Application > ASP.NET 5 Empty or using the ASP.NET Yeoman Generator $ yo aspnet _-----_ | | .--------------------------. |--(o)--| | Welcome to the | `---------´ | marvellous ASP.NET 5 | ( _´U`_ ) | generator! | /___A___\ '--------------------------' | ~ | __'.___.'__ ´ ` |° ´ Y ` ? What type of application do...