简体   繁体   中英

Cannot publish to Azure - Microsoft.WindowsAzure.Storage.CloudStorageAccount ctor doesn't match

Recently I updated my Azure tools, installing 2.6 on my machine. 2.5 is still installed and I have a few projects that use 2.5 between developers so I have been hesitant to update them. However, I have noticed some strange behavior with references (although present and showing okay in the tree) not resolving in the C# code and, more importantly, I cannot publish my 2.5 applications to Azure. During the publish I get:

Method not found: 'Void Microsoft.WindowsAzure.Storage.CloudStorageAccount..ctor(Microsoft.WindowsAzure.Storage.Auth.StorageCredentials, System.Uri, System.Uri, System.Uri)'.

I am using the 4.3.0.0 version of Microsoft.WindowsAzure.Storage, installed through NuGet and it doesn't contain this ctor signature. I'm not sure what is causing this to come up. I've tried reinstalling the NuGet pacakges, reading references and updating my Visual Studio tools; I'm kind of at a loss as to what to try further.

Thanks in advance.

Please check the storage client library version that you were using before the upgrade.

With version 4.0 of Storage Client Library, support for Azure File Service was included (See change log here: https://github.com/Azure/azure-storage-net/blob/master/changelog.txt ). To support this, the constructor of CloudStorageAccount changed from:

Microsoft.WindowsAzure.Storage.CloudStorageAccount..ctor(Microsoft.WindowsAzure.Storage.Auth.StorageCredentials, System.Uri, System.Uri, System.Uri)

to

Microsoft.WindowsAzure.Storage.CloudStorageAccount..ctor(Microsoft.WindowsAzure.Storage.Auth.StorageCredentials, System.Uri, System.Uri, System.Uri, System.Uri)

4th Uri parameter is for File Service.

If your previous code was using version 3.x of library and if you're using 4.x version of the library, then you will get this error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM