Office templates not available in VS2012 with ‘converted’ project.

Some time ago I hit a somewhat strange issue where I opened one of our existing projects targeting Office 2010, .NET 4 Client in Visual Studio 2010 and moved this project forward to Visual Studio 2012. After the migration I did not see the Office templates in the Add New Item dialog in Visual Studio 2012.

When adding a ‘new item’ to the project it did not display the Office options to insert a Ribbon for instance:

OfficeTemplatesMissing1

When you create a -new- project, the Office Templates show up without issues:

OfficeTemplatesMissing2

What we see here is a minor issue in the migration code in Visual Studio 2012 and is relatively easy to solve by manually editing the .csproj project file.

What you need to do here to fix this minor issue is to go and look for the entry in the project file called AddItemTemplatesGuid. The migration code changed the AddItemTemplatesGuid property from

AddItemTemplatesGuid="{51063C3A-E220-4D12-8922-BDA915ACD783}”
TO
AddItemTemplatesGuid="{147FB6A7-F239-4523-AE65-B6A4E49B361F}”

Changing it back to the original value makes the Add Item dialog start showing Office category correctly again. So the right Guid should be: "{51063C3A-E220-4D12-8922-BDA915ACD783}”

You can easily check this by creating a small new AddIn project, open the project .csproj file in your editor and search for the AddItemTemplates Guid again. You will see that it is the “{51….” one as specified above. Even better, if you go back into your source control software (TFS or other source control option) environment and look at the value in your original file before migration.

So if you also encounter the fact that you don’t get the Office Templates when adding a New Item in your Office project, dive right in to your .csproj file and change the AddItemTemplatesGuid back to its original value the one that was there before migrating your code.

An update rollup is available for Visual Studio 2010 Tools for Office Runtime 4.0

Today a rollup update for Visual Studio 2010 for Office Runtime 4.0 that was auto-magically released November 13th has been deployed to (at least one of) my machines.

This rollup fixes about four issues with the Visual Studio 2010 Tools for Office Runtime and one fix in particular of a bug that I found and posted on Connect:

http://connect.microsoft.com/VisualStudio/feedback/details/705610/cached-data-storage-fails-in-protected-documents

We worked close with the VSTO development team to identify and isolate the issue and they were able to solve it for us to allow us to continue working with the runtime.

The issue isn’t touched a lot beside our organization (it is a specific user scenario not used by many others) so distribution of the fix was ‘delayed’ until deployment of yesterdays rollup (a hotfix could be requested for in case you ran into it).

So as of yesterday the fix became available for everyone along with a couple of other fixes. Again, probably not many of you will notice any differences but I’m sure the users using one or more of the fixed features will be pleased to see it released in the main branch of the product.

If you want to download the VSTO Runtime on your own, not waiting for Microsoft Update or WSUS you can download it at the Microsoft Download Center.

On a side note, also Office 2013 tooling was released this week to enable you to build VSTO solutions targeting Office 2013 but I will spend some time on that in a separate blog post.

%d bloggers like this: