Jisho, a Windows 8 Metro App

After having attended the Night of Windows 8, where I had a blast (sorry about the little glass though, that really wasn’t my fault), I got an idea for a new Windows 8 app: an English/Japanese dictionary. I happen to be studying Japanese, so that’s how I got this crazy idea.

And because screenshots usually say more than words:

A screenshot of "Jisho"

Continue reading

TechDays 2012

TechDays 2012 are over, here are my 2 cents:

Windows 8 & WinRT
Home users had to get used to having a Start button/menu since Windows 95/NT, and now, Microsoft has decided to remove the Start button in Windows 8, and to replace the Start menu with an entire screen of applications.
But I can imagine running Windows 8 on a tablet PC (or as Microsoft wants to call it: slates), touch feels more natural on a tablet than on a desktop. Maybe this (or my opinion) will change when Kinect for Windows is released, so you can use your Windows 8 desktop PC with gestures. And I hope that Microsoft will push Win8/Metro through to the new Windows Phone 8, so developers can create apps for Windows 8 and WP8 in XAML+C# or even HTML+JS.
I do not, however, see business users standing in line to accept Windows 8.

HTML5, ASP.NET 4.5 & MVC4
HTML5 can be used already, but we’ll have to support older browsers as well. Luckily, there are libraries like Modernizr to help us. I do believe that HTML5 + CSS3 will make web developers happier in terms of supporting multiple devices in one go.
ASP.NET 4.5 has some improvements like typed databinding, which is very useful, while MVC4 has an updated template site and now supports OpenID authentication out of the box. Furthermore, creating a REST API has become easier to do.

WebSockets
WebSockets are handy to keep a connection open, while keeping load/data usage to a minimum. But again, this is only supported in some browsers at the moment. You can use long polling to support older clients, but then you have to do everything in long polling, or write the same code twice. Luckily, there is a library called SignalR, which enables you to write your code once, and SignalR will make sure that the client browser uses the best possible method to keep a connection established.

Roslyn, or Compiler as a service
Roslyn shall not be present in VSnext. Furthermore, we didn’t see any useful examples to use CAAS in business applications. JetBrains should be able to speed up ReSharper though by using CAAS and the new syntax expression tree.

Async/await
Probably the most hyped new feature of .NET 4.5, which is (of course, this is my opinion) nothing more than compiler magic. The compiler generates a state, thread and callback for you when you await an asynchronous call. So do not expect magic, unicorns and faster applications, because you have to know that in the binary, a lot more code has been generated than your one line of await SomethingAsync().

TechDays 2012 – My Agenda

Here’s the list of sessions I’d like to attend at TechDays Belgium 2012:

Tuesday:

  • Opening Session with Scott Guthrie
  • Welcome to the Metro Application Platform
  • A Look at ASP.NET MVC 4
  • The Future of C# and Visual Basic
  • What’s new in Visual Studio 11 for Application Lifecycle Management
  • Introducing Windows Runtime in Windows 8

Wednesday:

  • ScottGu Unplugged / Windows Debugging and Troubleshooting
  • Project Roslyn: Exposing the C# and VB compiler’s code analysis
  • The zen of async: Best practices for best performance
  • Building Cross-Platform Mobile Applications with HTML5
  • MVVM & WCF RIA Services: an architectural story
  • SignalR. Code, not toothpaste

Thursday: Web dev track

EF Code First & The model is being created

I am building a small MVC 3 website using Entity Framework Code First to connect my domain model to my SQL database. When I finished creating my mappings and tried to run the website for the first time, I got a strange error which I’d never seen before:

“The context cannot be used while the model is being created”

When debugging, this error popped up after the OnModelCreating override in my DbContext class, so normally, the model had already been created. A search on Google (or Bing for that matter) gave only a small number of results, one stating that there was a problem with EF CTP5 code first when using many-to-many relations. Since my model has a many-to-many relationship, I decided to convert it to 0..1 to many and try again.

Alas, the same exception kept appearing. I rolled back my changes to the model (back to many-to-many) and generated a data model using Linq2Sql to see if that would work. With that data model, I could query my database. But I really wanted to use EF and my own domain classes, so I deleted the data model (knowing that my database configuration at least was correct) and looked further.

And then I finally saw the problem… My data project, where I have created my mapping classes and my DbContext referenced EntityFramework version 4.1.10715.0, but my MVC project referenced version 4.1.10331.0 . Needless to say that this difference was the cause of the exception being thrown.