我们正在使用C#MongoDB驱动程序,我们希望对时间戳的Date部分进行分组,并获得该日期的平均值.问题是我们无法使用构建器为组找到正确的synthax.
此代码显示了如何使用BSON文档创建组,但我们发现synthax不清楚阅读并且非常令人困惑!所以正在寻找正确的构建器synthax.
我们想使用Builders,因为它更多地在C#中输入,然后在管道中使用BsonDocuments的方法.这是一个代码片段,其中前3个操作有效,但我们无法找到GroupBy.
DateTime from = new DateTime(2014, 12, 2);
DateTime to = new DateTime(2014, 12, 4);
var id = "37d163c0-44cc-4907-94cf-1e26b5eec911";
var grp = new BsonDocument
{
{
//Sort the documents into groups
"$group",
new BsonDocument
{
//Make the unique identifier for the group a BSON element consisting
// of a field named Car.
// Set its value to that of the Cars field
// The Cars field is nolonger an array because it has now been unwound
//{ "_id", …Run Code Online (Sandbox Code Playgroud) 新的一年,新的发布,和往常一样新的agrevation。Visual Studio 2019(16.1 版)和 Resharper 2019.1.1 的组合对于我们在 1 个解决方案 .NET Core 2.2 中的不太大的解决方案(10 个项目和 6 个测试项目)来说是致命的。未与前端(javascript/typescript)结合使用。
打开解决方案时,VS 挂起并使用了大量 CPU,现在甚至到了我需要禁用 resharper 才能继续开发的地步。不仅禁用 resharper,我还需要禁用 Visual Studio 中的代码镜头,因为 ServiceHub.RoslynCodeAnalysis 服务仍然占用大量 CPU,发现 ( https://github.com/dotnet/roslyn/issues/19205 )
我已经在 Jetbrains 网站上找到了这篇文章:https : //resharper-support.jetbrains.com/hc/en-us/articles/206546919,但这次我无法弄清楚问题是什么。
我也在微软开发者社区上找到了这个:https : //developercommunity.visualstudio.com/content/problem/521943/vs-2019-high-cpu-and-memory-usage.html : status 01/06/2019 - NO SOLUTION
我还在开发者社区创建了自己的票证,将保持两个站点同步:https : //developercommunity.visualstudio.com/content/problem/593963/visual-studio-2019-version-161-slow-and-consumer。 html状态 04/06/2019 - 票已创建
社区中任何有同样问题的人,以及如何解决它的一些帮助。
这与硬件无关或与操作系统无关,可能是两个系统中的某些设置相互混淆。
欲知更多详情:
我正在使用MSTest.TestAdapter和MSTest.TestFramework这两个版本1.2.0进行我的MS测试单元测试。在我的本地计算机(Visual Studio 2017)上,测试运行完美,但是在构建服务器上,我们收到以下消息:
无法加载文件或程序集“ Microsoft.VisualStudio.TestPlatform.ObjectModel,版本= 11.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a”或其依赖项之一。该系统找不到指定的文件。
然后我用ildasm检查了该程序集的引用,的确是11.0.0.0版本(请参见下文)
但是我找不到该程序集的v11,在线上nuget上只有v14版本:https ://www.nuget.org/packages/Microsoft.VisualStudio.TestPlatform.ObjectModel/
我也在机器上搜索,但找不到v11。
所以我的问题是,为什么测试在我的机器上而不在构建服务器上运行?
我尝试了程序集绑定,但是没有成功。