Quantcast
Channel: Scott Hanselman's Blog
Viewing all 1148 articles
Browse latest View live

Fixing System.Core 2.0.5 FileLoadException, Portable Libraries and Windows XP support

$
0
0

Installing Windows XP to testMy buddy Greg and I are getting ready to launch our little side startup, and I was going through our product backlog. Our app consists of a global cloud service with Signalr, an iPhone app made with Xamarin tools, and a WPF app.

One of the items in our Trello backlog was "Support Windows XP. Gasp!"

I hadn't given this item much thought, but I figure it was worth a few hours look. If it was easy, why not, right?

Our WPF desktop application was written for .NET 4.5, which isn't supported on Windows XP.  I want to my app to support as basic and mainstream a .NET 4 installation as possible.

Could I change my app to target .NET 4 directly? I use the new async and await features extensively.

Well, of course, I remembered Microsoft released the Async Targeting Pack (Microsoft.Bcl.Async) through NuGet to do just this. In fact, if I was targeting .NET 3.5 I could use Omer Mor's AsyncBridge for .NET 3.5, so it's good that I have choices.

I changed my project to target .NET 4, rather than 4.5, installed these NuGets, and recompiled. No problem, right?

However, when I run my application on Windows XP it crashes immediately. Fortunately I have instrumented it with Raygun.io so all my crashes to to the cloud for analysis. It gives me this nice summary:

raygun.io is amazing 

Here's the important part:

FileLoadException: Could not load file or assembly 
'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'
or one of its dependencies. The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047)

That's weird, I'm using .NET 4 which includes System.Core version 4.0. I can confirm what's in the GAC (Global Assembly Cache) with this command at the command line. Remember, your computer isn't a black box.

C:\>gacutil /l | find /i "system.core"
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL

OK, so there isn't even a System.Core version 2.0.5 in the GAC. Turns out that System.Core 2.0.5 is the Portable Libraries version, meant to be used everywhere (that means, Silverlight, etc, everywhere) so they made the version number compatible.

Because we're building our iPhone app with Xamarin tools and we anticipate supporting other platforms, we use a Portable Library to share code. But, it seems that support for Portable Libraries were enabled on .NET 4 vanilla by the KB2468871 update.

I don't want to require any specific patch level or hotfixes. While this .NET 4 framework update was pushed to machines via Windows Update, for now I want to support the most basic install if I can. So if the issue is Portable Libraries (which I still want to use) then I'll want to bring those shared files in another way.

You can LINK source code in Visual Studio when you Add File by clicking the little dropdown and then Add as Link:

Adding source code as a Link within Visual Studio

Now my Messages.cs file is a link. See the little shortcut overlay in blue?

A linked file as a little overlay on the icon

I removed the project reference to the Portable Library for this WPF application and brought the code in this way. I'm still sharing core, but just not as a binary for this one application.

Recompile and redeploy and magically .NET 4 WPF application with async/await and MahApps.Metro styling starts up and runs wonderfully on this 12 year old OS with just .NET 4 installed.

For our application this means that my market just got opened up a little land now I can sell my product to the millions of pirated and forever unpatched Windows XP machines in the world. Which is a good thing.


Sponsor: Big thanks to Aspose for sponsoring the blog feed this week. Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and a host of other file formats in your applications. Curious? Start a free trial today.



© 2014 Scott Hanselman. All rights reserved.
     

Introducing ASP.NET vNext

$
0
0

There’s some really cool stuff going on on the ASP.NET and Web Tools team. The team has been pushing open stuff at Microsoft for a few years now and we've joined forces with the amazing innovators from the .NET core team and beyond! Some of these features are 10+ years in the making from a host of technical wizards across many teams and disciplines.

Today we’re announcing a preview (read: alpha) of the next generation of .NET on the Server.

You may have heard about some of these announcements at Build:

ASP.NET vNext will take things to the next level. Today, you run ASP.NET using the same CLR that desktop apps use. We’re adding a cloud-optimized (my cloud, your cloud, their cloud - server stuff) version optimized for server scenarios like low-memory and high-throughput.

ASP.NET vNext will let you deploy your own version of the .NET Framework on an app-by-app-basis. One app with new libraries can’t break an app next door with a different version. Different apps can even have their own cloud-optimized CLR of their own version. The CLR and cloud-optimized libraries are NuGet packages!

In this screenshot you can see build 418 and build 420 of the new framework (note how small they are) in my packages folder. These NuGet packages include the complete "Core CLR" and the cloud-optimized .NET Framework. You can deploy your own CLR and .NET Framework with your app as a NuGet.

Holy crap it's ASP.NET vNext

I can run ASP.NET vNext apps within Visual Studio, of course, and within IIS, but I can also easily "self-host" them from the command line or within my own application. This alpha includes command line tools for running and managing ASP.NET vNext apps.

The "kvm" command allows me to control my environment. I run "kvm list" to see what versions of the ASP.NET vNext are available. I can switch between them on a per-environment basis:

C:\>kvm list

Active Version Runtime Architecture Location
------ ------- ------- ------------ --------
0.1-alpha-build-0418 svr50 x86 C:\Users\scottha\.kre\packages
* 0.1-alpha-build-0418 svrc50 x86 C:\Users\scottha\.kre\packages
0.1-alpha-build-0420 svr50 x86 C:\Users\scottha\.kre\packages
0.1-alpha-build-0420 svrc50 x86 C:\Users\scottha\.kre\packages

I set the active version with "kvm use version" and opened two command prompts, setting different CLR and .NET versions in each.

I’m running the same app twice, once per command prompt. I put version 420 on port 5420 and version 418 on port 5418.

Two Command Prompts two .NET Frameworks

This little app below outputs the current running version of ASP.NET vNext. Here I’m running the same app at the same time under different builds of the next generation of ASP.NET

Two URLs two .NET Frameworks

The project system is also changing - we’re integrating packages.config, NuGet specifications (nuspec), and project files (csprojs) into a unified view of your project dependencies expressed in a project.json file.

NuGet packages and class libraries are treated the same. You get full intellisense in the project.json file and NuGet packages come down automatically and transparently. Even better, let’s say NuGet package Foo.Bar has a bug but you’ve only got the NuGet package. You can make a folder called Foo.Bar in our local project and put the source via "git clone" in that folder. This is great for open source projects. That local version overrides the NuGet, allowing you to easily patch bugs locally in libraries while you wait for a new release. When a new fixed NuGet-distributed version shows up, update the version and delete the local source.

New project system

One of the great aspects of environments like node or rails is that they are "no compile." Just change some code and hit refresh. With the next version of ASP.NET you get the power and throughput of the .NET runtime plus the "Roslyn" compiler-as-a-service for a "no-compile compile."That means means during development time you can just change your C# classes and hit Refresh in the browser. It's the power of .NET with the dynamism of a refresh-and-go development experience.

NOTE: This isn't ASP.NET Websites, or Razor View compilation - this is the whole thing, compiled in memory. You can use Visual Studio for development, or text editors like Sublime, or freakin' Notepad. (Of course, if you want assemblies on disk, you can do that too.)

See my web app’s bin folder in the screenshot below? There’s no assemblies in there because the assemblies never exist on the disk. It’s actually faster and easier to have the compiler do all the work in memory. This way you don’t have to read source, write out dlls, then read the dlls in again. (That DLL is part of the magic that makes it all happen.)

No binaries on disk!

If you like, when your web projects build for deployment, they can also build as NuGet packages. You publish your project and every needed dependency comes along.

You’ll be able to put ASP.NET vNext on your existing servers, any hoster, and Azure of course.

You can opt in or out of the cloud optimized framework for compatibility. The next version of ASP.NET is modular and all about choice. your choice of framework, your choice of runtime, your choice of operating system, your choice of text editor.

ASP.NET vNext is:

  • Cloud and server-optimized
  • ASP.NET MVC and Web API have been unified into a single programming model
  • No-compile developer experience
  • Dependency injection out of the box
  • Side by side - deploy the runtime and framework with your application
  • NuGet everything - even the runtime itself
  • All Open Source via the .NET Foundation and takes contributions

Oh, and by the way

  • ASP.NET vNext (and Rosyln) runs on Mono, on both Mac and Linux today. While Mono isn't a project from Microsoft, we'll collaborate with the Mono team, plus Mono will be added to our test matrix. It's our aspiration that it "just work."
ASP.NET on a Mac

There will be lots of new information and details coming out over the next several months!


Sponsor: Many thanks to Izenda for sponsoring the blog feed this week! Intuitive Ad Hoc Reporting with Stunning Visualizations - Embed real time dashboards into your ASP.NET applications for easy, custom reports across all devices. Download a FREE TRIAL of Izenda Today!



© 2014 Scott Hanselman. All rights reserved.
     

The Future of .NET on the Server: ASP.NET vNext content and videos from TechEd 2014

$
0
0
David Fowler and Scott Hanselman on ASP.NET vNext

Hi everyone, last week we announced ASP.NET vNext to the world at TechEd North America. All the sessions videos are up and available for downloading on Channel 9! There are still many MANY months between this early alpha that we've shared and release, so I'd encourage you all to subscribe to the .NET Web Development blog. This is a group blog, from and by the ASP.NET and Azure Web Tools team. It's an excellent and unfiltered group blog that everyone contributes to. Also follow the team on Twitter @aspnet and Facebook as we post there regularly.

