【问题标题】:Namespace confusion with same structure具有相同结构的命名空间混淆
【发布时间】:2021-07-17 19:57:57
【问题描述】:

当我尝试将命名空间 Azure.Storage.Blobs 添加到类时遇到问题。 它是由另一个名为 CopmanyName.Azure 的引用 NuGet 包引起的

当我使用 Azure.Storage.Blobs 添加时,它会显示 CopmanyName.Azure 的子命名空间。

Problem

但是我想从 Azure.Storage.Blobs 添加使用。 这是由于加工项目结构 CompanyName.Azure.D365FO 和引用 NuGet 包 Company.Azure 造成的。

查看主项目结构:ProjectStructure 以及引用项目的结构:ReferencedProjectStructur

有没有办法在不改变当前项目中命名空间结构的情况下解决这个问题?所以我得到了下面的结果。

namespace CompanyName.Azure.Model.CSP
{
#if NET46
    using Microsoft.WindowsAzure.Storage.Blob;
#else
    using Azure.Storage.Blobs;
#endif

【问题讨论】:

标签: c# reference namespaces


【解决方案1】:

自己找到的。 希望其他人可以使用一次。

添加全局::

使用全局::Azure.Storage.Blobs;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-06
    • 2012-03-29
    • 2014-04-14
    • 2011-12-01
    • 2022-06-17
    • 1970-01-01
    • 1970-01-01
    • 2023-01-30
    相关资源
    最近更新 更多