OmniSharp - Making cross-platform .NET a reality, and a pleasure
In case you missed it, make sure to read Announcing .NET 2015 - .NET as Open Source, .NET on Mac and Linux, and Visual Studio Community because there's been some big stuff going on.
Here's the summary of the .NET 2015 Wave of awesomeness.
- We are running .NET as an open source project going forward. http://github.com/dotnet
- There's a home for Microsoft on GitHub now at http://microsoft.github.io
- You can get Visual Studio Community for FREE now at http://visualstudio.com/free
- ASP.NET 5 will run on Windows, Linux, and Mac. Yes, really.
The other thing I wanted to talk about is a newly organized group of technologies called OmniSharp. Just to be sure there's no confusion, OmniSharp isn't a Microsoft project. While there are two Microsoft folks on the team of 8 or so, we are working on it as community members, not in an official capacity.
I "launched" this project in my talk at the Connect() mini-conference in New York a few weeks back. You can watch that video here on Channel 9 now if you like. However, the technologies around and under OmniSharp have been around for years...like over a decade!
As a team and a community we pulled together a bunch of projects and plugins, got organized, and created https://github.com/omnisharp and http://www.omnisharp.net. Jonathan Channon has a great overview blog post you should check out that talks about how Jason Imison created OmniSharpServer which is an...
HTTP wrapper around NRefactory allowing C# editor plugins to be written in any language. NRefactory is the C# analysis library used in the SharpDevelop and MonoDevelop IDEs. It allows applications to easily analyze both syntax and semantics of C# programs. It is quite similar to Microsoft's Roslyn project; except that it is not a full compiler – NRefactory only analyzes C# code, it does not generate IL code.
OmniSharp runs as its own process and runs a local Nancy-based web api that your editor of choice talks to. If you have an editor that you like to use, why not get involved and make a plugin? Perhaps for Eclipse?
We now have plugins for these editors:
- Sublime
- Brackets from Adobe
- Atom from GitHub
- Emacs
- Vim
And these work on (so far) all platforms! It's about choice. We wanted to bring more than autocomplete (which is basically "I think you typed that before") to your editor, instead we want actual type-smart intellisense, as well as more sophisticated features like refactoring, format document, and lots of other stuff you'd expect only to see in Visual Studio.
We also brought in the Sublime Kulture package which gives Sublime users support for ASP.NET 5 (formerly ASP.NET vNext), so they can launch Kestrel (our libuv based local webserver), run Entity Framework migrations, and other arbitrary commands from within Sublime.
Here's OmniSharp running in emacs on my Windows machine. The emacs setup (here is an example) is a little more complex than the others, but it also gives emacs folks an extreme level of control. Note that I had to launch the OmniSharp server manually for emacs, while it launches automatically for the other editors.
Here is an ASP.NET MVC app running in Sublime. The Sublime OmniSharp package output can be seen in the debug console there (Ctrl+~ to see it).
OmniSharp is in very active development. We are looking at bringing in Roslyn, using the new ASP.NET Design Time Host, and improving robustness. It's not perfect, but it's pretty darn cool. There's lots of details in Jonathan's writeup with great animated gifs showing features. Also note that we have a Yeoman generator for ASP.NET that can get you started when creating ASP.NET 5 apps on Mac or Linux. The yeoman generator can create Console apps, MVC apps, and NancyFx apps.
You can get started at http://omnisharp.net. See you there!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Looks like the dream is getting closer. People have made Brackets hosted. Just a matter of time and I can't wait. Fantastic work
I can't explain how delighted am I to see dotNet embrace the Open Source.
This means I can go back to my beloved Ubuntu to still be able to do dotNet the way I can do on Windows.
P.S I don't see any Linux screenshots.
Cheers,
I know .NET development will always be faster/easier using VS.
Ugh, @Scott, why is this so weird? The K runtime, the KVM, Mono, .NET, ASP.NET 5. I seriously can't see the forest for the trees.
If someone can explain the moving parts, how they work and interact, and how to get it up and running, instead of gushing about the fact that OMG .NET is open source, that would be so much more helpful. Because despite the open sourcing and touted platform support, I haven't seen Microsoft .NET compiler and CLR for OS X anywhere.
- github/dotnet
Lists a repository named corefx. 'FX' is short for 'effects', sort of like 'JavaFX', right? Its description is "foundational libraries that make up development stack". I understand libraries, those are .dlls. But a development stack is much more than that. It must include a runtime and a compiler, otherwise it's only "foundational libraries". It Github readme tells me it contains not enough class libraries to build any application with. Where is system, or mscorlib, or system.core? Finally links to the '.NET home repository', I'll get back to that later, but for now, think about what 'home' means for .NET. Is it a website, like MSDN? If this is 'corefx' and 'makes up the development stack', then what is '.NET home'?
Further lists a repository named buildtools. This project does not explain if these tools are needed to build the corefx project, or to build my own projects. It seems I can ignore them if I'm not interested in contributing to .NET itself, right? Or is this like MSBuild? MSBuild is a buildtool. Is it (going to be) open source? Is this it?
Further lists the home repository. Hey, I rember just reading about this, 'the .NET home repository' was mentioned in the readme of the corefx project, right? Except that readme links to Microsoft/dotnet, so that's not the same as dotnet/home. Hmm, I must keep the Microsoft/dotnet in mind, I'll revisit it later.
For now, let's look at the last repository: core. Wait, scroll up, there's a corefx repository. What is this the core of then? Well, its description says it's the 'home repository for .NET Core'. So is that different than the repository named home that is listed right above it? And also different from the Microsoft/dotnet repository, which has been referred to as the '.NET home repository'?
Conclusion: I have looked at 5 repositories, and am now seriously confused...
I haven't even touched on github.com/Microsoft, where there is a dotnet repository, or aspnet/home, yet another 'home' repository (the whole aspnet account is even more of a mess).
What happened? MSDN used to be very structured and clear, and now it's just a data dump, with what seems like multiple team throwing incomplete stuff against the wall under confusing names without coordination.
I hope you can move some more mountains to make sure there's actually a coherent story and that developers will 'fall into the pit of success' rather than have to 'stumble through the forest' when it comes to finding (re)sources online.
Sorry for the rant.
Also, I assume, with a virtual machine, azure handles backups so I can revert to a previous point in time ?
I 'get it' now, great way to ensure backups, best resources available, as the compile time is the killer sometimes....
Love the idea that I can put in a few hours coding when visiting venice or the lake district :)
@Scott - Omnisharp looks like a good idea, it would be great if we can see 1-step deployment of these tools on all supported platforms.
Moving stuff into the public domain is awesome but usually diverses things a bit and takes away the out-of-the-box mentality.
So if your complaining about things being unclear, try setting up a Rails development environment or getting any of the node.js frameworks to fly without consulting the support forums :)
Keep up the great work guys!
Plus, I've got a vague background fear that using VS as my sole IDE is protecting me from the rough edges of development a little. Whilst I don't enjoy rubbing up against the rough edges I think it's important to remove my ignorance...
Great work guys!
.Net going open source is restoring my faith though. At least it means .Net is here to stay.
Hopefully those sorts of prejudices will vanish in time with technologists seeing the advantages of all available platforms. Giving people more tools is a good thing, they can choose to use them or not. The difference is that before they didn't have access to them and so made choices based on that. Perhaps their choices will change.
Either way its a good gateway to interact with Azure, which after all is a key microsoft strategy :)
However, currently net developers of desktop applications are in trouble.
We need to create desktop apps that target both mac and windows (and linux why not). Microsoft has no tools for that and this happened because they followed the wrong way as they did with windows 8 metro fail. They created metro just because they could, not because developers or other people needed it.
We are now in a position that in windows 8 we can build a desktop app using three different frameworks (winforms, wpf, rt (+the unmanaged ways)) which are incompatible between each other.
So instead of having ONE UI Framework targeting multiple platforms (windows,mac,linux) we have 3+ frameworks targeting the same platform (windows 8) and this is completely wrong.
http://www.heightcelebs.com/height-converter/
Clarity is not there. This contributes to the crisis of confidence. This goes all the way back to sxs and the failure to address library management on systems. Installing dev env on platforms should be choco install, one-get install or yum install,etc without 1hr install times - try 1 minutr bootstrap or less to begin dev. They should give you all the things, and anything beyond should be nuget install.
I see this happening on many fronts, ie docker on windows. Why not explain the offering instead of announcing it only to set up for shortcomings.
Open source is about transparency, and not getting it right yourself by having the community steer and contribute to right the ship.
I think msft is going in the right direction but my fellows in linux circles say dotnet is dotdead and are off learning golang, node, or ruby to address the next gen of apps. They are probably right as dotnet has insulated itself for too long and accessing it from other langs (the sign of effective useful apis) is too difficult.
Try to config the IP stack of a windows server programmatically without powershell.
Win32, ole, wmi .net its out of control
(require 'cl)
(add-hook 'csharp-mode-hook 'omnisharp-mode)
; Set path below, or add to Windows path environment variable.
; I had to reboot between Windows path changes for Emacs to see it correctly, for some reason.
(setq omnisharp-server-executable-path "C:\\bin\\OmniSharpServer\\OmniSharp\\bin\\Debug\\omnisharp.exe")
Our shop does not allow any developer to bring in their per tool, scripting language, library, OS project, version control front end, utility, .... for being torpedoed at the cost of tens of thousands of dollars in the past.
Minimizes that consultant with expected tenure of 1 year or less on a project.
I mean, there's basically NO new teqhniques that passes those guidelines :)
Since they're opening things up, I'd love for that little portion of Windows to get out into the light as well. I know the team had expressed some concerns with people using non-standard means of access, but that wouldn't be a big issue with a standard implementation on GitHub.
Java,.Net, C++, whatever... really boil down to being nothing more than tools.
Stop thinking like evangelists and start approaching programming as a professional software engineer...
Exit Soapbox ...
Software that was traditionally closed source, single platform, and married to Microsoft tooling is now open sourced, running on multiple platforms, and working with tools created by someone else. Does this seem like something anyone could accomplish overnight? Nobody from Microsoft is saying this is first class and production ready, and to start moving all your .Net infrastructure to Linux servers tomorrow. But they are definitely saying "we're serious about this, look what's coming" and that's enough for me to be pretty excited about it.
As for Microsoft's financial dealings, ".Net is dead", and other pappy killing discussions it's outside the scope of this blog post and serves as a distraction. The big picture here is Microsoft is putting its money where it's mouth is, fulfilling a promise with vigor, and we're all going to benefit from it.
So fire up your favorite text editor on your favorite OS and goof around with this stuff, it works surprisingly well. If you hate it, improve it.
Finally..
Compatibility and Interoperability with Roslyn will be a great bonus.
But what it's your final goal?
(ASP) .Net Adoption?
C#?
The Editor / PlugIn Part?
I hope you guys are building an installer too.
I really do not want to install 10x small packages and read 100 pages of documentation just to be able to install it.
A small .NSIS/? script ( installer ) that will check for available software (already installed) and suggest new software if not already installed.
And some 5+ Template Applications + TDD + Compile Options/Software.
Watching this upsets me cause it makes me stop and ask - "why is it Embarcadero (that has nowhere near the resources MS does) has produced a great cross-platform app building IDE but MS hasn't?"
And in this 2 minute video I was able to understand fully what AppMethod offers. Yet I've read numerous blog posts and articles on this open source announcement and I'm still confused as hell as to what it all means. And who are we kidding, MS is more than aware of the confusing nature of the communication going out. They are more than likely purposely limiting what's being said and how its being said to protect corporate strategy, roadmap, limit expectations, etc.
@Hakan also mentioned that the .Net community has a mindset of expecting things to be "pre-packaged and neatly packaged". Well duh yeah! When did developers stop being customers?
I wouldn't deliver source code to my customer and then expect them to create their own build and install process and work thru all of the bugs. So no I don't want to go and "goof around and figure it out".
MS is worth billions and is more than capable of providing polished software to its customers - developers. I think it is a very slippery slope when we start expecting a low standard of quality with our development tools all in the name of open source.
I'll be the happiest .Net dev in the world when there is a nice polished production ready OSX version of VS that allows me to build cross-platform universal apps using a single source code base. But I'm sorry without that "polished pre-packaged" solution I'm staying on the sidelines. It's called "bleeding edge" for a reason and with over 20 years experience I've been cut enough times to learn to avoid it and to wait for the polish.
So @Scott, I'm very much looking forward to the day when you post about a production ready version of VS (or equivalent) coming to OSX that allows me to build cross-platform universal apps. But until then I'm happily riding the bench and watching from the sidelines.
again, that are fantastic news! The current movement is just great! It's not about the choice of 1 particular language and 1 tool - it's about choose the right tool for the job and the freedom to do so.
And thanks for the good introduction will head over to Jonathan Channon's Blog to get into more detail...
Thanks
Felix
Simple to understand given large corporations have hundreds to thousands of applications built in-house.
Understandable when they've been burned many times each year by some tool, library, vendor or third party app going unsupported, broken by an os or other update, or in zombie support status.
That's why tools, libraries, vendors, languages, security models, architectures are vetted and approved before being introduced into a large corporation.
It's a code review like op for an application, its environment, deployment tools and the tools needed to release/build a new version.
It's why large corporations don't pick projects with 2 developers, niche libraries, or third party vendors likely to go out of business/become unsupported.
Planning for a 5-10 year system life is why they may not pick the latest fad library, tool, language, methodology ...
This is absolutely amazing, I mean the live comment preview...
and of course, some other amazingness are listed bellow
- .Net being open source
- Rob talking about corpses
- me, having all these comments read
- (again) Live Comment Preview, like the stone age ones without tools above;)
arrives inside notion that sunglasses are produced to ban the rays through the sun. There are
sunglasses available for very small amounts of money, and for occasional use they're fine but they are unlikely to have
good, protective lenses. A deodorant could be in the same way successful with out comprising alcohol consumption along with aluminum chlorhydrate.
The only problem you'll have is deciding on merely
one to your outdoor activity.
I seriously like your technique of blogging. I book marked it to my bookmark
webpage list and will be checking back soon. Please check out my website as well and let me know what you think.
Comments are closed.
Joke aside, you may want to highlight the fact that, outside Windows, things are a bit volatile at the moment and it takes a bit of effort to get all the moving parts working together. For example, if you take an ASP.NET solution from VS2015 and copy it to your Mac then Omnisharp intellisence wont work. You need to use the the dev stream for ASP.NET (currently beta2), change Sublime settings etc. I will blog about it next week.
I am sure that the way things are progressing we will soon have a consistent and interoperable .NET platform to work with, but for now it is a bit of a pain to get started. We all love the work that the team is putting in though!!! keep it up