Skip to content

Cheap Windows Hosting ASP.NET

ASP.NET Hosting Cheap | Faster

X
  • Hosting Award
  • Hosting Comparison
  • Hosting Review
  • Tutorial
  • Contact
Menu

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application?

Posted on April 28, 2016June 16, 2016 by Mary Bacine

In this article, I will explain about how to make ASP.NET 5 empty application.To accelerate the learning process for ASP.NET 5 (aka ASP.NET vNext), this post will cover:

☑ Creating the project

☑ Examining the project

☑ Modifying the project

☑ Running the project

The goal of these topics is not only to show “how-to”, but to answer the “what is that…” and “why is that” as well.  It is written as if you are following along in Visual Studio 2015 (tutorial style), yet with enough supplemental detail to simply read (article style). Although not an exhaustive dive into each area, it should provide enough context to quickly get started with ASP.NET 5.

ASP.NET 5 Hosting Tutorial – Creating the project

To create a new ASP.NET 5 application, it is necessary to think in terms of projects, not web sites.  The Web Site… option as seen below is still supported in Visual Studio 2015 to support legacy site development.  The specific “ASP.NET vNext” features require the Project… option. With this in mind, in Visual Studio 2015 select from the top menu bar: File –> New –> Project

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

After selecting Project…, a new project dialogue box appears.  On the left side of the box, select the Web option under the language of preference (Visual C# used below).  From there, selectASP.NET Web Application and choose the solution/project name and file location.  This post will use ASPNET5 as the solution name, and ASPNET5Blank as the project name.

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

Another dialogue box will appear to fine tune the type of web project desired.  Choose the ASP.NET 5 Empty template as seen below.  Although you may see other options, notice each is disabled.

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

ASP.NET 5 Hosting Tutorial – Examining the project

Once the project has loaded in Visual Studio, Solution Explorer will reveal the following:

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

The project corresponds to the following file/folder structure:

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

The following is a brief explanation of the projects file/folder contents:
[supsystic-tables id=’12’]

The first four items above are there for the benefit of the developer using Visual Studio.  The latter three are needed for development.

Let’s take a look at the initial contents of the project.json file:

{
"webroot": "wwwroot",
"version": "1.0.0-*",
"exclude": [
"wwwroot"
],
"packExclude": [
"node_modules",
"bower_components",
"**.kproj",
"**.user",
"**.vspscc"
],
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta2"
},
"frameworks" : {
"aspnet50" : { },
"aspnetcore50" : { }
}
}

As can be seen above, the file contains name/value pairs (see schema at GitHub).  This new approach to managing web configurations (notice no web.config) enables simplified dependency management.  Instead of adding assembly references, you now add NuGet packages as dependencies.  How is this better?  Instead of hard-coupling a reference to an assembly, you can now simply add the dependency by just typing it into the file above.

The contents of the Startup.cs file are as follows:

using System;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;

namespace EmptySite
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
// In empty template, no code is here...
}
}
}

The Configure method of the Startup class is automatically called at runtime. TheIApplicationBuilder instance (with parameter name app highlighted above) provides methods to configure the app and to access the HTTP request. However, when I attempt to access this method in my project, I do not see it:

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

The only methods displayed are just named Use. In the next topic, the project will be modified to enable the use of other methods off of the IApplicationBuilder instance passed in.

ASP.NET 5 Hosting Tutorial – Modifying the Project

In Visual Studio, open the project.json file. We are going to add a dependency to theMicrosoft.AspNet.Diagnostics package which is needed to get access to the UseWelcomePagemethod. Under dependencies, the name of the package is provided paired with the version.  It must be typed accurately.

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

In the above screen capture, I started adding the Microsoft.AspNet.Diagnostics package.  When ready to add the corresponding value for version, IntelliSense came to the rescue again!

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

After saving the project.json file, the output window in Visual Studio reveals what happened:

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

The Microsoft.AspNet.Diagnostics package was installed along with its dependencies.  Did this modify the project.json file to show the two new packages?  No.  And that is good news.  Why?  There is no need to clutter the file with hierarchies of dependencies.  When a new package is referenced, the dependencies (and their dependencies) are automatically added.  When removed, all dependencies are removed too!

Returning to the Startup.cs file, when I now attempt to access the UseWelcomePage method, it exists!

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

The Configure method is now updated to look as follows:

public void Configure(IApplicationBuilder app)
{
app.UseWelcomePage();
}
What will this do? Let’s find out!

ASP.NET 5 Hosting Tutorial – Running the Project

By default, the project will be deployed to IIS Express for testing.  The classic Debug menu options still work here:

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

When selecting either Start Debugging [F5] or Start Without Debugging [Ctrl+F5], the app will run showing the welcome screen as seen here:

ASP.NET 5 Hosting Tutorial :: How to Make an Empty Application

HostForLIFE.eu ASP.NET 5 Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24×7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality – beyond other hosting control panels – and ease of use, Plesk Control Panel is available only to HostForLIFE’s customers. They offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.

Posted in ASP.NET, Hosting TutorialTagged affordable asp.net 5 shared hosting, asp.net 5, asp.net 5 hosting, asp.net 5 hosting india, asp.net 5 hosting palestina, asp.net 5 hosting poland, asp.net 5 hosting south africa, asp.net 5 hosting turkey, ASP.NET 5 Tutorial, asp.net mvc hosting, austria asp.net 5 hosting, belgium asp.net 5 hosting, cheap asp.net 5, cheap asp.net 5 hosting, cheap europe asp.net 5 hosting, europe asp.net 5 hosting, excellent asp.net 5 hosting, free and best asp.net 5 hosting, free and recommended asp.net 5 hosting, full trust asp.net hosting, germany asp.net 5 hosting, greece asp.net 5 hosting, italy asp.net 5, low cost asp.net 5 hosting, most recommended asp.net hosting, netherland asp.net 5 hosting, optimum asp.net 5 hosting, powerfull asp.net 5 hosting, recommended windows asp.net hosting, reliable asp.net 5 hosting, reliable free asp.net 5 hosting, secure windows hosting, spain asp.net 5 hosting, sweden asp.net 5 hosting, top asp.net 5 hosting, uk asp.net 5 hosting, unlimited free windows hosting

Post navigation

ASP.NET Ajax Hosting Review :: Best ASP.NET Ajax Hosting in Europe
Cheap IIS 8.5 Hosting :: Cheap Hosting With Excellent Features

Related Post

  • Best Cheap ASP.NET MVC 6 Hosting in Europe
  • eNom VS GoDaddy – Cheap ASP.NET Hosting Comparison
  • Benefits of Social Marketing
  • Cheap and Best Windows ASP.NET Hosting :: HostForLIFE.eu VS VidaHost
  • Best and Cheap ASP.NET MVC 5 Hosting Service
  • ASP.NET MVC 6 Tutorial :: Handle Multiple Submit Buttons On The Same Form in MVC 6
  • Best and Cheap IIS 8.5 Hosting Provider
  • Best and Cheap Windows Server 2012 Hosting – HostForLIFE.eu
  • Affordable ASP.NET Core 1.0 RC2 Hosting – Cheap Windows Hosting ASP.NET

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Best SQL 2016 Hosting

Categories

  • ASP.NET
  • ASP.NET Ajax
  • ASP.NET MVC
  • Entity Framework
  • Hosting Comparison
  • Hosting Review
  • Hosting Tutorial
  • IIS
  • Joomla
  • nopCommerce
  • Silverlight
  • SQL Server

Recent Posts

  • A2 Hosting vs ASPHostPortal ASP.NET Hosting – Who is Your Favourite?
  • Looking for A2 ASP.NET Hosting Alternatives?
  • Windows Dedicated Server with HostForLIFE.eu. Is it Good?
  • Let’s Move From Ionos ASP.NET Hosting
  • Choosing Your Best ASP.NET Core Hosting Provider: ASPHostPortal.com VS GoDaddy in Comparison

Our Partner

  • Best ASP.NET Hosting
  • Best Windows Hosting
  • Cloud ASP.NET Hosting
  • ECommerce Hosting Review
  • Recommended ASP.NET
  • Reliable Windows Hosting
  • Review ASP.NET Hosting
  • Windows Hosting Bulletin
  • Windows Hosting Leaders
  • Windows ASP.NET Hosting
  • Windows Hosting Review
  • Best Cheap Hosting ASP.NET
  • Hosting Review ASP.NET
  • Full Trust Hosting ASP.NET
  • Cheap Australia ASP.NET Hosting
  • Review Core ASP Hosting
  • Cheap Australia ASP.NET Hosting
  • Best Cloud ASP.NET Hosting
  • Creative Videos
  • Business Vendor
  • Reliable ASP.NET Hosting
  • Cheap ASP.NET Hosting Review
  • European ASP.NET Hosting
  • UK ASP.NET Hosting
  • ASP.NET Hosting Review
  • India ASP.NET Hosting
  • Best India ASP.NET Hosting
  • Cheap ASP.NET Hosting Review
  • Best ASP.NET Hosting Review
  • Easy Hosting ASP.NET
  • Cheap Windows Hosting
  • Reliable ASP.NET Hosting Review
Created by cheapwindowshostingasp.net
  • Hosting Award
  • Hosting Comparison
  • Hosting Review
  • Tutorial
  • Contact