简体   繁体   English

在 .NET 4.5.2 项目中没有成功安装 NuGet package 的参考

[英]No reference for successfully installed NuGet package in a .NET 4.5.2 project

Using Visual Studio 2015 and .NET 4.5.2, I am building a console .NET project that needs to use CosmosDb things, so I followed Tutorial: Build a .NET console app to manage data in Azure Cosmos DB SQL API account , successfully installed Microsoft.Azure.Cosmos (v3.15.1) using NuGet and tried to reference it. Using Visual Studio 2015 and .NET 4.5.2, I am building a console .NET project that needs to use CosmosDb things, so I followed Tutorial: Build a .NET console app to manage data in Azure Cosmos DB SQL API account , successfully installed Microsoft.Azure .Cosmos (v3.15.1) 使用 NuGet 并尝试引用它。

However, the reference list didn't show this package there, and when I tried to use the package in the code, an error " The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) " occurred in the project error list.但是,参考列表没有在此处显示此 package,当我尝试在代码中使用 package 时,出现错误“名称空间“Microsoft”中不存在类型或名称空间名称“Azure”(您是否缺少程序集参考?) ”出现在项目错误列表中。

There was a file "packages.config" which was like:有一个文件“packages.config”,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Azure.Cosmos" version="3.15.1" targetFramework="net452" />
</packages>

I have tried to re-install all the packages using Update-Package -reinstall but nothing happened.我尝试使用 Update-Package -reinstall 重新安装所有软件包,但没有任何反应。

What steps did I miss?我错过了哪些步骤?

The Solution:解决方案:

Change .NET Framework version to 4.6.1 or higher and then reinstall the package.将 .NET 框架版本更改为 4.6.1 或更高版本,然后重新安装 package。

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

相关问题 如何在Mono项目中安装4.5.2 nuget包? - How to install 4.5.2 nuget package in Mono project? 无法添加对已安装 NuGet 包的引用? - Unable to add reference to installed NuGet package? 使用本地项目引用覆盖 nuget 包引用 - Override a nuget package reference with a local project reference 制作了一个nuget软件包,将其安装在项目上,但是现在它没有出现在参考列表中 - Made a nuget package, installed it on a project, but now it doesn't show up in the reference list A Nuget package 在安装时从其参考项目中复制 static 文件 - A Nuget package copies the static files from its reference project when installed 是否可以引用解决方案中存在的项目,如果不在.NET Core中,可以使用NuGet程序包引用作为后备吗? - Is it possible to reference a project that exists in the solution and use NuGet package reference as fall-back if not in .NET Core? 未安装.NET 4.5.2的目标包 - Targeting pack for .NET 4.5.2 not installed .Net 4.5.2工具在哪里安装? - Where are .Net 4.5.2 tools installed? NuGet包引用导致项目中出现新文件夹 - NuGet package reference caused new folders in the project 使用 xUnit 参考部署项目 NuGet package - Deploy project with xUnit reference as NuGet package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM