如何在C#中添加新的命名空间

时间:2016-07-14 12:29:15

标签: c# visual-studio azure namespaces

我正在使用C#代码创建MVC项目。我有

`CloudConfigurationManager`

使用read db值。它显示红色错误。我搜索过google我需要添加命名空间。 using Microsoft.Azure;

我已经添加了,但是再次获得像这样的错误

type or namespace 'Azure' does not exist in the namespace  'microsoft' (are you missing  an assembly reference?)  showing like this  how to fix this issue how can I add namespace Azure?

2 个答案:

答案 0 :(得分:2)

您需要参考Microsoft.Azure。按照以下步骤添加参考。

  1. 在解决方案资源管理器中,右键单击项目,然后单击“添加引用”。
  2. 在“添加引用”对话框中,选择指示要引用的组件类型的选项卡。
  3. 选择Microsoft.Azure,然后点击“确定”。
  4. 编辑:

    另外根据J Steen的评论,您可以使用nuget包管理器添加它。在Package Manager Console中使用以下命令。

    Install-Package Microsoft.WindowsAzure.ConfigurationManager
    

答案 1 :(得分:2)

我已修复问题选择工具菜单选择NuGet包管理器控制台并选择包管理器控制台并在修复问题后安装Install-Package Microsoft.WindowsAzure.ConfigurationManager