We also released Visual Studio 2013.2 so be sure to go get that free update.

While everyone's jazzed about ASP.NET vNext, there's a lot of cool new stuff you can do TODAY with ASP.NET, like:

OK, here's the videos from TechEd.

ASP.NET vNext Videos at TechEd

Other ASP.NET videos from TechEd

http://www.asp.net/vnext

We've also updated the ASP.NET site with all new vNext content and walkthroughs.

Thanks for reading! I hope you enjoy piling through these posts and watching these videos. We sure have had fun (and continue to!) building all this. Remember, all the code is at http://github.com/aspnet.


Sponsor: Many thanks to Izenda for sponsoring the blog feed this week! Intuitive Ad Hoc Reporting with Stunning Visualizations - Embed real time dashboards into your ASP.NET applications for easy, custom reports across all devices.Download a FREE TRIAL of Izenda Today!



© 2014 Scott Hanselman. All rights reserved.
     

Bloggers: Know when to use a JPG and when to use a PNG and always Squish them both

$
0
0

The best rule of thumb for bloggers using images in their posts is:

Use JPGs for photographs, landscapes, and faces. Use PNGs for charts, graphs, screenshots and cartoons. Use GIFs only for animations, and sparingly.

As with all rules of thumbs, you should use your best judgment. You should aim to understand how these two image formats work so you can make the right decision.

JPEGs

imageJPGs (JPEGs) are "lossy." That means they lose data. They literally throw image data away that they figure your eyes won't see. A good example would be a landscape with a large blue sky. The image format could hold all the detail of the blue sky, literally millions of pixels saying blue, blue, dark blue, darkish blue, sky blue...or it could say "this is a whole area of mostly blueish." Sure, some detail is lost, but for the most part, it's a big blue sky, right? When you save a JPG in your paint program (like Paint.NET) and there's a quality slider for the JPG, the lower the number the more data you'll throw away.

File from Wikimedia Commons

PNGs

PNGs are "lossless." That means that they don't lose data when they are saved. They are more like ZIP files than like JPGs. PNGs also are known for their ability to have transparent regions. With a JPG you might have a white background, but a similar PNG could have a transparent background and be overlaid on other graphics.

File from Wikimedia Commons

Regardless of which one you choose, chances are that the paint app you use (even Photoshop) haven't removed all the unneeded data from your graphics files. Applications like PNGGauntlet or PNGOut can squeeze 10, 20, even 30% from a already-saved file without any loss in quality. This is especially important given the number of folks browsing on mobile devices. Bandwidth matters, and you do everyone a disservice with every one megabyte graphics file you upload to your blog.

pnggauntlet-screen-a0eadac6[1]

I'm a huge fan of PNGGauntlet. There's also Trimage that optimizes JPGs and PNGs on Linux, and ImageOptim for Mac.

PNGGaultlet works HARD. It will turn your PCs fan on, I'm sure, as it works very hard. But PNGGauntlet tries all of PNGOUT, OptiPNG, and DeflOpt and picks the best result to create the smallest PNGs.

After you've got that blog post perfect, I recommend you add a "squish the graphics" step to your workflow. You'll only gain speed and happier readers.

Related Links


Sponsor: Many thanks to Izenda for sponsoring the blog feed this week. Please do check out their Intuitive Ad Hoc Reporting with Stunning Visualizations - Embed real time dashboards into your ASP.NET applications for easy, custom reports across all devices. Download a FREE TRIAL of Izenda Today!



© 2014 Scott Hanselman. All rights reserved.
     

NuGet Package of the Week: ImageProcessor - lightweight image manipulation in C#

$
0
0

I really enjoy image manipulation in code. Sure, resizing photos is fun in Photoshop, but there's something viscerally enjoyable when you change images with your own code.

I've talked about image resizing libraries like ImageResizer before, but there's certainly room for more than one. Today I want to showcase ImageProcessor, an open source "collection of lightweight libraries written in C# that allows you to manipulate images on-the-fly using .NET 4+." ImageProcessor is available on GitHub.

ImageProcessor

ImageProcessor methods include; Resize, Rotate, Rounded Corners, Flip, Crop, Watermark, Filter, Saturation, Brightness, Contrast, Quality, Format, Vignette, Gaussian Blur, Gaussian Sharpen, and Transparency.

ImageProcessor has a notable number of configuration options for web apps, and a supporting ImageProcessor.Web package as well. It's an impressive body of work.

I like this simple example of loading, resizing, and saving an image with their fluent API:

// Read a file and resize it.
byte[] photoBytes = File.ReadAllBytes(file);
int quality = 70;
ImageFormat format = ImageFormat.Jpeg;
Size size = new Size(150, 0)

using (MemoryStream inStream = new MemoryStream(photoBytes))
{
using (MemoryStream outStream = new MemoryStream())
{
using (ImageFactory imageFactory = new ImageFactory())
{
// Load, resize, set the format and quality and save an image.
imageFactory.Load(inStream)
.Resize(size)
.Format(format)
.Quality(quality)
.Save(outStream);
}

// Do something with the stream.
}
}

You can easily chain functions with the API, like tinting and constraning:

imageFactory.Load(inStream)
.Constrain(size)
.Tint(Color.FromArgb(255, 106, 166, 204))
.Format(format)
.Save(outStream);

When you add ImageProcessor.Web it adds caching that takes pressure off your web servers. You can easily add HttpHandlers to watermark an image, for example, and cache the result.

This is a library that has as a lot of potential. Since it's open source, I'm sure they'd appreciate help from the community! Personally, I think they could use more Unit Tests and more examples.

Head over to https://github.com/JimBobSquarePants/ImageProcessor and star this project! Get involved, file issues, and contribute! http://imageprocessor.org/

Related Links


Sponsor: Many thanks to Izenda for sponsoring the blog feed this week. Please do check out their Intuitive Ad Hoc Reporting with Stunning Visualizations - Embed real time dashboards into your ASP.NET applications for easy, custom reports across all devices. Download a FREE TRIAL of Izenda Today!



© 2014 Scott Hanselman. All rights reserved.
     

Calculate your WEI (Windows Experience Index) under Windows 8.1

$
0
0

I used to be slightly obsessed with getting a high "WEI" in Windows. The Windows Experience Index was a number meant to give you an idea of how strong your PC was. The idea would be that you'd go get a game at the store and it would say "WEI 5 or greater" and you'd say, "oh, I have a 6, so this game will run great."

Under Windows 7 the maximum WEI was a 7.9, so I, of course, set off to build a machine that got a perfect 7.9 WEI.

In Windows 8 and 8.1, however, the friendly UI for showing your WEI is gone.

7.9 WEI

However, you can still get the RAW numbers in Windows 8.1, I'm told from a tipster who emailed me. (Thanks!)

First, run a cmd.exe prompt run "winsat prepop." If it fails to generate much output, try "winsat formal."

winsat prepop

Then, open a Powershell command prompt and run "Get-WmiObject -class Win32_WinSAT" and you'll see all your scores!

Get-WmiObject -class Win32_WinSAT

Looks like this machine is limited only by the SSD, but otherwise is an 8 class machine! I'm happy to be able to confirm my WEI again!

Does anyone know if Windows 8.1 maxes out at 8.9 or 9.9 WEI? Sound off in the comments!


Sponsor: Many thanks to Izenda for sponsoring the blog feed this week. Please do check out their Intuitive Ad Hoc Reporting with Stunning Visualizations - Embed real time dashboards into your ASP.NETapplications for easy, custom reports across all devices. Download a FREE TRIAL of Izenda Today!



© 2014 Scott Hanselman. All rights reserved.
     

We are abstracting on the shoulders of giants

$
0
0

middleMy new startup has data centers on three continents, utilizes global load-balancing, traverses networks with ease, has both an iPhone and Windows application, was written in a simple high level language, and enables an amazing scenario to help people get more done, faster.

But the real story - the real mindblower for me - was not the hours and hours of software that my partner and I wrote, it's the years and years of software that we didn't write.

We globally load balanced web sites and services across multiple servers in Europe, Asia, and the US. Windows Azure Traffic Manager handled that.

We sat our communication protocol on top of SignalR, an open source library using ASP.NET that hides the complexities of the real-time Web, handles NAT traversal for us, and basically removed the network for us as an issue. SignalR sits on stop of HTTP and Web Sockets, which sits on top of TCP/IP.

We used RayGun.io for our error management, and get complete stack dumps when a failure occurs in our application, this enables us to upgrade fast and often and give a good experience to our users

We used InnoSetup to install our application, it's truly one of the most amazing applications I've ever used. Give him money.

We used the ZXing QRCode Open source library for creation of QR codes. We didn't worry about the graphics details.

We used MahApps.Metro UI to make our Windows application look great. Added some controls, and it's lovely.

And it all comes together using C# and the Xamarin set of tools. The iPhone app, the Windows app, and the cloud service, are all C#.

I've been in the software industry for over 20 years now and I remember when writing C was considered a rather high-level language. I generally understand the full stack from assembler all the way up to managed code and beyond to the cloud. It's fantastic that today we think about managing VM clusters as much as we think about managing bytes.

