简体   繁体   English

命名空间“Microsoft”中不存在类型或命名空间名称“Azure”

[英]The type or namespace name 'Azure' does not exist in the namespace 'Microsoft'

I am working on a Windows 10 UWP app and would like to store some information in Cosmos DB.我正在开发 Windows 10 UWP 应用程序,并希望在 Cosmos DB 中存储一些信息。 Following the getting started instructions does not work with Microsoft Azure DocumentDB NuGet package 1.19.1, nor with former ones.遵循入门说明不适用于 Microsoft Azure DocumentDB NuGet 包 1.19.1,也不适用于以前的包。

The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?).命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(您是否缺少程序集引用?)。

Target version is Windows 10 Fall Creators Update but I face the same issue with other builds.目标版本是 Windows 10 Fall Creators Update,但我在其他版本中遇到了同样的问题。

Have you got any ide how to solve it?你知道如何解决它吗?

You have the package for .NET Standard.你有 .NET Standard 的包。 I believe you need the package for .NET Core for UWP.我相信您需要 UWP 的 .NET Core 包。 Microsoft.Azure.DocumentDB.Core v 1.7.1 Microsoft.Azure.DocumentDB.Core v 1.7.1

Please note the package Microsoft.Azure.DocumentDB.Core 1.7.1 is not compatible with the version before Windows 10 Fall Creators Update.请注意Microsoft.Azure.DocumentDB.Core 1.7.1 包与 Windows 10 Fall Creators Update 之前的版本不兼容。 So you should set both the Target and the Minimum version to Windows 10 Fall Creator Update Build 16299 for your project.因此,您应该为您的项目将目标最低版本设置为 Windows 10 Fall Creator Update Build 16299。

就我而言,我只需要安装缺少的Microsoft.Azure.Cosmos包:

$ dotnet add package Microsoft.Azure.Cosmos --version 3.11.0

If you already have the NuGet package installed, but it's still not recognized, for me it often helps to downgrade the package to a lower version (using the package manager) and then upgrade it back to the original version.如果您已经安装了 NuGet 包,但仍然无法识别,对我来说,将包降级到较低版本(使用包管理器),然后将其升级回原始版本通常会有所帮助。

This is especially true if you are cloning existing projects to a new machine.如果您将现有项目克隆到新机器上,则尤其如此。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 内部版本 - 名称空间“Microsoft”中不存在类型或名称空间名称“OpenApi” - Azure Builds - The type or namespace name 'OpenApi' does not exist in the namespace 'Microsoft' 错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(您是否缺少程序集引用?) - error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名称“FileIO” - The type or namespace name 'FileIO' does not exist in the namespace 'Microsoft.VisualBasic' 类型或名称空间名称“ DirectX”在名称空间“ Microsoft” Windows 8.1中不存在 - The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' Windows 8.1 命名空间“Microsoft”中不存在类型或命名空间名称“设备” - The type or namespace name 'Devices' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Bot”? - The type or namespace name 'Bot' does not exist in the namespace 'Microsoft'? 类型或名称空间名称“ FriendlyUrls”在名称空间“ Microsoft.AspNet”中不存在 - The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet' 命名空间“Microsoft”中不存在类型或命名空间名称“Reporting” - The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“TeamFoundation” - The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“ServiceBus”? - The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM