简体   繁体   English

C#mongo驱动程序安装

[英]c# mongo driver installation

I try to install MongoDB C# official driver with Package Manager console in VS2013. 我尝试在VS2013中使用Package Manager控制台安装MongoDB C#官方驱动程序。 It has some dependencies, and they should be installed by commands like this: 它具有一些依赖关系,应通过以下命令安装它们:

Install-Package MongoDB.Bson

But I have got such error for each package: 但是每个包装我都有这样的错误:

Install-Package : Could not install package 'MongoDB.Bson 2.4.0'. Install-Package:无法安装软件包“ MongoDB.Bson 2.4.0”。 You are trying to install this package into a project that targets '.NETFramework,Version=v4.0,Profile=Client', but the package does not contain any assembly references or content files that are compa tible with that framework. 您正在尝试将此软件包安装到以'.NETFramework,Version = v4.0,Profile = Client'为目标的项目中,但是该软件包不包含与该框架兼容的任何程序集引用或内容文件。 For more information, contact the package author. 有关更多信息,请与软件包作者联系。 At line:1 char:16 在线:1个字符:16个
+ Install-Package <<<< MongoDB.Bson + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand +安装软件包<<<< MongoDB.Bson + CategoryInfo:未指定:(:) [Install-Package],InvalidOperationException + FullyQualifiedErrorId:NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

'.NETFramework,Version=v4.0,Profile=Client', '.NETFramework,Version = v4.0,Profile = Client',

This is .NET 4.0 Client Profile, which Mongo driver doesn't support. 这是.net 4.0客户端配置文件,Mongo驱动程序不支持。

Maybe you didn't intended to use .NET 4.0 Client Profile. 也许您不打算使用.NET 4.0客户端配置文件。 Go to your project properties and switch to .NET 4.5 (because it's the minimum framework version supported by the whole NuGet package ). 转到项目属性,然后切换到.NET 4.5(因为它是整个NuGet软件包支持的最低框架版本)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM