Wednesday, January 25, 2012

Windows Phone 7 emulator and computer keyboard

I'm currently working on the Windows Phone version of Blind Friends and I'm using the Facebook C# SDK Framework (like the ASP.NET MVC version).

I had to debug the login page and I quickly got bored of writing my email/password in the emulator... If you have a Windows Phone device, you can enter these information with your fingers but if you debug with the emulator, you maybe want to use your computer's keyboard.

By default, the keyboard is not enabled but activating it on your development computer is easy:

  • to enable the keyboard: press the PAGE UP key (or PAUSE key)
  • to disable the keyboard: press the PAGE DOWN key (or PAUSE key, again)

It's fast and convenient, but some details may annoy you... For example, if you enable the keyboard, the emulator will not support the orientation changes. You have to disable the keyboard, and then rotate the emulator.

For more information on the keyboard mapping: http://msdn.microsoft.com/en-us/library/ff754352(v=VS.92).aspx

Tuesday, January 24, 2012

Windows Azure and Application Pool Timeouts

This article may help you if you use Windows Azure and you want your application to always responds as quickly even after a long period without use...

With default parameters, your app pool is shut down after 20 minutes of inactivity and your application will take a bit more time to respond.

You can simply change the settings if you want your application pool is never shut down:

- First step: create a new folder called "tasks" at the root of your Web Project and add a new file called "timeout.cmd" with this line of command:

   1:  %windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00

Once the file created, you need to put the "Copy to Output Directory" property to "Copy Always".


- Second step: add this into ServiceDefinition.csdef (at same level than "<Sites>", "<Endpoints>", ...):

   1:  <Startup>
   2:        <Task commandLine="tasks\timeout.cmd"
   3:              executionContext="elevated" />
   4:  </Startup>


You can find the code here: