question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azure Storage Name Space Collision

See original GitHub issue

Language: 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

  1. Create new project from Enterprise Bot Template v0.3
  2. 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 image

Prior version Enterprise Bot dependencies image

Additional context

Similar issue is discussed here, https://github.com/Azure/azure-storage-net-data-movement/issues/159

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
markbeaucommented, Mar 19, 2019

Hi @gabog, just changing the “Microsoft.AspNetCore.All” include reference in .csproj per https://github.com/Microsoft/botbuilder-dotnet/issues/1421 did the trick.

  <PackageReference Include="Microsoft.AspNetCore.App" />

Thanks for your help chasing this down.

1reaction
gabogcommented, Mar 19, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Storage Name Space Collision · Issue #1478
Azure.Storage.Blob having same namespace, and same object type name so attempting to reference. ... Azure Storage Name Space Collision #1478.
Read more >
Naming rules and restrictions for Azure resources
Shows the rules and restrictions for naming Azure resources. ... This article lists resources by resource provider namespace.
Read more >
Azure CloudStorageAccount namespace conflict in various ...
But there seems to be a namespace collision on the type CloudStorageAccount between one declared type in Microsoft.Azure.Cosmos.Table and ...
Read more >
Storage considerations for Azure Functions
Use a separated storage account for each function app or slot involved in the collision. · Rename one of your function apps to...
Read more >
Naming and Referencing Containers, Blobs, and Metadata
This topic describes naming and referring to containers, blobs, metadata, and snapshots. A storage account can contain zero or more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found