Think about the giant shoulders that our application is standing on. Think about the shoulders that your application is standing on. Software abstraction has enabled us to do so much.

We can marvel at the abstraction layer that is Google. For many, that IS the internet. You type a question into a text box and push a button and the entire world opens up to you and a just a fraction of the planet truly appreciates the orchestration and history that makes it all happen.

Do I have a point here? Probably not. It just struck me today. Go listen to my chat with computer science legend Len Bass on this week's podcast to get a feeling for the history and power that we exploit every day.

There is value in taking a moment to think about the deep and broad stack that your application sits on. Go thank and support the projects, both open source and not, that your application uses. Revel in the layers of abstraction that others have created and appreciate the ones that you have created. They make all the LEGO pieces you're using just the correct size, and they make snapping them together a lot of fun.

It's a great time to be a programmer. This blog post was dictated with the myEcho application.



© 2014 Scott Hanselman. All rights reserved.
     

Xamarin.Forms - Write Once, Run Everywhere, AND Be Native?

$
0
0
Xamarin lets you shared code across platforms

I worked in Java for a number of years at Nike, writing an order management application that would run on four platforms. We used to joke that we'd "write once, debug everywhere." Now, this was the early days of Java, but the thing was, every form and control was 'owner drawn.' That meant that a button looked the same everywhere because it wasn't a real button as far as the operating system was concerned. It was a picture of a button. We used to use Spy++ and different Windows inspector programs to explore our applications and they could never see a Java program's controls. This meant that the app pretty much worked everywhere, but the app always LOOKED like a Java App. They didn't integrated with the underlying platform.

With MVVM (Model, View, View-Model) patterns, and techniques like the Universal apps work on Windows Phone 8.1 and Windows 8.1, code sharing can get up into the high 90% for some kinds of apps. However, even for simple apps you've still got to create a custom native view for each platform. This is desirable in many cases, but for some app it's just boring, error prone, and tedious.

Xamarin announced Xamarin.Forms today which (in my words) effectively abstracts away native controls to a higher conceptual level. This, to my old eyes, is very similar to the way I wrote code in Java back in the day - it was all done in a fluent code-behind with layouts and flows. You create a control tree.

"Xamarin.Forms is a new library that enables you to build native UIs for iOS, Android and Windows Phone from a single, shared C# codebase. It provides more than 40 cross-platform controls and layouts which are mapped to native controls at runtime, which means that your user interfaces are fully native."

Xamarin uses Shared Projects in Visual StudioWhat's interesting about this, to me, is that these "control/concepts" (my term) are coded at a high level but rendered as their native counterparts. So a "tab" in my code is expressed in its most specific and native counterpart on the mobile device, rather than as a generic tab control as in my Java example. Let's see an example.

My buddy from Xamarin, James Montemagno, a fellow Chipotle lover, put together the ultimate cross-platform Hanselman application in a caffeinated late night hack to illustrate a few points for me. This little app is written in C# and runs natively on Windows Phone, Android, and iOS. It aggregates my blog and my tweets.

Here is the menu that switches between views:

WindowsPhone2Android2iPhone2

And the code that creates it. I've simplified a little for clarity, but the idea is all MVVM:

public HomeMasterView(HomeViewModel viewModel)
{
    this.Icon = "slideout.png";
    BindingContext = viewModel;
    var layout = new StackLayout { Spacing = 0 };
    var label = new ContentView {
        Padding = new Thickness(10, 36, 0, 5),
        BackgroundColor = Color.Transparent,
        Content = new Label {
            Text = "MENU",
            Font = Font.SystemFontOfSize (NamedSize.Medium)
        }
    };
    layout.Children.Add(label);
        
    var listView = new ListView ();
    var cell = new DataTemplate(typeof(ListImageCell));
    cell.SetBinding (TextCell.TextProperty, HomeViewModel.TitlePropertyName);
    cell.SetBinding (ImageCell.ImageSourceProperty, "Icon");
    listView.ItemTemplate = cell;
    listView.ItemsSource = viewModel.MenuItems;

//SNIP

listView.SelectedItem = viewModel.MenuItems[0]; layout.Children.Add(listView); Content = layout; }

Note a few things here. See the ListImageCell? He's subclassed ImageCell, which is a TextCell with an Image, and setup data binding for the text and the icon. There's recognition that every platform will have text and an icon, but the resources will be different on each. That's why the blog and Twitter icons are unique to each platform. The concepts are shared and the implementation is native and looks native.

That's the UI side, on the logic side all the code that loads the RSS feed and Tweets is shared across all three platforms. It can use async and await for non-blocking I/O and in the Twitter example, it uses LinqToTwitter as a PCL (Portable Class Library) which is cool. For RSS parsing, it's using Linq to XML.

private async Task ExecuteLoadItemsCommand()
{
    if (IsBusy)
        return;
    IsBusy = true;
    try{
        var httpClient = new HttpClient();
        var feed = "http://feeds.hanselman.com/ScottHanselman";
        var responseString = await httpClient.GetStringAsync(feed);
        FeedItems.Clear();
        var items = await ParseFeed(responseString);
        foreach (var item in items)
        {
            FeedItems.Add(item);
        }
    } catch (Exception ex) {
        var page = new ContentPage();
        var result = page.DisplayAlert ("Error", "Unable to load blog.", "OK", null);
    }
    IsBusy = false;
}

And ParseFeed:

private async Task<List<FeedItem>> ParseFeed(string rss)
{
    return await Task.Run(() =>
        {
            var xdoc = XDocument.Parse(rss);
            var id = 0;
            return (from item in xdoc.Descendants("item")
                select new FeedItem
                {
                    Title = (string)item.Element("title"),
                    Description = (string)item.Element("description"),
                    Link = (string)item.Element("link"),
                    PublishDate = (string)item.Element("pubDate"),
                    Category = (string)item.Element("category"),
                    Id = id++
                }).ToList();
        });
}

Again, all shared. When it comes time to output the data in a List on Windows Phone, Android, and iPhone, it looks awesome (read: native) on every platform without  having to actually do anything platform specific. The controls look native because they are native. Xamarin.Forms controls are a wrapper on native controls, they aren't new controls themselves.

WindowsPhone3Android3iPhone3

Here's BlogView. Things like ActivityIndicator are from Xamarin.Forms, and it expresses itself as a native control.

public BlogView ()
{
    BindingContext = new BlogFeedViewModel ();
    var refresh = new ToolbarItem {
        Command = ViewModel.LoadItemsCommand,
        Icon = "refresh.png",
        Name = "refresh",
        Priority = 0
    };
    ToolbarItems.Add (refresh);
    var stack = new StackLayout {
        Orientation = StackOrientation.Vertical,
        Padding = new Thickness(0, 8, 0, 8)
    };
    var activity = new ActivityIndicator {
        Color = Helpers.Color.DarkBlue.ToFormsColor(),
        IsEnabled = true
    };
    activity.SetBinding (ActivityIndicator.IsVisibleProperty, "IsBusy");
    activity.SetBinding (ActivityIndicator.IsRunningProperty, "IsBusy");
    stack.Children.Add (activity);
    var listView = new ListView ();
    listView.ItemsSource = ViewModel.FeedItems;
    var cell = new DataTemplate(typeof(ListTextCell));
    cell.SetBinding (TextCell.TextProperty, "Title");
    cell.SetBinding (TextCell.DetailProperty, "PublishDate");
    cell.SetValue(TextCell.StyleProperty, TextCellStyle.Vertical);
    listView.ItemTapped +=  (sender, args) => {
        if(listView.SelectedItem == null)
            return;
        this.Navigation.PushAsync(new BlogDetailsView(listView.SelectedItem as FeedItem));
        listView.SelectedItem = null;
    };
    listView.ItemTemplate = cell;
    stack.Children.Add (listView);
    Content = stack;
}

Xamarin Forms is a very clever and one might say, elegant, solution to the Write Once, Run Anywhere, AND Don't Suck problem. What's nice about this is that you can care about the underlying platform when you want to, and ignore it when you don't. A solution that HIDES the native platform isn't native then, is it? That'd be a lowest common denominator solution. This appears to be hiding the tedious and repetitive bits of cross-platform multi-device programming.

 

WindowsPhone1Android1iPhone1

There's more on Xamarin and Xamarin Forms at http://xamarin.com/forms and sample code here. Check out the code for the Hanselman App(s) at https://github.com/jamesmontemagno/Hanselman.Forms.



© 2014 Scott Hanselman. All rights reserved.
     

AppVeyor - A good continuous integration system is a joy to behold

$
0
0

