我在想,如果用了.Net Core,肯定是期望部署在 Linux 上。那么最大的优势是省掉购买 Windows 的费用,但为何微软为愿意做这件自掘坟墓的事?这不合理啊!
所以,这一定是一个陷阱。。
$ dotnet new
Created new C# project in /Users/jason/work/foo.
$ dotnet restore
log : Restoring packages for /Users/jason/work/foo/project.json...
log : Writing lock file to disk. Path: /Users/jason/work/foo/project.lock.json
log : /Users/jason/work/foo/project.json
log : Restore completed in 799ms.
$ dotnet run
Project foo (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling foo for .NETCoreApp,Version=v1.0
Compilation succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:01.3745594
Hello World!
It work!
来的太晚了,当年 MS 策略问题必须绑定到 windows,天天吹全平台可能,就是不行动。 现在这套 core 能吸引多少开发者,暂时说不清楚了。
不过 MS 有钱,也不排除狠砸几家大公司用这个 core,成为行业新标杆。
ASP.net Core 1.0 Scaffold:
$ npm install -g yo bower grunt-cli gulp generator-aspnet
$ yo aspnet
然后:
? What type of application do you want to create? Web Application Basic [without Membership and Authorization]
? Which UI framework would you like to use? Bootstrap (3.3.6)
? What's the name of your ASP.NET application?