Your official information source from the .NET Web Development and Tools group at Microsoft.
Hi everyone, this post is in my name but it’s authored by Sourabh Shirhatti. He is a Program Manager Intern from the University of Texas at Austin that I’ve had the pleasure of working with this summer. Below is his story, I hope you enjoy it.
Prior to my internship with Microsoft, my web stack of choice was Node.JS + Express + MongoDB, and I primarily developed on a Mac. Like most of the Node.js community I had a minimalist environment; my tools of trade were Sublime Text, a terminal window and a browser. This kind of lightweight environment was not possible with ASP.NET.
Using Visual Studio at Microsoft showed me the benefits of a full-featured environment. The intelligent auto-completions coupled with an integrated build and test environment made Visual Studio invaluable. However, I still missed the lightning fast experience with Sublime Text.
With that in mind, I set out to build tools to make it easier to develop ASP.NET applications on my Mac. I have tried to identify the features I most missed from Visual Studio and how tooling could make my life easier.
To skip ahead to the download, just click http://github.com/ligershark/kulture/.
Starting out with a clean slate on my Mac. I ran into my first problem. How do I create a new project?
Visual Studio makes it easy to generate the boilerplate for a new project. File -> New Project followed by two more mouse clicks and there you have a project that builds and runs.
Fortunately, the command-line community already has an excellent scaffolding experience through Yeoman. The logical next step was to build a yo generator for ASP.NET. The generator is hosted on GitHub at https://github.com/shirhatti/generator-aspnet where you can have a look and give it a spin. The code snippet below will get you started.
If you would like to follow along, click here for a more detailed instruction guide.
# Install yeoman
npm install -g yo
# Install the ASP.NET generator
npm install -g generator-aspnet
# Run the generator
Once I scaffolded out an empty project, I ran into another roadblock. How do I run my application?
In Visual Studio, it’s as easy as pressing F5.
I was able to one-up Visual Studio in Sublime Text 3 (ST3) by allowing you to run any of your custom k commands, and like any command in Sublime Text the key-binding is user-configurable. Here’s what my ST3 shows me when I press F5.
Thanks to the awesome folks on the Runtime team, you can now run your ASP.NET apps on a Mac using a cross-plat web server called Kestrel
You can try out the ST3 plugin at https://github.com/ligershark/Kulture
I have a boilerplate application that builds. I decide go ahead and add some code.Uh-oh! Looks like it doesn’t build anymore. How do I see the errors?
Visual Studio shows you a concise error list when your build fails with description, file name, line number and column number of each error.
Going for feature parity, that’s exactly what I tried to achieve in ST3.
Press F7 in Sublime and here’s what you see
One of the key efforts with ASP.NET vNext was to trim the fat; every non-essential feature exists and lives in its own separate NuGet package allowing your app to include only what it needs.
This is great for reducing my footprint, but how do I discover packages and their version numbers to include in my project?
Providing completions for Package names and version numbers inside of project.json based on fuzzy matching made it easier to discover packages and add functionality to my application
Error lists are awesome, but I wouldn’t have so many errors if ST3 helped me as I type. Can you suggest completions?
Visual Studio offers Intellisense, intelligent code completion and syntax checking that we all know and love. Fortunately, we don’t have to reinvent the wheel; the completions in Visual Studio are powered Roslyn, an Open Source C# compiler.
To achieve the same completions in ST3, we are working on providing out-of-process completions that are powered by Roslyn. I’ve been working with the Open Source community and I’m confident we’ll get this done after some initial promise.
You can follow the progress for Code Completions here.
Despite the aforementioned features, developing ASP.NET applications on a Mac is still not YET first-class experience. I say not yet because we are making strides in the right direction.
ASP.NET is Open Source.
All the code I’ve worked on this summer is also available on GitHub.
Join the party by opening issues or creating Pull Requests at https://github.com/ligershark/Kulture
Sourabh Shirhatti | @sshirhatti | http://shirhatti.com
great tool, i hope one day we will have a visual studio version for each OS (linux, windows, MAC OS).
that would be awesome.
Just wanted to express how cool this is and encourage you to continue pushing this forward. Thank you for your valuable contributions!
Visual Studio for Linux would be totally amazing!
Awesome job! Gotta give this a go soon! Hopefully soon I can start doing all my .net dev from ST3 on linux at home.
What about Xamarian Studio?
Did you tried to use vNext with it?
Anyway this is great news.
If you would like to use a Nancy generator and create a Nancy application using ASP.Net vNext please take a look at my blog post. blog.jonathanchannon.com/.../nancy-aspnetvnext-osx-sublime-text
Wow really cutting edge. I like the streamlined approach.
Wow. Really streamlined approach. Keep up the good work.
Too much work just to develop an ASP.NET app on the Mac. Get real people. I get the latest fad is Apple now but in the business world it is all about productivity. If MS ever/when creates a Visual Studio for Mac call me. (I don't think they ever will because that will kill some of their OS market share. Why do you think they have not release an Office update for the Mac in 5 years? Think people.
Güzel bir çalışma
Awesome work! Waiting for resharper for Sublime ))
.net is a secure,for other programing language. its tool is so cool for develop any thinks.
Very interesting and looking forward how far this can go
I'm curioius on why does Sourabh doesn't post in his blog, or if he does where's the link?
I'm with Kyle on this one. I love my Mac (for Mac things) but when it comes time for ASP.Net dev it's time to pull out Visual Studio. Parallels and Boot Camp run my Windows dev setup perfectly. Why re-invent the wheel?
I followed the steps in this blog post, when it comes to building solution inside Sublime 3, I receive this exception.
I have mono SDK installed.
(1,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
(1,46): error CS0518: Predefined type 'System.String' is not defined or imported
(1,59): error CS0518: Predefined type 'System.String' is not defined or imported
/Console1/Program.cs(1,7): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
/Console1/Program.cs(5,18): error CS0518: Predefined type 'System.Object' is not defined or imported
/Console1/Program.cs(7,33): error CS0518: Predefined type 'System.String' is not defined or imported
/Console1/Program.cs(7,23): error CS0518: Predefined type 'System.Void' is not defined or imported
/Console1/Program.cs(9,31): error CS0518: Predefined type 'System.String' is not defined or imported
/Console1/Program.cs(9,13): error CS0518: Predefined type 'System.Object' is not defined or imported
/Console1/Program.cs(9,13): error CS0103: The name 'Console' does not exist in the current context
/Console1/Program.cs(10,13): error CS0518: Predefined type 'System.Object' is not defined or imported
/Console1/Program.cs(10,13): error CS0103: The name 'Console' does not exist in the current context
/Console1/Program.cs(5,18): error CS1729: 'object' does not contain a constructor that takes 0 arguments
warning CS8021: No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options.