All my open source projects building in AppVeyorEpisode 4 (that's from 2006, people, over 8 years ago!) of the Hanselminutes Podcast was on (CI) Continuous Integration. I was deep into CI at a large bank and having a blast. It's just such a joy to have a reliable and repeatable build. Even more so if setting up that build is easy. A good CI build that includes build, test, and deploy means you don't have to fear your code.

Back in the day we used Batch Files, dreams, and wishes to setup our CI systems. Later we moved to CruiseControl.NET. Today we've got lots of amazing options, some we can download and setup inside the company, and some hosted that require virtually no effort at all!

Like many of you, I've got a number of utilities and open source projects up on GitHub. Mine are at http://github.com/shanselman, of course.

However, some are older, some aren't often built, and honestly I couldn't tell you if they build anymore. Sometimes I'll even accept a Pull Request (PR) without really confirming that there isn't a missing semicolon or a syntax error. Ya, I said it. I haven't been nailed yet, but we all do it, and we know it's bad. A reliable CI system that kicks off a build on a commit is the only way to be sure.

I decided to revisit AppVeyor as an option for my CI system. I looked at it 18 months ago and it was time to check it out again.

Just to be clear, they don't know I'm writing this, I don't know AppVeyor, and I don't do paid reviews. This is all my opinion.

AppVeyor says they "automate building, testing and deployment of .NET applications helping your team to focus on delivering great apps."

Cool. I like automate, I like building, testing and deploying. I'm lazy, as are all good developers, so automated all the things!

Their pricing is impressive. It's free for unlimited public repositories, which means I can setup a CI build for all my little utilities and open source projects on GitHub. However, their Pro and Premium options are extremely competitive when compared against running my own VM and CI system in Azure for a month. 

Setting Up

I don't want to gush, but it's simple and gorgeous. I signed up with my GitHub creds (and also added BitBucket as I have some stuff there as well) and made a new project. They automatically sucked in my repositories, as well as the ones I have access to from other organizations. I selected a small one, my WiFi Manager for Windows 8, and clicked New Build.

It cloned my project and started building within a minute. I got an immediate failure, which surprised me.

Specify the Project

I stared at the error for a moment. Ah, my folder has more than one project or solution. Odd, there's just one project. Ah! But there's a foo.csproj AND a foo.sln.

Intuitively I go to Settings | Build, and enter the name of my csproj file. By the time I come back to the dashboard it's building again.

The build dashboard is at the same time impressive and comforting. It looks like a command prompt in HTML and it updates on its own, so you never feel like you're waiting or wondering what's happening.

Build Success

Amazing, look at that. It worked. I can add tests, and identify artifacts (results of the build) and act on them.

Here's my xUnit tests running automatically and their results showing up in the dashboard. Magic.

Tests too!

Here's AppVeyor uploading a build artifact.

Found an artifact

One EXE as Artifact

Here I've added an artifact and can download it and run it right from the browser. If your artifacts are NuGet packages, they'll even give you a private NuGet feed for those artifacts that you can use in other projects or automate yourself!

Finally you can automate deployment to whatever environment you like. Push to Blob Storage (like I do for myEcho), push to a NuGet server, or Web Deploy.

Deploy Anywhere

Impressively, AppVeyor restores NuGet packages as well. It even built a two year old ASP.NET MVC repository of mine on the first try.

So my open source project builds, now what? Now I add a status badge to my project's ReadMe.md to let everyone who visits my GitHub repository that this is a healthy project that is building successfully!

Status Badges

It literally took me longer to write this blog post than it did for me to setup Continuous Integration for FOUR open source projects in AppVeyor. Literally about 15 minutes from start to finish.

AppVeyor is really impressive, fun to use, and "just works." It's a great example of Software as a Service and the kinds of software I talked about in my recent post We are abstracting on the shoulders of giants.

With cloud apps like AppVeyor for build/test/deploy, services like like RayGun.io for error management, Trello for products backlogs, FreshDesk for support tickets, there's just so many great choices for a software companies large and small. It's a great time to be writing software.

Related Links


Sponsor: Big thanks to Mindscape for joining us and sponsoring the blog feed this week! I discovered Raygun.io and started using it for my side project and I LOVE it. Get notified of your software’s bugs as they happen!Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

This URL shortener situation is officially out of control

$
0
0

I saw a URL today on Twitter to an article on Slate.com. It was a custom short URL - http://slate.me/1h0svt8 but since I was visiting it via Twitter, it was wrapped with Twitter's t.co URL, so I really started at http://t.co/sxSvcJnT2L.

When I visited it for the FIRST time, I got this lovely HTTP interaction. That's SEVEN HTTP 301s, count them, 7, before I get to the destination page.

image

It would have been 8 redirects if I'd counted t.co as well. Note also that after it bounced around three of Slate's URL shorteners, it also goes through goog.gl as well.

  • t.co is twitter's URL shortener that acts as a "safety gate" that allows Twitter to shut down a bad URL at the Twitter level. This means Twitter can stop malware faster, they say.
  • trib.al is a URL shortener that provides marketing analytics. They are bouncing me around in order to set marketing cookies because it's the first time they've seen me.
  • goo.gl is what you'd think it is, it's Google's URL shortener.

That's a lot of back and forth just to get me a a web page. And getting me a web page is kind of the most important thing the web does. Redirects are being abused and I don't see any work happening in HTTP 2.0 to change it.

The second request to the same URL is better, but still frustratingly indirect.

image

Every redirect is a one more point of failure, one more domain that can rot, one more server that can go down, one more layer between me and the content.

Oh, and just to be obnoxious, I've created http://hnsl.mn/thisurlisverysmall to make the point. Tweet it!

If you prefer long URLs, you can also get to this post from

http://uniformresourcelocatorelongator.com/aHR0cDovL3d3dy5oYW5zZWxtYW4uY29tL2Jsb2cvVGhpc1VSTFNob3J0ZW5lclNpdHVhdGlvbklzT2ZmaWNpYWxseU91dE9mQ29udHJvbC5hc3B4%7CGOvZCfcZVkHOsSZtVQgwUuzvaJeOVXWmOSgexmjuleGbleSSULshLkwpqddRmAkZYVheOvaZCDELQYCzOZzpvGgrnlGTIHypnqBBwVZEJZzlkpTwazjUBoqJUQJyudWXoBQvIOOfwrmqNpHEZmZXwHTYzrCFFSahOScKYLKAfkroAoopMbjuNcLKwSMEzsGeiawVCedYIZFNNQLWSEvQdkZMkDFyDosVlfLLhGizNOTxGQKHESsLoCoNleNtmlPIXedNEQcomXKRsJKOXzrLiAoJZRctSwYduzqvczTPgBgAjvzXRltkhpYDxkEpgiUqthRNiYgLOiDsFptekhiJxyfMKiCCAHYwNHmuKtlDqanKEZLlyqQYjURVbQQXikPrzUPYKHCmZrPOBUCHGssMyMekyfCkNOwhjgOGSrPPUQYtkLdvLQHjnszIJTOfKKMlBVMUoayZGMigAnIzrRfRtIczCOrhbFWthtMysDnHnTmDaTAfZFUCCGPskHqmVCtGFBhkwGQJxUdgPIYRyQXJJhylmfkCRQrvJqwOqnneWMKDTfcVdRxHXKHPkXoxwVpqfRWpSAzJKWMSKObRjzUfHXINRnlIcEGeigJJEIMcbfyXxMhVDxzwyOMboEfHHzTnQPbLyuRFKLxMlrfQbNMkoKJopCKDnKoxiNSFgBGoWjdYApYozbVIaBLoPHpDHXwgCneURTJdLnfLJPEEtxvmaVchmoNnyCvXnTmYFnFnDnLytKClfNFDJgpYsoyXhvTsuhhYapBzXBcKwacpcsZcMScmJIFHVNnrnxnwPIxHlWDMQKAeljmeInjBjACURODHbCSsgGvaAzaRPCLAhYQmtGYOeUfMqKSGPsEDQLDxSYxvtgGLSrfkOU

What do you think?


Sponsor: Big thanks to Mindscape for joining us and sponsoring the blog feed this week! I discovered Raygun.io and started using it for my side project and I LOVE it. Get notified of your software’s bugs as they happen!Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

FIXED: Blue Screen of Death (BSOD) 7E in HIDCLASS.SYS while installing Windows 7

$
0
0

I was doing tech support for a friend this weekend. He was paving an old HP Envy laptop (although this happens on some Dell Inspirons as well) and was getting a blue screen in the middle of install. Then, of course, if you're not looking at it you'll just reboot and drop back into setup and get the "the computer restarted unexpectedly or encountered an unexpected error." At this point he was in a setup loop.

IMG_1519

"HIDCLASS.SYS" is the driver that failed. HID means Human Interface Device, and that means "keyboards or mice" for the most part.

IMG_1543

Errors in HIDCLASS.SYS, especially during setup, almost always means that there's trouble with an attached keyboard or attached mouse. I asked my buddy if he had a mouse attached and he did. He removed the mouse, and started setup over again. Setup succeeded. Then, he spent about an hour (and several reboots) getting Windows 7 "gold" (which was released in July of 2009, almost 5 years ago) up to date with patches, service pack 1, and the latest drivers. Then he was able to attach his mouse and it works fine.


Sponsor: Big thanks to Mindscape for joining us and sponsoring the blog feed this week! I discovered Raygun.io and started using it for my side project and I LOVE it. Get notified of your software’s bugs as they happen!Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

Guide to Freeing up Disk Space under Windows 8.1

$
0
0

This is an "updated for Windows 8.1" version of my popular original article Guide to Freeing up Disk Space under Windows 7.

I've got a 256 gig C: drive that is an SSD, but things add up and I've noticed that in the last week or so I've only got about 20 gigs free and it was feeling cramped. A few hours later, I have 80G free. Here's how.

Warranty: There is none. Please read carefully and with all things you find on a random blog, be careful because you have no one to blame but yourself. However, if you take a few minutes, read carefully and do even a few of these tips or just run Disk Cleanup, you'll get lots of space back.

  • Press Windows Key + W and type "Free up." You'll see a few options. We're going to run two things.
    • First "Free up disk space on this PC" which runs full screen as a "modern app."
    • From here you can see how much space your Windows Store apps take up, as well as pictures, Videos, etc. You can also empty your recycle bin from here. It'll also give you a decent idea of how your personal files take up space.
      image
    • If you click "See my app sizes" you'll go to this screen where you can quickly uninstall apps. I don't bother with anything under 100 megs.
      image
  • Now, run "Free up disk space by deleting unnecessary files" which is the Disk Cleanup desktop app.
    • This app is your main line of defense and lists all kinds of things it can clean up. Be sure to click the "Clean up system files" option to run Disk Cleanup as Administrator. This will allow it to find and identify a lot more files for cleanup.
    • image
    • When you run Disk Cleanup as admin, as I have below, it is able to cleanup after Windows Update files. Note the difference between the screenshot above (run normally) and the one below (after clicking "Cleanup System files." It's found 238 megs of files from Windows Update that aren't needed. You may find lots more.
      image
  • Set your Windows Store Mail app to only download a month of mail. See how mail above uses 514 megs of space? That's because I told it to download all my mail. From within the Windows 8.1 mail application, press Ctrl-C, then click Settings, then go to Accounts and under Options for your account change the "Download Email from..." option to the last month, or even less.
  • Disable Hibernate - I have a desktop, and I prefer just three power states, sleeping, on or off. I don't use Hibernate. Plus, I have 12 gigs of RAM, and hibernation uses as much disk space as you have RAM. From an administrative command prompt, type "powercfg -h off" to get that space back. Got me back 12 gigs. It's up to you. Don't turn it off if you use the feature.
  • Virtual Memory - If you've got 8 or more gigs of RAM, it's likely that Windows has allocated more Virtual Memory as a file on disk than needed. It's not bad, and it's not a bug, it's just conservative. For example, I have 12 gigs of RAM and Windows has allocated a 12 gig "swap file." Interestingly, it's recommending (not sure if that's to me, or to itself) that I have only 5 gigs. Boom, change it manually and I get 7 gigs free. Not a big deal with a 500 gig drive, but a HUGE deal on a 128 gig SSD.
    Type Windows Key+W, then "Advanced System Settings" and enter. From here, go to Performance Settings, then Advanced. Under Virtual Memory, click Change. This is usually managed for you. Change it only if you feel you know what you're doing. Here I've moved it to my D: drive, opening up space for my smaller C: drive.
    image
  • %TEMP% Files - Even though Disk Cleanup is great, sometimes for whatever reason it doesn't always get stuff out of the TEMP folder. I recommend you try to delete the TEMP folder. I do this from the command line. Open up an administrative console, type "cd /d %TEMP%" (without the quotes, of course). Then, go up one folder with "cd .." and type "rd /s temp"
    Do be warned, this command says to TRY to delete the whole folder and everything underneath it. It's very unambiguous. If you don't feel comfortable, don't do it. If you feel in over your head, don't do it. If it screws up your computer, don't email me. Next, I do a "dir temp" to see if the folder really got deleted. It usually doesn't because almost always some other program has a temp file open and the command can't get remove everything. If it DOES remove the folder, just "md temp" to get it back fresh and empty. This got me back 12 gigs. I'm sure you'll be surprised and get lots back.
  • imageDelete your Browser Cache - Whether you use Chrome, IE or Firefox, your browser is saving probably a gig or more of temporary files. Consider clearing it out manually (or use the CCleaner mentioned below) occasionally or move the cache from your browser's settings to another drive with more space.
  • Clean up System Restore - Windows keeps backups of lots of system files every time something major (driver installation, some software installations, etc) happens, and after a while this can take up lots of space. It uses a service/subsystem called ShadowCopies and can be administered with a tool called vssadmin.
    Now, the EASIEST way to handle this is just to run Disk Cleanup, then click More Options and "Clean up…" which will delete all but the most recent System Restore data. That's what I did. That got me back lots of space back on my C: drive.
    You can also go to System Properties, then System Protection, then Configure and not only control how much space to allow for System Protection but also delete preview restore points as seen in the screenshot at left.
    Alternatively, you can use the vssadmin tool from an admin command prompt to to do important things. One, you can set a max size for the System Restore to get. Two, you can set an alternative drive. For example, you could have the D: drive be responsible for System Restore for the C: drive.
    You can use the commands like this. Note that you can put whatever drive letters you have in there. I ran it for each of my three drives. Note that this isn't just used for System Restore, it's also used for the "Previous Versions" feature of Windows that keeps some number of Shadow Backups in case you delete something and didn't mean it. Kind of a mini, local time machine. Point is, this isn't a feature you probably want off, just one you want kept to a max.
    Here's the command line I used. Your mileage may vary.
    vssadmin Resize ShadowStorage /On=C: /For=C: /MaxSize=15GB
  • SpaceSniffer 1.1.0.0 - www.uderzo.it Understand what's taking up all that space with SpaceSnifferor WinDirStat or TreeSize Free.  - I've used a large number of Windows Folder Size checkers, and the one I keep coming back to is WinDirStat. WinDirStat is oldish but is Open Source, and it works great in Windows. It's wonderfully multi-threaded and is generally fabulous. It'll help you find those crazy large log files you've forgotten about deep in %APPDATA%. It saved me 10 gigs of random goo. SpaceSniffer is also amazing and really lets you drill into what's going on space-wise in your disk.
  • Remove Old Stuff - Just go into Add/Remove Programs or Programs and Features and tidy up. There's likely a pile of old crap in there that's taking up space. I removed some Games and Game Demos and got back 5 gigs.
    Be sure to SORT by size to find big stuff AND sort by "installed on" to find old stuff you've forgotten! Also note the "Total size" at the bottom that no one notices. This is the total size of Desktop apps, not Windows Store apps.
    image
  • Uninstall anything evil - If you want to get a quick look at what's on a machine and uninstall LOTS of stuff quickly, look no further than NirSoft's My Uninstaller (download). Remove Toolbars (they think they need them and they never do and won't miss them), and anything that looks like it might destabilize their system. I check out toolbars, add-ins, etc
  • Wasteful TempFiles/ScratchFiles Settings in Popular Programs - Most programs that need scratch space have a way to set a ceiling on that Max Space. Go into Internet Explorer or Firefox, into the options and delete the Temporary Internet Files. Set a reasonable size like 250 megs or 500 megs. I've seen those cache sizes set to gigs. If you've got a speedy connection to the internet, that's just overkill. Check other programs like Adobe Photoshop and other editors and see where they store their temporary files and how large they've become. I used SpaceSniffer (mentioned above) and was shocked to find 5 gigs of old temp files from a year ago in little used programs.
  • Podcast Apps, especially iTunes - If you've configured iTunes to automatically download podcasts, be aware that these can app up if you use the default settings. Set your podcasts to keep only the last episode or last few, rather than 10 or more unlistened-to files.
  • A nicely compressed directoryNTFS Compression - That's right, baby, Stacker (kidding). This is a great feature of NTFS that more people should use. If you've got a bunch of folders with old crap in them, but you don't want to delete them, compress. If you've got a folder that fills up with text files or other easily compressed and frequently access stuff, compress 'em. I typically compress any and all folders that are infrequently accessed, but I'm not ready to toss. That is about 30-40% of my hard drive. Why bother to compress when Disk Space is so cheap? Well, C: drive space usually isn't. I've got an SSD, and it's small. I'd like to get as much out of it as I can without the hassle of moving my Program Files to D:. More importantly, Why the heck not? Why shouldn't I compress? It's utterly painless. Just right click a folder, hit Properties, then Advanced, then Compress. Then forget about it. As long as you're not compressing a bunch of ZIP files (won't do much) then you're all set. You might consider defragging when you're done, just to tidy up if you don't have an SSD.
  • Find Fat Temp File Apps and squash them - Google Earth and Microsoft Virtual Earth 3D are really fast and loose with the disk space. You can poke around for a while and next thing you know you're down 2 gigs or more. If you don't use the app a lot, delete the caches when you exit, or better yet, make the cache size for each app small.
  • Remove Crap with CrapCleaner (CLeaner) - This is a brilliant utility that removes crapware, unneeded programs, toolbars and other things that might litter up your machine.
  • works-on-my-machine-starburst ADVANCED: Use Junction Points/Hard Links/Reparse Points to move temp file folders - This is an advanced technique. If this technique kills your beloved pet cat, don't email me. You have been warned. Also, note that I'm only saying it works for me.
    I reclaimed 25 gigs just today by moving the MobileSync Backup folder from iTunes to a spinning rust disk off my SSD.
    Here's the idea. You'll move it to a drive with more space, but you'll LIE to iTunes using a little-used Windows Utility that will make a LINK between the folder iTunes expects to find and the folder you want your backups in. See? It's advanced but VERY powerful, especially when you
    C:\Users\Scott\AppData\Roaming\Apple Computer\MobileSync>dir

    Directory of C:\Users\Scott\AppData\Roaming\Apple Computer\MobileSync

    11/25/2011 10:10 PM <DIR> .
    11/25/2011 10:10 PM <DIR> ..
    11/25/2011 10:10 PM <JUNCTION> Backup [f:\iTunesMobileSync\Backup]
    0 File(s) 0 bytes
    3 Dir(s) 97,594,851,328 bytes free

While your are in there, why not do some more maintenance on your machine, blow out that dust and install some updates? Check out the The Technical Friend's Essential Maintenance Checklist for Non-Technical Friend's Windows Computer.

Hope this helps! If I missed anything, sound off in the comments!


Sponsor: Big thanks to Mindscape for joining us and sponsoring the blog feed this week! I discovered Raygun.io and started using it for my side project and I LOVE it. Get notified of your software’s bugs as they happen!Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!



© 2014 Scott Hanselman. All rights reserved.
     

How to use an Xbox One controller on your Windows PC

$
0
0

B00CMQTUSS_XboxOne_Controller_F_TransBG_RGB_2013The Xbox One controller is fantastic. Even if you don't have an Xbox One, the controller now works on a Windows PC with a standard micro-USB cable. Any Steam and Windows game that supports standard XInput works great. I've played Tomb Raider and Bioshock Infinite and both worked wonderfully. Everything works smoothly and even vibration feedback is supported.

I've previously used the Xbox 360 Controller's "Wireless Receiver Adapter" for Windows to pair XBox 360 controllers. It also works great, but I frankly prefer a plug-in and remove model, rather than having another adapter.

Soon the drivers for the Xbox One controller will be available on Windows Update. That means you'll be able to just plugin the Xbox One controller into any PC and the drivers will just download.

Until then, you'll want to install one these drivers depending on your machine:

Once these drivers are installed, plugin the Xbox One Controller to any USB port. There's a micro-USB port on the top of the Xbox One so you can use a regular USB cable. I used the one from my Kindle because it's very long.

The controller shows up as a Gamepad in Windows and works with any game that supports a standard joystick. Here's  a screenshot from my PC:

image

Here's an animated gif of me moving the controller and seeing the result in the Properties Dialog. You can see it's got all 10 buttons, 3 axes and the POV hat.

If you've got a Xbox One controller, you should grab a micro-USB cable and get this set up today. If you're considering a new PC controller, I recommend this controller even if you don't have an Xbox One.

Related Links


Sponsor: A big welcome to my friends at Octopus Deploy. They are sponsoring the blog feed this week. Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Easy accelerated 3D Games in a browser with JavaScript and WebGL using Three.js or Babylon.js

$
0
0

Let's ignore that we haven't got a web-agreed-upon way to do just about anything, much less basic line-of-business apps with data-bound text boxes over data, and just revel in the fact that we can do hardware-accelerated 3D graphics in our browsers with WebGL. This works today in all the latest browsers.

I noticed this fantastic mini-game promoting Assassin's Creed over at http://race.assassinscreedpirates.com that uses WebGL via a library called Babylon.js. On my Windows machine it runs perfectly in IE11, Chrome 37, or Firefox 30. (Yes, in retrospec, the version numbering for browsers is getting out of hand.)

Some folks on Macs have reported issues with WebGL. Check out https://www.browserleaks.com/webgl for YOUR browser's capabilities.

This Pirate Ship game is really worth checking out and it's fun for the kids. You can also check out the Developer Teardown and learn how they built it.

3D Assassin's Creed Pirates in my browser

I wanted to get a better understanding of exactly how difficult it is (or easy!) to get in to WebGL in the browser. I found this article over at SitePoint by Joe Hewitson and started with some of his sample code where he compares two popular WebGL libraryes, three.js and babylon.js. The Assassin's Creed game here is written using Babylon.js.

Three.js seem to be  a general layer on top of WebJS, aiming to make scene creation and animation easy. Using Joe's sample (that I changed a little) along with a texture.gif, I was able to make this spinning 3D cube easily.

There's a live example running at http://hanselstorage.blob.core.windows.net/blog/WebGL.html you can see in your modern browser. Below is just a static image.

I would have animated it but that would have been a meg. ;)

Three.js is on the left and Babylon.js is on the right. It doesn't really matter given the static image, but one think you'll notice immediately if you run the live sample is that you can zoom in and out, pan, grab, and manipulate the babylon.js cube. I could have hooked up some events to the three.js cube, or perhaps added a physics engine like Physijs and made it interact with the world, I suppose. It struck me though, that this little example shows the difference in philosophy between the two. Babylon seems to be more of a game engine or a library that wants to help you make games so there's interactions, collision detection, and lighting included.

Three.js supports many renderers, cameras, and lighting. You can use all WebGL capabilities such as lens flares. It supports all the usual objects and geometries as well. Their examples are extensive with over 150 coding examples covering everything you'd want to know from fonts, models, textures, to sounds. There's even an in-browser Three.js editor.

Babylon includes a lot including a physics engine from cannon.js built in, full scene graph, offline mode, textures, special effects and post processes, many cameras including Oculus Rift (!) lots of meshes. Babylon.js even supports standard Gamepads via like the Xbox One controller natively via the Gamepad API spec.

Anyway, here is the cube on the right from Joe's code that I modified slightly, using babylon.js:

// Babylon.js 
var canvas = document.getElementById('babylonCanvas');
var engine = new BABYLON.Engine(canvas, true);
var sceneB = new BABYLON.Scene(engine);
var camera = new BABYLON.ArcRotateCamera("camera", 1, 0.8, 10, new BABYLON.Vector3(0, 0, 0), sceneB);

var light = new BABYLON.DirectionalLight("light", new BABYLON.Vector3(0, -1, 0), sceneB);
//light.diffuse = new BABYLON.Color3(1, 0, 0);
//light.specular = new BABYLON.Color3(1, 1, 1);

var box = BABYLON.Mesh.CreateBox("box", 3.0, sceneB);
var material = new BABYLON.StandardMaterial("texture", sceneB);
box.material = material;
material.diffuseTexture = new BABYLON.Texture("texture.gif", sceneB);

sceneB.activeCamera.attachControl(canvas);

engine.runRenderLoop(function () {
box.rotation.x += 0.005;
box.rotation.y += 0.01;
sceneB.render();
});

I also commented out the lighting but you can see how easy it is to add lighting to a scene if you like. In this case there was a diffuse red light along with a specular white.

With babylon.js I could change the size of the scene by changing the size of the canvas. With three.js the width and height are pulled in programmatically from the enclosing div.


Here is the near-same box created with three.js.

// Three.js 
var div = document.getElementById('three');
var height = div.offsetHeight;
var width = div.offsetWidth;

var renderer = new THREE.WebGLRenderer();
renderer.setSize(width, height);
div.appendChild(renderer.domElement);

var camera = new THREE.PerspectiveCamera(70, width / height, 1, 1000);
camera.position.z = 400;

var sceneT = new THREE.Scene();

var cube = new THREE.CubeGeometry(200, 200, 200);

var texture = THREE.ImageUtils.loadTexture('texture.gif');
texture.anisotropy = renderer.getMaxAnisotropy();

var material = new THREE.MeshBasicMaterial({ map: texture });

var mesh = new THREE.Mesh(cube, material);
sceneT.add(mesh);

animate();

function animate() {
requestAnimationFrame(animate);

mesh.rotation.x += 0.005;
mesh.rotation.y += 0.01;
renderer.render(sceneT, camera);
}

Both libraries have amazing Examples Galleries and you should check them out.

Also note that there's a contest running until June 20th, 2014 over at http://www.modern.ie/en-us/demos/assassinscreedpirates where you'll create your own shader within the browser and submit it for judging. Contestants must be over 16 years of age and from one of the following countries: United States of America, United Kingdom, France, Germany, Spain, or Australia. The contest starts here and the grand prize is an Assassin’s Creed Collector’s Black Chest Edition and an Xbox One.

Create your Shaders in the browser

Even if you don't win, do check out the in-browser shader editor. It's amazing.


Sponsor: A big welcome to my friends at Octopus Deploy. They are sponsoring the blog feed this week. Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

UPDATED 2014: How to setup CrashPlan Cloud Backup on a Synology NAS running DSM 5.0

$
0
0

My backup planI still have a Synology 1511+ NAS and I still think it's lovely. I recommend Synology NAS's but I recommend ones with an Intel processor as I feel the ARM versions are underpowered. I run Plex on my Synology and while I've had a few small issues, I love it also.

Back in 2012 I wrote a post on How to set up CrashPlan Cloud Backup headless on a Synology NAS - Backup Strategies. If you are running a 4.x version of the Synology DSM software, read that post.

Since then however, Synology has upgraded it's main OS to "DSM 5.0" or greater and Java 7 can run on Synology. I've had some hassle getting my newly upgraded Synology running CrashPlan so here's a new writeup for DSM 5.0+ for 2014.

Remember, any good backup strategy follows the Backup Rule of Three.

  • 3 copies of anything you care about - Two isn't enough if it's important.
  • 2 different formats - Example: Dropbox+DVDs or Hard Drive+Memory Stick or CD+Crash Plan, or more
  • 1 off-site backup - If the house burns down, how will you get your memories back?

Step by Step: How to run CrashPlan on your Synology NAS with DSM 5.0

This gentleman at PCLoadLetter has prepared excellent packages that make it MUCH easier than before to get CrashPlan running on your Synology. However, his instructions assume a some technical ability and also require reading a LOT and visiting several pages within his site. It took me about an hour to really understand what was being said. Here's my simplified version of How To get CrashPlan on your Synology.

1. TURN ON THE "USER HOMES SERVICE" ON YOUR SYNOLOGY

Log in to your Synology from a web browser. Mine is http://server. Go to the Control Panel, then User, then User Home and click "Enable User Home Service." This will give the future "crashplan" user a "place to live."

Enable user home service

2. ADD HTTP://PACKAGES.PCLOADLETTER.CO.UK AS A NEW REPOSITORY IN THE SYNOLOGY PACKAGE MANAGER

On your Synology, from the web browser, go to the Package Center, then Settings, then Package Sources. Add http://packages.pcloadletter.co.uk as a new repository. I named it "PC Load Letter" but it doesn't matter.

image

3. ADD THE JAVA MANAGER

In the Package Manager, type Java, and install the Java Manager.

image

On your main computer (not the Synology) head over to www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html and download a "tar.gz" of Java. Get the right one for your system. I have an Intel x86 so I got the "i586" package.

Today (June 11th, 2014) I downloaded jdk-7u60-linux-i586.tar.gz but yours may have a newer number like "7u61." Now put that Java archive in a folder. Don't lose it.

Back on the Synology, go to the Java Manager and Install Java. From this dialog select the file you've just downloaded. It actually tells you all this on the dialog, too.

image

When you're done, Java Manager will look something like this.

image

4. INSTALL THE CRASHPLAN PACKAGE ON YOUR SYNOLOGY. STOP IT AND RESTART IT.

Staying in the Package Manager, go to Community, and search for Crash. Community is where "Other Sources" feeds into.

image

Once it's installed, wait a minute to two for it to calm down, then stop it, and start it again. It should look like this.

image

Click on View Log to confirm it's running.

image

Your log will have less stuff in it if you haven't configured CrashPlan from a client yet.

Remember this installation is *headless* so you'll need to connect to the Synology from a CrashPlan "client."

5. INSTALL THE CRASHPLAN CLIENT ON ONE OF YOUR MAIN COMPUTERS.

Go download and install the right CrashPlan client for you. After you've installed it, you'll need to POINT the client to your Synology.

You need to edit the "C:\Program Files\CrashPlan\conf\ui.properties" text file and put in the IP address of your Synology. My Synology is called "SERVER" so I opened a command prompt and typed "ping server" and was told its address is 192.168.1.18. I needed to run my notepad as administrator to edit this file.

    • NOTE: This is a Linefeeds only Linux text file so you'll want to use Notepad2 or something OTHER than Notepad so you don't corrupt this file. Make a copy.

Pointing ServiceHost to the right place

6. HOW DO YOU KNOW IT IS WORKING?

Run CrashPlan on your main computer to ensure it's successfully talking to your Synology.

  • You should see your Synology's name on the Settings Dialog
  • You should see CrashPlan Central in your Destinations if you have a CrashPlan subscription
  • You can select your files that exist on the Synology from the CrashPlan application on your main computer. Remember this CrashPlan client talks to the headless service running on your Synology.
  • You will likely have to sign into the CrashPlan client. When I did, even though I'd uninstalled and re-installed CrashPlan, it recognized I'd backed up before and it re-sync'ed over an hour. I didn't have to back everything up again!

The initial backup will likely take a LONG time so be patient - like for days or weeks. I am choosing not to backup super-large files like DVD backups, 60 gig VMs and other things. My #1 concern is family photos and personal files.

image

You can get CrashPlan+ and do one computer, or get CrashPlan+ Family and do up to 10 computers.

If I've made any mistakes here, do let me know in the comments and I'll update the post!

Related Links


Sponsor: A big welcome to my friends at Octopus Deploy. They are sponsoring the blog feed this week. Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Thinktecture.IdentityManager as a replacement for the ASP.NET WebSite Administration tool

$
0
0

In ASP.NET 2005 (v2 timeframe) there was a web-based tool called ASP.NET Website Administration tool that folks could use the edit users and generally administer the ASP.NET Membership database. This useful tool was removed in 2012 and is still missed.

Since then, ASP.NET has introduced ASP.NET Identity and community member Brock Allen created IdentityReboot with some significant improvements and extensions. Brock Allen and Dominick Baier have gone even further and created Thinktecture IdentityManager. It's the beginnings of a nice bootstrapped replacement for the missing ASP.NET Website Administration Tool. It's nicely factored and supports both ASP.NET Identity and their alternative called MembershipReboot.

I cloned Thinktecture.IdentityManager and ran it under Visual Studio 2013.2. It's nice when projects just clone cleanly and build. You'd be surprised how often that's not the case.

Thinktecture.IdentityManager plugs into the ASP.NET middleware pipeline, so switching the sample host to use ASP.NET Identity rather than their alternative MembershipReboot was as easy as commenting out a line and adding a line as seen below.

public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseIdentityManager(new IdentityManagerConfiguration()
{
//UserManagerFactory = Thinktecture.IdentityManager.MembershipReboot.UserManagerFactory.Create
UserManagerFactory = Thinktecture.IdentityManager.AspNetIdentity.UserManagerFactory.Create
});
}
}

Just run it and you'll get a nice Bootstrapped interface for creating, editing, and deleting users from your Identity database.

Identity Manager

Here you can see those same users in the SQL database that ASP.NET Identity uses.

There's the users created in the identity database

The whole application is written as a Single Page Application with an ASP.NET Web API handling the backend with Angular.js on the frontend.. You could run this application as it's own site and lock it down, of course, or host it within your existing website at something like /admin.

Serving Embedded Assets

Unrelated to the core functionality of Thinktecture.IdentityManager, one cool piece of functionality worth noting is how they are storing the HTML, CSS and other resources as embedded resources inside the Thinktecture.IndeityManager.Core assembly. This is not something you'd necessarily want to do yourself, but considering that they've got a nice embedded "manager" that they'll want to plug into other websites easily without causing issues with file dependencies, it's quite clever.

Here's the static page controller:

public class PageController : ApiController
{
[Route("")]
[HttpGet]
public IHttpActionResult Index()
{
return new EmbeddedHtmlResult(Request, "Thinktecture.IdentityManager.Core.Assets.Templates.index.html");
}
}

Then later in EmbeddedHtmlResult:

public static HttpResponseMessage GetResponseMessage(HttpRequestMessage request, string name)
{
var root = request.GetRequestContext().VirtualPathRoot;
var html = AssetManager.LoadResourceString(name);
return new HttpResponseMessage()
{
Content = new StringContent(html, Encoding.UTF8, "text/html")
};
}

Then later, all the CSS and JS are handled by the ".UseFileServer()" extension from Microsoft.Owin.StaticFiles, and then Microsoft.Owin.FileSystems handles the mapping the whole of the /assets URI space over all the resources

app.UseFileServer(new FileServerOptions
{
RequestPath = new PathString("/assets"),
FileSystem = new EmbeddedResourceFileSystem(typeof(AppBuilderExtensions).Assembly, "Thinktecture.IdentityManager.Core.Assets")
});
app.UseFileServer(new FileServerOptions
{
RequestPath = new PathString("/assets/libs/fonts"),
FileSystem = new EmbeddedResourceFileSystem(typeof(AppBuilderExtensions).Assembly, "Thinktecture.IdentityManager.Core.Assets.Content.fonts")
});

It's nice and clean, and a cool reminder about what you can do with a nicely factored system and a decent middleware pipeline.

A bright future

If you've got a ASP.NET system and are looking for a flexible and simple web-based administration tool for your Identity system, you should totally check out Thinktecture.IdentityManager. It looks like the team is gearing up for the possible release of this project as NuGet, so may have that to look forward to as well!

Remember that when people create cool projects like this, they are often doing this as volunteers out of the kindness of their hearts. They are often looking for feedback and comments, sure, but also validation of their idea as well as help. Open source help can come in the form of Pull Requests, Bugs and Issues, Documentation, Build Servers, and more. Head over and "star" the GitHub Thinktecture.IdentityManager project, and check it out!

