Running ASP.NET Core applications on Windows Subsystem for Linux
Setting up Linux on Windows 10
First thing is to enable Windows Subsystem for Linux. It doesn’t install Linux but gets Windows ready for it. Linux support is Windows feature and it must be activated from Windows Features dialog.

After installing the feature Windows needs restart.
As Windows is ready to host Linux now it’s time to install one. Windows 10 Fall Creators Update supports more than one Linux. I opened Store app and installer Ubuntu Linux from there.![]()
It takes time to get things up and running as after installation there are some configuring needed. User is asked for username and password and everything else is done by Linux from this point. Just wait until it gets done.
Running Linux on Windows
After installing Linux it is possible to use Windows 10 search to run it.

Those who need to run it frequently can also pin Ubuntu to taskbar or start menu.
Installing .NET Core
As I installed Ubuntu Linux then .NET Core installation commands here are for Ubuntu 16 that came from Windows Store.
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install dotnet-sdk-2.0.2
It takes some minutes to get .NET Core installed as after installation it also initializes things.
Running application from local disk
Linux on Windows uses its own file system and disks on machine are visible through mounting. The following screenshot shows how I moved to project folder on test machine and ran ASP.NET Core application. It’s the same folder where I build application on Visual Studio.
![]()
And here is the web front-end of my TemperatureStation solution served by Linux on Windows.
![]()
NB! I have experienced some issues this far. Sometimes after running ASP.NET Core web application on Ubuntu it’s not possible to close terminal. When closing it from Task Manager then on next run terminal window opens but nothing happens there. In case of any issues please report problems to Windows team using Feedback app.
Wrapping up
Windows subsystem for Linux is easy to enable and install. It makes Linux available on Windows without hardware level virtualization and there’s no need to install Hyper-V or some other virtualization platform. When building multi-platform apps it is handy to have Linux environment available to test and try application quickly. Although I faced few issues when working with .NET Core on Linux this way these issues were not show stoppers and I got my tasks done. Those who build multi-platform apps should give a Linux on Windows a good try.
Running ASP.NET Core applications on Windows Subsystem for Linux的更多相关文章
- [转]Publishing and Running ASP.NET Core Applications with IIS
本文转自:https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications- ...
- Asp.Net Core 自动适应Windows服务、Linux服务、手动启动时的内容路径的扩展方法
public static IWebHostBuilder UseContentRootAsEnv(this IWebHostBuilder hostBuilder) { bool IsWindows ...
- 发布到ASP.NET CORE项目到 Windows server 2012
原文: https://github.com/zeusro/MarkdownBlog/blob/master/2018/2018-01-17-01.md 发布到ASP.NET CORE项目到 Wind ...
- ASP.NET Boilerplate 学习 AspNet Core2 浏览器缓存使用 c#基础,单线程,跨线程访问和线程带参数 wpf 禁用启用webbroswer右键菜单 EF Core 2.0使用MsSql/MySql实现DB First和Code First ASP.NET Core部署到Windows IIS QRCode.js:使用 JavaScript 生成
ASP.NET Boilerplate 学习 1.在http://www.aspnetboilerplate.com/Templates 网站下载ABP模版 2.解压后打开解决方案,解决方案目录: ...
- ASP.NET Core 新建项目(Windows) - ASP.NET Core 基础教程 - 简单教程,简单编程
原文:ASP.NET Core 新建项目(Windows) - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core 新建项目(Windows) 对于任何语言和框架,都 ...
- asp.net core 托管到windows服务,并用iis做反向代理
使用NSSM把.Net Core部署至 Windows 服务 为什么部署至Windows Services 在很多情况下,很少会把.Net Core项目部署至Windows服务中,特别是Asp.n ...
- WSL(Windows Subsystem for Linux)--Pico Process Overview
[转载] Windows Subsystem for Linux -- Pico Process Overview Overview This post discusses pico processe ...
- Build SSH for Development on Windows Subsystem for Linux
It seems that Windows Subsystem for Linux (WSL) is getting much more mature than the time when it fi ...
- Windows10上开启WSL2(Windows Subsystem for Linux 2)及Docker Desktop For Windows
什么是WSL2 WSL2(Windows Subsystem for Linux 2)是适用于Linux的Windows子系统体系结构的一个新版本,它支持适用于Linux的Windows子系统在Win ...
随机推荐
- Storm知识点
1. 离线计算是什么? 离线计算:批量获取数据.批量传输数据.周期性批量计算数据.数据展示 代表技术:Sqoop批量导入数据.HDFS批量存储数据.MapReduce批量计算数据.Hive批量计算数据 ...
- STM32中断优先级彻底讲解
一.综述 STM32 目前支持的中断共为 84 个(16 个内核+68 个外部), 16 级可编程中断优先级的设置(仅使用中断优先级设置 8bit 中的高 4 位)和16个抢占优先级(因为抢 ...
- JS /javascript 解除网页屏蔽右键(无法复制)的代码
javascript:(function() { function R(a){ona = "on"+a; if(window.addEventListener) window.ad ...
- UVA10256 The Great Divide
怎么又没人写题解,那我来贡献一发好了. 题目意思很简单,平面上有两种颜色的点,问你能否求出一条直线使两种颜色的点完全分开. 首先我们考虑两个点集相离的充要条件,这两个点集的凸包必须相离.(很好证明或者 ...
- MySQL定时备份数据库(全库备份)
一.MySQL数据备份 1.1. mysqldump命令备份数据 在MySQL中提供了命令行导出数据库数据以及文件的一种方便的工具mysqldump,我们可以通过命令行直接实现数据库内容的导出dump ...
- 传统前端工程使用 Vue 等框架重构的思路
这段时间遇到类似的问题,第一反应便是使用 cli 搭建项目,但是细想一下立马否决了,原因如下: 工程量太大,猴年马月能重构完,此期间原项目还是没有任何变动(如果没人跟你一起同步修改之前老项目的话 无法 ...
- POJ - 3468 线段树区间修改,区间求和
由于是区间求和,因此我们在更新某个节点的时候,需要往上更新节点信息,也就有了tree[root].val=tree[L(root)].val+tree[R(root)].val; 但是我们为了把懒标记 ...
- (Beta)团队贡献分
Beta阶段团队每个成员都积极响应一起完成了开发, 所以最后我们一致决定各个成员的贡献分相同. 林珣玙 53 康家华 52 张启东 51 刘彦熙 49 马瑶华 48 仇栋民 47
- ImageProcessor组件
ImageProcessor组件 开源免费的.NET图像即时处理的组件ImageProcessor 承接以前的组件系列,这个组件系列旨在介绍.NET相关的组件,让大家可以在项目中有一个更好的选择, ...
- elasticsearch5.0版本的head安装
elasticsearch5.0版本的head安装 elasticsearch5.0版本由于刚出不久,并且与2.0版本的差距较大.所以,目前大家对5.0的一些使用还有所陌生.这里先把关于head插件的 ...