Microsoft Dev Posts

Safe and Sane Windows 8 Programming Experiences with HTML and JavaScript

Windows 8 is mostly about touch.

There was a time, some fifteen years ago, when the choice of the programming language was a delicate decision. It stopped being a problem when .NET arrived. Because .NET languages compile to the Common Language Runtime, .NET compatible languages became more or less indistinguishable other than syntactically, and developers could happily mix Visual Basic with C# and even JScript.

The JScript language you could use to build plain .NET applications was simply a programming language with syntax close to JavaScript. Choosing JScript didn’t mean you were going to write .NET applications following the web metaphor.

In Windows 8, things are different.

A Windows 8 application runs on top of a new runtime environment—called “Windows Runtime” or WinRT for short. WinRT is a modernized and redesigned version of the .NET Common Language Runtime. You can write a Windows 8 application using C#, Visual Basic, or C++ for the logic and XAML for the layout. In doing so, you can take advantage of patterns that are made-to-measure for XAML, such as the Model-View-View-Model pattern (MVVM). In this regard, developing for Windows 8 is not that much different from developing for Silverlight or Windows Phone.
Read more…

Comment |

A Journey from Google I/O to Microsoft Build

Microsoft, Apple, and Google try to define themselves as they become more alike

As I was sitting in the Build keynote I realized that both of the keynotes that I had attended recently (Google I/O and Build—I couldn’t get into WWDC) were really about me—well not just me but us, the consumers. This time it was Microsoft that had the DJ playing tunes as we were treated to images from Windows 8.1 and colored spotlights careened off of every surface (no pun intended) in the subterranean hall at Moscone South. The main thrust of the Build keynote, which started with Steve Ballmer announcing that Microsoft would now enter a time of rapid release for its software, was how well Windows 8 had done and how Windows 8.1 would be even better.

There were big cheers for the return of the Start Button, the ability to boot to desktop, a “refining” and “re-blending” of the massively overhauled Windows OS, all of which I think are great steps forward. In fact, there have been over 800 updates to Windows since November 2012. This already demonstrates that rapid release is the focus at Microsoft. And then there were the devices, so many devices, from Windows Phones to giant desktops that become giant tablets to all-in-ones that convert from laptops to tablets.

Read more…

Comment |

PowerShell Command Line Introduction

Effectively control Windows from the console

Here’s a slick PowerShell 3.0 one-liner. If you want to pull down an RSS feed from a blog, displaying only the title and publication date try:

powershell-0

It’s that simple. No looping, no checking end of stream, no XSLT to handle transforming the XML from the RSS feed, but wait, there’s more. This array of objects is now connected to the entire PowerShell ecosystem. PowerShell is based on .NET so you can use ADO.NET to insert it into a database, use Invoke-RestMethod again and post it to another REST endpoint or spin up Microsoft Excel and control it via its COM API. And that my friends, is the two foot dive into the PowerShell ocean.

PowerShell is Microsoft’s task automation framework, consisting of a command-line shell, an integrated scripting environment (ISE), a scripting language built on .NET Framework, an API allowing you to host PowerShell in your .NET applications, and it is a distributed automation platform. This means if you have PowerShell running on another box, you can remotely execute PowerShell there, if you have the credentials.

Getting started

What you need to do is launch the PowerShell console. On my Windows 8 box I press the Windows button, type “powers“, and hit enter.

powershell-1

Great! I’ve got a blank blue screen. Now what?
Read more…

Comment |

TechEd 2013: The ASP.NET Team, Surfaces at a Deep Discount, (and Google Glass?)

Humid, harmonious, and happy

People weren’t kidding when they told me New Orleans is humid, but the good news is the conference venue has great air conditioning. As expected TechEd is focused mainly on system administrator issues, but I’m feeling that even more so this year with BUILD right around the corner on June 26. However, that isn’t keeping the ASP.NET team from letting us in on what they’ve been working on these past few months.