Related Links


Sponsor: A big thank you to my friends at Octopus Deploy. They are sponsoring the blog feed this week. Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Download SQL Server Express

$
0
0

There's a funny blog post about how to download SQL Server Express from Long Zheng. It surprisingly how complex some companies make downloading things. I've always thought that a giant Download Now button is the best way, but perhaps that's just me?

Downloading SQL Server Express is unnecessarily hard, and it's made harder by the new Microsoft Download Center "download multiple files" interface that doesn't include descriptions or primary file recommendations. It should be a list of links, and you should be able to right click and Save As.

Introducing http://downloadsqlserverexpress.com 
(this short link goes directly to this post)

So, I've done the HTTP sniffing and work, and written this blog post in the hopes that it helps you (and I'm bookmarking it for myself, for the future).

Download SQL Server 2014 Express

Download SQL Server 2012 Express

Download SQL Server 2008 Express R2 SP2

You can get back here via downloadsqlserverexpress.com. Tell your friends.


Sponsor: A big thank you to my friends at Octopus Deploy. They are sponsoring the blog feed this week. Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Download Visual Studio Express

$
0
0

http://downloadvisualstudio.com

visual-studio-2013-logoYou liked http://downloadsqlserverexpress.com, so, here's http://downloadvisualstudio.com because I like you so much.

