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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.