Resolving Functions Tooling incompatibility with Azure SDK 3.0.0

Reference : https://github.com/Azure/Azure-Functions/issues/203

This post is inspired by the open issue issue reported in GitHub.

Challenges :
- When i stepped in to new team on Mar 7 2016, i tried installing all the necessary components and upgraded couple of items through the Web Platform Installer with respect to Azure
- When i opened the solution, some of the projects are not loading properly (Azure Functions). And i could not see an option to create Azure function in the New Project Template. But it works for my colleagues as they have not installed or upgraded recently.
- I was totally blocked to contribute to the development as our Project used multiple Azure Functions inspite of multiple workarounds to resolve this.

Troubleshooting Story :
Tired of unusual behaviour on my system, i tried the following, but nothing worked for me.

  • UnInstalled VS 2015, Restarted and Installed Fresh Copy (twice)
  • UnInstalled Azure SDK 3.0
  • Tried devnev /resetsettings, devenv /installvstemplates, devenv /setup. : None of this resolved the Issue.
  • UnInstalled Azure SDK 2.9.6 and Re-Installed
  • Copied the Project Templates from Peer and Copied to ProjectTemplates Cache. But the error says “The template location not found”
  • Explored the Registry Package to check whether that ClassId (AzureFunctions) is registered. But i can’t see one

I got suspicious and felt through some update on my system broke this functionality. Then i started resolving the issue by troubleshooting them at system level (Registries and Missing DLL’s)

Here the Path i took :

  1. Compared the Files and Folder between my System and my Colleagues System. Took the copy of all related files from my friends system
  2. Visual Studio uses the Registry to Bind the Package and Item Templates listed in the New Project. The recent release of Azure SDK 3.0 seems to remove the registry entries and dependency files which caused the incompatiblity.

[HKEY_USERS\S-1–5–18\Software\Microsoft\VisualStudio\14.0_Config\Projects\{33AD0EE8-D99B-4E14–8CD9–3F56ABEF97A2}]

Final Workaround :

Finally i resolved the issue and was able to use the Azure Functions in a normal way. I am not recommending this solution for everyone as this involves editing Registry Settings. Please try yourself at your own risk.

I would like to share how i resolved this issue. You can try out and let me know if you have any issues. Note : Apart from this you may get additional errors and from the error logs you can easily identify what is missing and then add the respective entries either in the registry or folder. Hope this helps someone who want to resolve the blocker in Azure Functions.

  1. Copied the files and folders to the respective path from my colleagues system.

Folders Copied :

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplates

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ItemTemplates

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools Azure\ItemTemplates

Folders Deleted :

The following folder in this location C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\

ItemTemplatesCache
ProjectTemplatesCache

2. Identifed all the registry settings and prepared the registry file to add missing entries.

Files Copied :

1.Missing files in this folder are copied. C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools Azure\

Registry Entries

///////////////////////////////////////////////////////////

Windows Registry Editor Version 5.00

[HKEY_USERS\S-1–5–18\Software\Microsoft\VisualStudio\14.0_Config\Projects\{33AD0EE8-D99B-4E14–8CD9–3F56ABEF97A2}]
@=”ProjectFactory”
“ProjectFactoryPackage”=”{3347bee8-d7a1–4082–95e4–38a439553cc2}”
“Package”=”{bf415174–6476–47f7–9853–936cffec7708}”
“DisplayName”=”AzureFunctions”
“DisplayProjectFileExtensions”=”#2"
“DefaultProjectExtension”=”funproj”
“PossibleProjectExtensions”=”funproj”
“Language(VsTemplate)”=”AzureFunctions”
“ProjectTemplatesDir”=”C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools Azure\\ProjectTemplates”
“DisplayProjectType(VsTemplate)”=”Azure Functions”

[HKEY_USERS\S-1–5–18\Software\Microsoft\VisualStudio\14.0_Config\Projects\{33AD0EE8-D99B-4E14–8CD9–3F56ABEF97A2}\AddItemTemplates]

[HKEY_USERS\S-1–5–18\Software\Microsoft\VisualStudio\14.0_Config\Projects\{33AD0EE8-D99B-4E14–8CD9–3F56ABEF97A2}\AddItemTemplates\TemplateDirs]

[HKEY_USERS\S-1–5–18\Software\Microsoft\VisualStudio\14.0_Config\Projects\{33AD0EE8-D99B-4E14–8CD9–3F56ABEF97A2}\AddItemTemplates\TemplateDirs\{bf415174–6476–47f7–9853–936cffec7708}]

[HKEY_USERS\S-1–5–18\Software\Microsoft\VisualStudio\14.0_Config\Projects\{33AD0EE8-D99B-4E14–8CD9–3F56ABEF97A2}\AddItemTemplates\TemplateDirs\{bf415174–6476–47f7–9853–936cffec7708}\/1]
@=”AzureFunctions”
“TemplatesDir”=”C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools Azure\\ItemTemplates”
“SortPriority”=dword:00000000

///////////////////////////////////////////////////////////

Show your support

Clapping shows how much you appreciated Nirmal Kumar’s story.