[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + Supervisord

2
Comments

In the previous article I've used nohup + su + init.d script to run kestrel in a background. But as Daniel Lo Nigro suggested in comments it's much easier to do the same with Supervisor And he was absolutelly right, config is much smaller, and you can easelly see status and output of a program. First, install supervisor: sudo apt-get install supervisor Now you can create config for your application: sudo nano /etc/supervisor/conf.d/kestrel_default.conf With following content: [program:kestrel_de...

Read further...

[ASP.NET 5] Production Ready Web Server on Linux. Run Kestrel In The Background

3
Comments

In the previous article we have installed nginx as a "gate" for our ASP.NET 5 application. Today we will see how to start kestrel server in the background. We will do even more, we will create init.d script to control our APS.NET 5 application and start it on  the system's startup. The simplest way to start kestrel in the background from console: nohup k kestrel & But if you want to start your application at the system's startup you need init.d script. Eventually, we will have following comm...

Read further...

[vNext] ASP.NET 5 Automatic Migrations with Fluent NHibernate

0
Comments

As I said in the previous article, I am gonna tell you about Automatic migrations with NHibernate and Fluent NHibernate in ASP.NET 5 applications. Automatic migrations is a really powerful feature, but you should be also really careful with it. Sometimes it might corrupt your schema or even data. Now back to ASP.NET 5 and migrations. I have already explained how to install and configure Postgresql with NHibernate. To enable automatic migrations you need to modify configuration a bit: private sta...

Read further...

[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + nginx

7
Comments

You can run ASP.NET 5 applications on Linux using kestrel web server. This is development web server, so it has limited functionality. But sometimes you need more functions, for example, https or virtual hosts support. Today we will see how to configure a system, so you can access your application through a domain name. First, you need ASP.NET 5 environment up and running.  You can use my article to install and configure everything, but it's a bit outdated, so it's better to use official documen...

Read further...

[vNext] ASP.NET 5 Dependency Injection with Autofac

1
Comments

In this part of the vNext tale, I am gonna tell you about dependency injection in ASP.NET 5 (vNext) stack. Default Dependency Injection container First, let's see what is shipped with ASP.NET 5 by default. There is already simple DI container. It gives you a possibility to register service with three different lifetimes: scope, singleton and transient. For now it supports only constructor injection. Let's see how to use it and what is the difference between these lifetimes. Create empty ASP.NET...

Read further...

[vNext] Use PostgreSQL + Fluent NHibernate from ASP.NET 5 (DNX) on Ubuntu

7
Comments

In the previous part we have installed APS.NET 5 application on Ubuntu, now we are gonna install and configure PostgreSQL on Ubuntu and access database from our application through NHibernate. Install and configure PostgreSQL First, install PostgreSQL: sudo apt-get install postgresql postgresql-contrib Next, set root password: sudo -u postgres psql postgres \password postgres And then create test database: sudo -u postgres createdb mydb Add Fluent NHibernate to the application Open project.json...

Read further...

[vNext] Install ASP.NET 5 (DNX) on Ubuntu

10
Comments

ASP.NET MVC application on Linux? Easy! As you may know, Microsoft recently released a lot of their products under MIT license. .NET Core runtime, .NET CoreFX, ASP.NET 5, MVC 6, Entity Framework 7, MSBuild, everything is now available on GitHub. Our goal is: run Asp.Net MVC application with postgresql database on ubuntu server Today we are gonna start with setting up .NET environment. In the new asp.net stack you can choose between full .NET runtime and .NET Core. For now .NET Core has a lot of...

Read further...

Host WCF service library in ASP.NET MVC 4 application

4
Comments

If you have existed WCF service library and want to host this WCF serivce in your ASP.NET MVC4 application I have prepared this short how-to. For example you have WCF service located in FooWCF assebly and  MVC4 application located in BarWeb project. Open BarWeb project and add reference to FooWCF assebly. Now, add testService.svc WCF Service file in to BarWeb project, remove ItestService.cs and testService.svc.cs files from project. Open testService.svc and replace <%@ ServiceHost Language=...

Read further...

Deploy ASP.NET MVC 4 application + WCF service to the free AppHarbor cloud

0
Comments

This article is a step by step instruction to deploy your ASP.NET MVC 4 application that hosts WCF service to the free AppHarbor cloud hosting with MS SQL server and NewRelic monitoring functionality. Configure AppHarbor You need to register an account on https://appharbor.com/, then go to "Your Applications" and create the new one. For example we will create application with name "testForBlock". Then you should add SQL server add-on to your site. Go to "add-on catalog", select "SQL Server" and...

Read further...