61

After successfully upgrading my cloud service to the new "Azure SDK for .NET 2.5.1" I got the following error when trying packaging/publishing.

Could not load file or assembly 'Microsoft.WindowsAzure.Packaging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.5\Microsoft.WindowsAzure.targets

The related line in the "Microsoft.WindowsAzure.targets" config file is 2930 which obviously is related to CSPack.

<CSPack
  ServiceDefinitionFile="@(TargetServiceDefinition)"
  Output="@(PublishServicePackage)"
  PackRoles="@(Roles)"
  SiteMapping="@(SiteMapping)"
  RoleProperties="@(RoleProperties)"
  ImportedModules="@(ImportedModules)"
  CopyOnly="false"
  >
</CSPack>

So I went on to create a fresh new Azure Cloud service in a fresh new project to see if something went wrong with the upgrade. Unfortunately the problem persists.

Is there a workaround or will I have to rollback to v2.4 (that will cause me significant amount of pain)

I am running on VS 2013 update 4.

cleftheris
  • 4,626
  • 38
  • 55

2 Answers2

90

Sorry for the trouble, everyone. We are investigating what's causing this. It looks like there is an odd behavior with our installers where in some environments those two binaries are not installed correctly.

We did discover if the 2.5.1 Azure Authoring Tools is removed and reinstalled, the missing binaries will be installed correctly. So if you run into this issue, please remove Authoring Tools v2.5.1 from Programs and Features, and reinstall via either the Web Platform Installer or the direct download links:

http://download.microsoft.com/download/1/E/7/1E76DD6F-66F1-47E0-A76A-3BBAAC617316/MicrosoftAzureAuthoringTools-x64.msi

http://download.microsoft.com/download/1/E/7/1E76DD6F-66F1-47E0-A76A-3BBAAC617316/MicrosoftAzureAuthoringTools-x86.msi

Apologies for the inconvenience. We will continue the investigation.

Wayne Kuo
  • 926
  • 6
  • 3
  • Do you know if the versions of the missing dlls are different from those in the v2.4 SDK? I am wondering if those of us that fixed the problem following my answer should try the reinstall anyways. Thanks – cleftheris Mar 28 '15 at 13:09
  • @cleftheris, the versions on those dlls are different between releases. (You can verify this by looking at the File Properties) I would not recommend mixing in those dlls from previous releases. – Wayne Kuo Apr 01 '15 at 19:00
  • I had the same issue when I tried package my MVC solution to deploy in Azure and it work perfect with this error message as well "Error 280 Could not load file or assembly 'Microsoft.WindowsAzure.Packaging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. O sistema não pode encontrar o arquivo especificado. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.5\Microsoft.WindowsAzure.targets 2930 5 MVC.Azure" – Rodolpho Brock Apr 02 '15 at 19:01
  • We had the same issue on our build server, not on dev machines. This worked perfectly. – Matt Apr 15 '15 at 11:04
  • I am one of a bunch of folks having a possibly related issue where Web Platform Installer thinks the update has been installed but VS keeps offering the update (see http://stackoverflow.com/q/29443473/1637105). I haven't tried publishing yet to see if anything is actually broken. I DID try the uninstall/reinstall thing but that didn't fix the above problem. – Bob.at.Indigo.Health Apr 22 '15 at 21:09
  • 7
    This worked for me simply using the "Repair" option after running the installer. – Jon Apr 28 '15 at 19:37
  • 3
    Note that even though I had Azure SDK 2.6 installed I still had this error. I had to download the 2.5.1 package above and then do a repair on it as @JonathanFreeland suggested to get it working. – Rory McCrossan Jul 02 '15 at 12:57
  • Worked straight off for me. Cloud all instances of VS first and didn't even need to reboot – Dan Harris Jul 23 '15 at 09:12
10

I searched locally for the required dll and found it in almost all previous versions of the Azure .Net SDK had it (from v2.0 onwards I believe).

Search results

So in order to fix this you need to copy the following dlls from the previous version v2.4 of the SDK to the similar location for v2.5.

SDK installation paths.

  • Src location: "C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.4\bin"
  • Dst location: "C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin"

Dlls to copy (missing):

  1. Microsoft.WindowsAzure.Packaging.dll
  2. Microsoft.WindowsAzure.ServiceModel.Common.dll

Since there may be a better answer to this I will not mark this as an answer yet.

dotnetengineer
  • 1,254
  • 1
  • 9
  • 18
cleftheris
  • 4,626
  • 38
  • 55
  • 3
    FWIW if you don't have the full 2.4 SDK installed you can just download and install the [MS Azure Authoring tools 2.4.msi](http://www.microsoft.com/en-gb/download/details.aspx?id=43709) which has the DLLs you need. – perlyking Mar 26 '15 at 17:05
  • I followed your answer and it worked for me too (I had to restart Visual Studio after having copied the required dlls). That said, it's strange those DLLs were not shipped with the 2.5.1 version. – ken2k Mar 26 '15 at 17:18
  • @ken2k seems like this release was in some kind of rush because of the [Azure Apps announcement](https://weblogs.asp.net/scottgu/announcing-the-new-azure-app-service). There was a similar problem in the v2.5.0 release. I believe there will be a refresh of the installer soon. – cleftheris Mar 26 '15 at 18:45
  • 2
    Sheesh. You'd think Microsoft could at least test each of its downloads before release. I have wasted several hours this morning on this. – dotnetengineer Mar 26 '15 at 18:52
  • Make sure to restart VS for the changes to take effect. Thanks for saving me a major headache this morning. – dreamgt Mar 27 '15 at 14:49