How to Upgrade Windows Azure Tools for Microsoft Azure Cloud Service projects. (Continuous Integration Builds failing on TFS/ Teamcity Build Server)

Scenario : Recently I was involved in writing a cloud service have used Visual Studio 2013 to create a cloud service projects. I was able to use compile and run the application on the local development machine which is windows 7. Now, I have a need to run the Continuous Integration build on the TFS Build server.

Problem:

Unable to run the Continuous Integration Builds. When running the Continuous Integration Builds it fails with the below error message:


"C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiCloud.WindowsAzure.sln" (default target) (1) ->
 "C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj" (default target) (3) ->
 (ResolveAssemblyReferences target) ->
 C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj]
 C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.WindowsAzure.ServiceRuntime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj]

 "C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiCloud.WindowsAzure.sln" (default target) (1) ->
 "C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj" (default target) (3) ->
 (CoreCompile target) ->
 WebRole.cs(5,30): error CS0234: The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?) [C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj]
 WebRole.cs(6,30): error CS0234: The type or namespace name 'ServiceRuntime' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?) [C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj]
 WebRole.cs(10,28): error CS0246: The type or namespace name 'RoleEntryPoint' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\diprojectsdemo\DiCloud.WindowsAzure\src\DiCloud.WindowsAzure\DiWebRole\DiWebRole.csproj]

Solution:

Logon to the Build Server, Install Microsoft Azure SDK either by using the Windows Platform installer or Download the standalone install (http://azure.microsoft.com/en-gb/downloads/archive-net-downloads/) . You can cherry pick which version you want to install. I would prefer to have the latest version if there are no dependencies.

If this does not solve the problem there might be a mismatch of version on the development team and the one on the build server. How to check and upgrade

Open the solution and navigate to the Azure Cloud Service Project properties, under the application Tab, check what is the version its being used. (This can also be found from the assembly version you see in the error message). You won’t be able to see the upgrade options because no other latest version is installed on the development machine.


In this scenario we are using Azure tools 2.2, I have chosen the path to upgrade to latest version. To install latest version of Azure Tools (2.5.1 at the time of writing this article ), Please make sure visual studio 2013 update 4 is installed (VWDOrVs2013AzurePack.2E2.2E5.exe).

Once the latest tools are installed you can see the option upgrade available as shown in below Picture


Click on upgrade and make sure you check in the Azure Cloud Service project and also the associated web/worker role projects to solve the assembly reference.

Hope you enjoyed the article and thought it’s been useful.

Leave a Reply

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