The type or namespace name 'Azure' does not exist in the namespace 'Microsoft'
Asked Answered
B

3

14

I am working on a Windows 10 UWP app and would like to store some information in Cosmos DB. Following the getting started instructions does not work with Microsoft Azure DocumentDB NuGet package 1.19.1, nor with former ones.

The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?).

Target version is Windows 10 Fall Creators Update but I face the same issue with other builds.

Have you got any ide how to solve it?

Blond answered 26/11, 2017 at 12:27 Comment(3)
Have you definitely managed to install the NuGet package successfully? Does it show in the list of references?Surprising
I have tried on an empty project. It is the same.Blond
Yes, it is installed properly and showing up in the list of references.Blond
F
12

You have the package for .NET Standard. I believe you need the package for .NET Core for UWP. 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. So you should set both the Target and the Minimum version to Windows 10 Fall Creator Update Build 16299 for your project.

Foreigner answered 26/11, 2017 at 15:0 Comment(1)
Thanks for the hint and your last edit as well. I was not able to install that package, but the Target was Fall Creators Update 16299 and Minimum was set to Creators Update 15063.Blond
S
2

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.

This is especially true if you are cloning existing projects to a new machine.

Supra answered 31/3, 2021 at 18:46 Comment(0)
B
0

In my case I just needed to install the missing Microsoft.Azure.Cosmos package:

$ dotnet add package Microsoft.Azure.Cosmos --version 3.11.0
Boeotia answered 12/7, 2020 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.