Announcing .NET Core and ASP.NET 5 RC
blogs.msdn.com
blogs.msdn.com
Can't wait to figure out what you can do with this on Linux. Anyone knows? Maybe not desktop apps but Web Apps should be doable at this stage?
In the days of ASP.NET v1, MS made money from server licences to run IIS and ASP.
These days they want to make money from Azure, and they make money regardless of if it's hosting .Net, PHP, Java or node.js; or on linux or windows. The .Net open stack becomes a loss leader. Ironically, it's also going to greatly improve .Net on AWS.
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{iex ((new-object net.webclient).DownloadString('https://dist.asp.net/dnvm/dnvminstall.ps1'))}"
Hmmmmmmmm. Technically they do. Can't tell if this is a joke...Invoke-WebRequest https://dist.asp.net/dnvm/dnvminstall.ps1 | Invoke-Expression
or this for short:
iwr https://dist.asp.net/dnvm/dnvminstall.ps1 | iex
Also, the powershell package manager is quite nice. So far it is basically chocolatey for me but if there are some more it can handle in the future... https://github.com/OneGet/oneget/issues/77
Source/Disclaimer: I work for the ASP.NET team
- ASP.NET 5 web apps and services - see: https://github.com/aspnet/home - Native executables - see: https://github.com/dotnet/corert/blob/master/Documentation/i...
What do you think?
Disclosure: .NET Core team member
I am interested in finding out how it compares right now to Java for building web apps and services - in terms of DB access, various ORM stuff etc.
http://www.hanselman.com/blog/OmniSharpMakingCrossplatformNE...
And assuming I can, is anybody else doing this? In the past it seems like production Mono makes no sense when Python and Node just work without additional libraries to make it work.
Edit : Not talking about Visual Studio Code, but the -original- Visual Studio IDE.
Maybe not project templates, they seem to be targeting Yeoman as the use case for "getting started".
But autocomplete and git integration are definitely there. In some ways better than how VS does it.
It may still be a while before is "surpasses" true VS - but - with support for sublime and textmate snippets it may be about to catch up to those two.
[0]: http://scriptcs.net
Has the ASP.NET request processing pipeline changed significantly in v5? Last time I checked, our fork of Nancy only really cares about _Init, _BeginRequest, and the unhandled exception handler.
ASP.NET 5 is essentially based on OWIN as a pipeline which uses a pipeline of async Func calls (that can be wrapped up into "middleware" components). NancyFX, actually implements an OWIN middleware which I think would be easy to tie into ASP.NET 5, but I haven't tried yet.
IIS also has too many knobs that can get fiddled and frig things up. Before we switched, I'd always be on support calls to help a customer fix one of our products after their sysadmin tweaked something in a way to break us, or installed some other piece of software that stomped on us.
IIS also has a very conservative set of defaults if you naively install it. Seriously, I've seen a lot of instances where customers install IIS, and CSS doesn't get served - you have to install an additional Static Content module. People don't read instructions, or bother to run required setup scripts. So you have to do a bunch of additional work with less-than-friendly installer authoring programs to make sure that features that any self-respecting web server ought to have out of the box are available.
You can follow their progress: https://github.com/Microsoft/visualfsharp/pulls?utf8=&q=is%3...
https://docs.asp.net/en/latest/tutorials/your-first-mac-aspn...
I've been building in MVC3/4 for the last few years so have quite a bit of experience with how MS has been evolving in this space. From "BundleTransformers" through "Web Essentials" and now suddely all the way to GULP
I started building a weekend and evenings project in EF7+MVC6 at Beta6 and have suffered through breaking changes in beta7 & 8 but each stage of the way I've enjoyed myself.
Some of the things that I have recently struggled with is getting the project working on linux VMs and docker.
While I can get boilerplate projects working, this "bigger" project struggles to compile on docker.
Part of it may be my own fault since I've split the solution into multiple projects ("WEB", "API", "MODEL") where MVC6 seems to have a paradigm of keeping everything in the same project, but it does seem to work OK on a windows 10 host (I keep wanting to test it on azure but that's another story)
There isn't any clear path as of yet from "building something that runs locally in VS" to getting it hosted in a "massively scalable cloud of containers"
I'm exploring docker and kubernetes at the moment - but progress is slow :)
Additionally - in terms of development - I'd like to see some more scaffolding, like I see with (for example) strongloop/loopback in node.js I'm finding that my API breaks down in .NET when I try and use an EF entity around since we get into circular JSON references.
Anyways, I'm starting to get off on a tangent. I really do like what I see in .NET5 though feel there are some pains in places. Specifically around containerizing & rapid application development.
That way I can try the latest and greatest of rc2 without having to rebuild my container every time new packages go up on myget.
It's a pretty minor ask... I'm probably one of a very small number of people that are stubborn enough to be on the bleeding edge (using rc2 when rc1 is the latest release, etc)
Moreover, is CoreCLR production ready on Linux? I haven't read 3rd party critical reviews or comparisons against JVM/Go/node.js on Linux. I don't have fond memories of putting faith in Mono/XSP.
edit Actually, the ASP MVC part has also progressed to RC1 as you can see here: https://github.com/aspnet/Mvc/releases
Confusingly, the next release is ASP Version 5 and ASP MVC version 6.
Also important: "supported on Windows, OS X and Linux"
This from the company that thinks 8 + 1 = 8.1, and 8.1 + 1 = 10.
Microsoft is doing some very cool stuff with .NET right now, but they are still probably among the worst in the industry at version numbers.
Their github issue pages are full of unresolved issues around problems with ASP.NET 5 and IIS [0][1][2], and the official docs on publishing ASP.NET 5 to IIS have a significant and incomplete list of "common errors" people are encountering [3].
Personally, I'm seeing responses from Kestrel when hitting ASP.NET 5 hosted pages under IIS, but they are zero-byte error 404 responses which don't help much. It's all great in Visual Studio but it's a big zero when trying to actually use it for real. This is not a release candidate. At best it's a 9th beta.
[0] https://github.com/aspnet/IISIntegration/issues/14 [1] https://github.com/aspnet/Hosting/issues/466 [2] https://github.com/aspnet/Hosting/issues/364 [3] https://docs.asp.net/en/latest/publishing/iis.html
Certainly, there are now two .NET choices on Linux. If you ask Miguel, I suspect he'd recommend .NET Core if you are building a server app.
Disclosure: .NET Core team member
Either way, these two docs [0,1] (not just those particular pages) could really use some clarifications. I had trouble working my way through either of them and they seemed to be giving conflicting information at times.
Granted, I have no significant experience with .NET or Mono. I was able to install Mono once on Ubuntu. But I gave up after trying to install .NET Core on Ubuntu (and FreeBSD) more recently - a week ago. Sorry, I can't provide more substantial criticism right now.
I guess the forums[2] would be the best place to bring these issues up in the future (with more information)?
[0] http://dotnet.readthedocs.org/en/latest/getting-started/inst...
I'm not on the ASP.NET team, but may be able to provide some general guidance.
I guess my current question is, can .NET Core be built on FreeBSD without a Windows machine? It appeared that this, for one, was not the case. This is a bit of a showstopper.
I did actually follow this guide, though I still wasn't able to compile. The build failed before the managed components section. If I have a chance to look at it again, I'll try to file a bug report or get more help.
But Xamarin have wisely moved into a wider place in the .NET tools ecosystem so that they don't only do mono, i.e. so they don't live and die with it.
Mono has been important and useful. But it may not continue to be that.
You would use .NET Core for server apps based on the upcoming version of ASP.NET.
In the future, it would nice if an ecosystem builds up for using .NET Core in other contexts. In particular, I know that not so many people care about desktop GUI development these days... but it would be great if you could combine .NET Core and AOT native compilation. Be able to write cross-platform desktop apps in type-safe, more-friendly-than-C++ language... and be able to ship them as standalone executables rather than worrying about a Mono or Java runtime being installed.
We use it extensively at Xamarin with our platform.
[1] http://www.mono-project.com/archived/guiderunning_mono_appli...
Oh, Microsoft finally woke up and supports path longer than 260 chars in dotNetCore. So, the questions when will Microsoft WinAPI & and the Windows Shell/Explorer too? Will we probably have for Windows 11...
We do hear about this limitations on Windows somewhat frequently in the context of .NET. This comes from internal Microsoft teams about as much as anyone else. We were glad to remove this limitation for .NET Core.
Disclosure: .NET Team member
Have a TFS build server that puts your cloned projects at not-the-top-of-the-filesystem.
It's very easy to hit that limit. It's atrocious and a joke. And Microsoft has paid me as an employee to write some ridiculous stupid workarounds for it in completely 100% managed C# code that shouldn't be bound by such stupid legacy decisions.
I hate MAX_PATH with a passion. It's one of those things that basically forces a hacky solution every, god, damn, time.
[0]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
I've never used it much and assumed it was an MS attempt to gain something like what the other shells already had.
I generally prefer bash for job control and pipe parallelism. For more complex tasks that would require a hash, internet access complex parsing etc., I tend to write a script in a different language, and plug it into a pipeline with bash.
The lack of parallelism in PS is the second biggest reason I don't use it.
The single biggest reason is bash is my common interface across Linux, Windows (cygwin), OS X and Solaris (when I used to run it).
I've done parallelism in PS, it's not difficult[1][2]. IIRC there were some gotchas, but it's certainly possible.
> For more complex tasks that would require a hash, internet access complex parsing etc., I tend to write a script in a different language, and plug it into a pipeline with bash
Right, you have no other choice in bash. Powershell lets you do all that within the language itself trivially.
1. https://technet.microsoft.com/en-us/library/hh849693.aspx 2. https://technet.microsoft.com/en-us/library/hh849718.aspx
You can instantiate .net objects, query their state, manipulate them interactively, and pass them around. You can also trivially write new shell commands in C#.
If you go through the tutorials and write a cmdlet in C#, and see how it interacts with powershell, you'll understand why it's cool. Might not be useful for everything, but it's well designed and extremely powerful.
This is the spirit of unix taken to the next generation. It's an incredibly useful CLI environment and pipeline which makes it easy to combine small tools to achieve powerful functionality while also facilitating making scripts by making them easier to use and easier to write.
For example, let's say I wanted to find every process using more than 100m of ram. With powershell that's just:
get-process | where WorkingSet -gt 100e6
Because powershell is object based you gain a lot more potency in the command pipeline. For example, let's say I wanted to kill all processes that matched a certain filter. That's as easy as piping the output of get-process through some filters then into stop-process. Let's say instead I wanted to wait until all instances of firefox are closed, that's just this: get-process | where path -like '*\firefox.exe' | %{ $_.WaitForExit() }
Powershell is far from perfect and it has a few very annoying gotchas here and there, but so does bash, python, and any other language for that matter. Powershell is a very powerful language that has benefited from a lot of rethinking of some of the traditions in command line interfaces that exist solely because that's how it used to work back in the day despite the reasons for those choices no longer pertaining in the here and now (teletype terminals, slow connections, slow everything, etc.). gps | where WorkingSet -gt 100MB
as well, which probably reads closer to your intent.Honestly I wonder what reason would one have to choose PHP over ASP.NET for their apps in a few months / years time.
For myself, mainly because as primarily a Python programmer I've been looking for where to move next with the 2/3 split. I've migrated completely to PyPy4 (which is Python2.7) rather than port/test to CPython3 in the last few years. It was worth the migration and testing that was involved.
I'm waiting to see if PyPy will announce they are the flag bearers for Python2. If so, I'll most likely continue using it going forward.
On the other hand we use .Net and Python at work so while most people would not agree or find .Net Core to be a bit pointless, for me it means I can move my projects and small business to run on my underpowered VPS, utilizing the same well-supported tech stack that many enterprises use.
Keeping my head in C# is a good advantage as I'm also interested in Xamarin and Unity (both professionally and personally). Of course, I'm one who does not have any particular grudge against Microsoft. I do prefer POSIX based systems. For my home business and hobby tech stack I'm currently looking at 1) PyPy4, 2) .NetCore 3) CPython3. While I'm currently running everything on PyPy4, there's a smaller gap between 1 and 2, and a big liklihood of adoption gap between 2 and 3.
One of the things that will be a huge barrier for me though is the lack of system.drawing. I've worked in the sign and graphics industry for 8 years and a lot of software I have written relies on system.drawing. The font rendering is crucial. It appears the only feasible option is the mono implementation.(and maybe that is good enough)
Looking ahead I'm curious if there will ever be aa coreclr replacement for this? It seems Microsoft closed the open issue regarding this.
https://github.com/dotnet/corefx/issues/2020#event-360344181
WebForms remains supported and new features go into it each release. It is supported on the .NET Framework.
Disclosure: .NET Core team member
I giggled at that, I admit.
There's a good chance you know this, but since some people reading this thread might not I figured I'd give some more detail.
It's definitely in Microsoft's interest to make Azure a great place to host your ASP.NET applications. The team that builds ASP.NET is part of the Azure group, and that's what pays the bills. (disclaimer: Microsoft employee, Azure fan)
However, ASP.NET 5 has been built to run great on your own web server. In addition to IIS on Windows, ASP.NET 5 has a cross platform, open source web server named Kestrel that runs on Windows, Mac and Linux: https://github.com/aspnet/KestrelHttpServer/
The team's working really hard to make sure that ASP.NET 5 not only runs cross platform, but that it works well and runs really fast cross-platform: https://github.com/aspnet/benchmarks/blob/master/README.md
Can I help with getting it running?
Today, I uninstalled mono, previous dmx stuff, and ran the package linked in this story. Same result. Yeoman website failed.
It's failing to resolve the fx dependencies.
Also, it's difficult for me to understand if I need mono or not. I have it.
[1] https://docs.asp.net/en/latest/tutorials/your-first-mac-aspn...
I was able to run it with 'dnx run', but not sure how to build it
To restore packages:
$ dnu restore
To build: $ dnu build
To run: $ dnx run
To run some other command: $ dnx <COMMAND_HERE> ...
Using Package dependency System.Threading 4.0.0
Source: /Users/joshuapearce/.dnx/packages/System.Threading/4.0.0
Unable to resolve dependency fx/mscorlib
Unable to resolve dependency fx/System
Unable to resolve dependency fx/System.Core
Unable to resolve dependency fx/Microsoft.CSharp
Unable to resolve dependency fx/System.IO
Unable to resolve dependency fx/System.Security
Unable to resolve dependency fx/System.Xml
Unable to resolve dependency fx/System.Xml.Linq
Unable to resolve dependency fx/System.Runtime
Unable to resolve dependency fx/System.ComponentModel.DataAnnotations
Unable to resolve dependency fx/System.Collections
Unable to resolve dependency fx/System.Text.Encoding
Unable to resolve dependency fx/System.Threading.Tasks
Unable to resolve dependency fx/System.Collections.Concurrent
...