I wrote a post a little more than a year ago on how Microsoft was starting to embrace open source. Well, it seems to be paying off with Web API 2: two of the new features, CORS and Attribute Routing, were initially contributed by community members and then perfected with the ASP.NET team. These two features are making writing code for your website more streamlined.

In other impressive updates, layout and styling are now based in Bootstrap and cross-browser testing is now much quicker with a tool codenamed “Artery.” We saw, Damian Edwards, Program Manager on the ASP.NET team, make a change in the code, rerun the program, and show us the updated website on local versions of Explorer and Chrome. In addition to upgrade announcements, a welcome change came in the form of a consistent toolset offering with Visual Studio 2013 that makes working across Web Forms and MVC much easier for developers. All new versions of these technologies, ASP.NET MVC 5, Web API 2, and Signal R2 will run only with .NET 4.5.

Sitting in the front of the packed room I kept thinking this is what Microsoft needs—an engaged audience that can work with a brilliant team to consistently update the technology and encourage change.

Oh, and Microsoft (in what I think is a smart move) is selling the Surface RT and Surface Pro, to full attendees, at deep, deep discounts, with the RT priced at $99 and the Pro at $399. The lines have been massive since the offer was announced. Hopefully this will provide Microsoft with more mindshare if not market share in the coming months.

And a note about Google Glass: I brought them to the conference in my continued social experiment to see how people would react. It has been a mixed bag of folks wanting to talk to me about them, those afraid I am recording them, and even a few that aren’t sure what it is. It continues to be good conversation starter as is the story of my eating my first crawdad—a New Orleans staple!

Comment: 1 |

ASP.NET web API rocks

Why the ASP.NET Web API Framework is an essential tool for RESTful applications.

Glenn Block (@gblock) is an O’Reilly author and senior program manager on the Windows Azure Team at Microsoft.

We sat down recently to talk about the newly released ASP.NET Web API Framework, which he helped develop, and why it will become essential to building RESTful applications.

Key points from the full video (below) interview include:

  • ASP.NET Web API enables a rich set of clients to consume info [Discussed at the 1:47 mark]
  • Find out if one comes out on top – MVC vs. Web API [Discussed at the 2:41 mark]
  • Different clients negotiate content differently – Web API handles this with ease [Discussed at the 5:50 mark]
  • Self hosting is a big deal but beyond that Web API introduces flexibility – you no longer need to use IIS [Discussed at the 9:04 mark]
  • An HTTP Programming Model for Microsoft [Discussed at the 11:04 mark]
  • The newest of the new – Hypermedia, OData, and Web API Contrib [Discussed at the 18:08 mark]

You can view the entire interview in the following video.

Read more…

Comment |
Async and Roslyn mean more power and insight in your C# 5.0 programs

Async and Roslyn mean more power and insight in your C# 5.0 programs

Async, Roslyn, and how to create your best C# 5.0 program

Longtime C# developer, Eric Lippert, speaks about new C# 5.0 features, updates to the forthcoming Roslyn compiler, and ways to optimize your C# programs.

Comment: 1 |

Developing cross-platform mobile apps with C#

Greg Shackles on using C# and .NET to build apps that work across mobile platforms.

Web developer and author Greg Shackles reveals the advantages of using C# over C++ for writing mobile apps. He also explains why Android and iOS developers should give C# a serious look.

Comments: 6 |
Microsoft opens up

Microsoft opens up

How Microsoft is contributing to and benefitting from open source.

Microsoft seems to be embracing open source more and more. What does this tell us about the company's near-term future?

Comments: 2 |
Cross-platform mobile development is a breeze with C#

Cross-platform mobile development is a breeze with C#

Greg Shackles on why C# makes sense for mobile development.

Find out why using C# for cross-platform mobile development will take you less time and less code while bringing your apps to a wider audience.

Comment |

Four questions about Microsoft with Mary Jo Foley

Mary Jo Foley on what’s on the horizon for Microsoft in 2012.

Long-time Microsoft reporter Mary Jo Foley tells us what to expect with Windows 8, Metro design guidelines, and the Kinect SDK for Windows.

Comment |