TypeScript will not compile on save in Visual Studio 2013

It seems that many having problem that TypeScript not will auto compile on save in Visual Studio 2013. TypeScript was earlier a part of the Web Essentials extension, but it is not included anymore. So the first step is to ensure that the TypeScript plugin is installed, if not it is available for download here, http://www.microsoft.com/en-us/download/details.aspx?id=34790.

If you still have the problem you need to activate auto compile on save for TypeScript.

To enable auto compile on save for TypeScript follow following steps:

  1. Go to Options under the Tools menu.
  2. Expand options for Text Editor
  3. Expand options for TypeScript
  4. Expand options for Project
  5. Check "Automatically compile TypeScript file which are not part of the project"

That helped me when my TypeScripts not compiled on save.

 

 

Workaround for invalid markup problems when developing for Windows Phone

Every time I open up a Windows Phone Project in Visual Studio 2013 I got a lots of  errors in the XAML markup. The designer shows "Invalid markup" and the error list is long. I found a workaround for this:

  1. Open Configuration Manager for your Visual Studio solution
  2. Change platform for the Windows Phone Project to x86
  3. Build the Project and the errors is gone
  4. Open Configuration Manager again and change back to "Any CPU"

After follow above steps it will work until you start Visual Studio again.

Windows Azure Mobile Services in Portable Class Library

In my current project, a multiplayer game for mobile devices I only using Windows Azure Mobile Services as backend. The game will be available for multiple platforms and I will use Xamarin for iOS and android.

When using Xamarin I can reuse a lot of code if I using PCL (Portal Class Library) that i shipped with Visual Studio. When creating a new PCL-project you can choose which taget platforms the project will build for, in my case Windows Phone, Windows Store, Xamarin iOS and Xamarin Android.

In order to reuse so much code as possible I want to have the communication with my backend in PCL. When using Windows Azure Mobile Services I can have all communication there except for the code for authentication. But then I put an interface i PCL and each platform will have a specific implementation of the interface.

But where to find the Mobile Services assemblies for PCL? I installed Mobile Services via NUGET to my Windows Phone project (Windows Phone is my first platform). But Mobile Services was not just installed to my Windows Phone project, I also got the assemblies for PCL (and other platforms) i my packages folder. It enabled me to add the assemblies manually to the PCL-project.

Solution: Web role deploy problem with Azure SDK 2.2

When I updated my Windows Azure SDK to 2.2 I got a problem when deploying the package of my MVC 4 web site from Visual Studio to a web role in Windows Azure. The message I got was that a exception has occored under recycling and that I should check for unhandled exceptions or configurations errors.

Finnaly I found the solution, setting Copy local to true on the reference to the assembly for WindowsAzure.ServiceRuntime made it work again.

Visual Studio performance and local workspace for TFS

I have had performance issues with Visual Studio for a long time. For example open projects, adding files and installing NuGet packages had taken very long time.

Last week I talked one of our TFS experts at Sogeti and he asked me how many files I had in my TFS workspace. I had more than 60 000 files in the workspace. I said that it could be the problem.

When using local workspace, Visual Studio scanning the file system for changes. If a workspace contains more than 50 000 files it could affect the performance.

I tried to split my workspaces into smaller parts, and he had right, Visual Studio is much faster now than before.

The conclusion of this is, try to keep your workspace as small as possible and if you have to have a workspace that contains more than 50 000 files, use server workspace instead.

Extensions for Visual Studio 2012

Visual Studio 2012 is a very good tool out of the box. But with a few extensions it will be even better. I using following extensions:

ReSharper 7
I can't live without it! It makes my day much more effective.

VSCommands - Free
The feature I use most is the button that attach the debugger to IIS-processes.

Productivty Power Tools - Free
An add-on with small feature thats makes me more productive.

Web Essentials - Free
An extensions with a lot of features that helps me with my web projects.

TFS Power Tools - Free
Adds extra features fot Team Explorer. For exampled it adds more check in policies.