Azure Storage Name Space Collision
See original GitHub issueLanguage: C#
Description
Microsoft.AspNetCore references Microsoft.WindowsAzure.Storage while Microsoft.Bot.Builder.Azure references Microsoft.Azure.Storage.Blob having same namespace, and same object type name so attempting to reference ‘CloudBlockBlob’ in my bot code results in the following complier error.
Compiler Error: The type ‘CloudBlockBlob’ exists in both ‘Microsoft.Azure.Storage.Blob, Version=9.4.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ and ‘Microsoft.WindowsAzure.Storage, Version=8.1.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
I haven’t yet figured out a work around. Any ideas?
To Reproduce
- Create new project from Enterprise Bot Template v0.3
- Add code:
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
. . .
string sasUri = $"{storageConfig.ContainerName}{storageConfig.ConnectionString}";
CloudBlobContainer container = new CloudBlobContainer(new Uri(sasUri));
CloudBlockBlob blob = container.GetBlockBlobReference(blobName);
I’ve tried to reference Microsoft.Azure.Storage instead, but without success.
Expected behavior
Project compiles without namespace conflict error
Screenshots
Current version Enterprise Bot dependencies
Prior version Enterprise Bot dependencies
Additional context
Similar issue is discussed here, https://github.com/Azure/azure-storage-net-data-movement/issues/159
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hi @gabog, just changing the “Microsoft.AspNetCore.All” include reference in .csproj per https://github.com/Microsoft/botbuilder-dotnet/issues/1421 did the trick.
Thanks for your help chasing this down.
Hi @markbeau, a fix for the new template will be released once the PR lined above is merged in to master, to fix your project today, follow the instructions outlined in #1421.
Thanks