Here are the direct links to all the Express SKUs for Visual Studio. They are all completely free.

NOTE: I wrote this post on my own, and not as a representative of Microsoft. That's their copyrighted logo over there on the right, and these downloads are all Microsoft's.

Visual Studio 2013 Express for Web

Visual Studio Express 2013 for Web provides the core tools for creating compelling, innovative web applications and services. This includes the ASP.NET editors for HTML5, CSS3, JavaScript, etc.

Visual Studio 2013 Express for Windows (Desktop)

Visual Studio Express 2013 for Windows Desktop enables the creation of desktop apps in C#, Visual Basic, and C++, and supports Windows Presentation Foundation (WPF), Windows Forms, and Win32.

Visual Studio 2013 Express for Windows (Store)

The tools include a full-featured code editor, a powerful debugger, a focused profiler, and rich language support that you can use to build apps that you write in HTML5/JavaScript, C++, C#, or Visual Basic. Visual Studio Express 2013 for Windows also includes tools for Windows Phone 8.0 development and Windows Phone emulators that you can use to test how your Windows Phone apps will run on different devices.

Microsoft Visual Studio Team Foundation Server Express 2013

Visual Studio Team Foundation Server Express 2013 is a source-code-control, project-management, and team-collaboration platform at the core of the Microsoft suite of Application Lifecycle Management (ALM) tools.

Hope this helps! All these links were dug out of http://www.visualstudio.com/downloads/download-visual-studio-vs with Fiddler.


Sponsor: A big thank you to my friends at Octopus Deploy. They are sponsoring the blog feed this week. Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Exploring cross-browser math equations using MathML or LaTeX with MathJax

$
0
0

Let me just start by saying that I got a C in Calculus. It just didn't click for me. I'm aces at basic math, but you lost me at limits. That said, I have always found MathML to be fascinating, and I'm surprised that even now over 15 years after MathML's first release that is has such minimal browser support. Other than Firefox, and surprisingly iOS Safari, there's basically no widely available native support.

Perhaps it's because MathML is, well, XML. You wanna express something simple like 2+2, except stacked up with a line? Here's that:

<mstack>
<mn>2</mn>
<msrow> <mo>+</mo> <none/> <mn>2</mn> </msrow>
<msline/>
</mstack>

That's rather verbose. Most math folks that I've talked to (including a very nice Stanford professor I met on a plane recently) use LaTeX to express Math. The professor I met edited whole academic papers in raw LaTeX and compiled them to PDF. He was surprised when I explained that he was a programmer but perhaps didn't realize it!

LaTeX looks like this, for the 2+2 example:

\(2+2\)

I'd show you some more complex MathML examples but it would get pretty crazy very quickly.

The landscape for writing equations easily online using either MathML or LaTeX is, from my untrained eye, rather chaotic, link-rotty, and messy. Many Math and MathML online resources are full of link rot or their apps have been forgotten. While looking for a MathML to LaTeX convertor I found four different sits that promised to deliver only to discover that their back end systems are gone.

It seems that there are two places online that are shining examples of online Math rendering and that's MathJax and Math.StackExchange.com. MathJax is "an open source JavaScript display engine for mathematics that works in all browsers" and Math.StackOverflow.com is well, StackOverflow for Math people. What's special about Math.SO is that it's integrated MathJax's fantastic library into it's main editor.

NOTE: Not all StackExchange sites have the integrated math preview due to the size of the libraries involves. It's not something that you just "throw in just in case."

Here's an example where I'm typing some LaTeX into StackOverflow's site. In this case, I'm using Chrome.

image

They are using MathJax's library here. I can right-click on the equation, and ask "show math as MathML" and get this popup:

image

How does MathJax manage all this without actual browser support for MathML (or LaTeX?)

You configure MathJax like this, telling it what to look for when doing inline math. Sometimes it's bracketed by $ and $ and sometimes by \( and \).

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] }
});
</script>
<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>

For Tex as in this example, MathJax is using HTML and CSS, generating the inline Math equations into a series of DOM elements.

image

When using MathML proper, you can configure MathJax to use native MathML rendering when it's available. Only FireFox really supports that. This page lets you switch between HTML-CSS using Web Fonts, MathML, or SVG. SVG looks a little rough to me, but HTML-CSS always looks nice.

image

Bottom line, if you have a need to express mathematical equations of any kind online, you're going to want to use MathJax. Love them, thank them, appreciate them.

NOTE via Wikipedia: The MathJax project was founded by the American Mathematical Society, Design Science, and the Society for Industrial and Applied Mathematics and is supported by numerous sponsors such as the American Institute of Physics and Stack Exchange.

Oh, and if you're English, "Maths."


Sponsor: Many thanks to our friends at Octopus Deploy for sponsoring the feed this week. Did you know that NuGet.org deploys with Octopus? Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     

Trying Redis Caching as a Service on Windows Azure

$
0
0

redis_logo

First, if you have already have an MSDN subscription (through your work, whatever) make sure to link your MSDN account and an Azure Account, otherwise you're throwing money away. MSDN subscribers get between US$50 and US$150 a month in free Azure time, plus a 33% discount on VMs and 25% off Reserved Websites.

Next, log into the Azure Preview Portal at https://portal.azure.com.  Then, go New | Redis Cache to make a new instance. The Redis Cache is in preview today and pricing details are here. both 250 meg and 1 GB caches are free until July 1, 2014 so you've got a week to party hard for free.

image

Of course, if you're a Redis expert, you can (and always could) run your own VM with Redis on it. There's two "Security Hardened" Ubuntu VMs with Redis at the MS Open Tech VMDepot that you could start with.

I put one Redis Cache in Northwest US where my podcast's website is.  The new Azure Portal knows that these two resources are associated with each other because I put them in the same resource group.

image

There's Basic and Standard. Similar to Website's "basic vs standard" it comes down to Standard you can count on, it has an SLA and replication setup. Basic doesn't. Both have SSL, are dedicated, and include auth. I'd think of Standard as being "I'm serious about my cache" and Basic is "I'm messing around."

There are multiple caching services (or Cache as a Service) on Azure.

  • Redis Cache: Built on the open source Redis cache. This is a dedicated service, currently in Preview.
  • Managed Cache Service: Built on AppFabric Cache. This is a dedicated service, currently in General Availability.
  • In-Role Cache: Built on App Fabric Cache. This is a self-hosted cache, available via the Azure SDK.

Having Redis available on Azure is nice since my startup MyEcho uses SignalR and SignalR can use Redis as the backplane for scaleout.

Redis Server managing SignalR state

Mark Gravell over at StackExchange/StackOverflow has done us all a service with the StackExchange.Redis client for .NET on NuGet. Getting stuff in and out of Redis using .NET is very familiar to anyone who has used a distributed Key Value store before.

  • BONUS: There's also ServiceStack.Redis from https://servicestack.net that includes both the native-feeling IRedisNativeClient and the more .NET-like IRedisClient. Service Stack also supports Redis 2.8's new SCAN operations for cursoring around large data sets.
ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("contoso5.redis.cache.windows.net,ssl=true,password=...");

IDatabase cache = connection.GetDatabase();

// Perform cache operations using the cache object...
// Simple put of integral data types into the cache
cache.StringSet("key1", "value");
cache.StringSet("key2", 25);

// Simple get of data types from the cache
string key1 = cache.StringGet("key1");
int key2 = (int)cache.StringGet("key2");

In fact, the ASP.NET team announced just last month the ASP.NET Session State Provider for Redis Preview Release that you may have missed. Also on NuGet (as a -preview) this lets you point the Session State of your existing (perhaps legacy) ASP.NET apps to Redis.

After pushing and pulling data out of Redis for a while, you'll notice how nice the new dashboard is. It gives you a great visual sense of what's going on with your cache. You see CPU and Memory Usage, but more importantly Cache Hits and Misses, Gets and Sets, as well as any extraordinary events you need to know about. As a managed service, though, there's no need to sweat the VM (or whatever) that your cache is running on. It's handled.

image

From the Azure Redis site:

Perhaps you're interested in Redis but you don't want to run it on Azure, or perhaps even on Linux. You can run Redis via MSOpenTech's Redis on Windows fork. You can install it from NuGet, Chocolatey or download it directly from the project github repository. If you do get Redis for Windows (super easy with Chocolatey), you can use the redis-cli.exe at the command line to talk to the Azure Redis Cache as well (of course!).

It's easy to run a local Redis server with redis-server.exe, test it out in develoment, then change your app's Redis connection string when you deploy to Azure.


Sponsor: Many thanks to our friends at Octopus Deploy for sponsoring the feed this week. Did you know that NuGet.org deploys with Octopus? Using NuGet and powerful conventions, Octopus Deploy makes it easy to automate releases of ASP.NET applications and Windows Services. Say goodbye to remote desktop and start automating today!



© 2014 Scott Hanselman. All rights reserved.
     
Viewing all 1148 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>