您尝试打开的工作区与当前的 dotMemory 版本不兼容
The workspace you are trying to open is incompatible with the current dotMemory version
我已经使用 .Net 5 目标框架创建了一个新的 XUnit 测试项目并进行了一次测试 class
public class SomeTests
{
private readonly ITestOutputHelper output;
public SomeTests(ITestOutputHelper output)
{
this.output = output;
DotMemoryUnitTestOutput.SetOutputMethod(output.WriteLine);
}
[Fact]
[DotMemoryUnit(CollectAllocations = true)]
public void SomeTest()
{
var beforeTestMethodPoint = dotMemory.Check();
var allocatedArray = new string[10];
dotMemory.Check(afterTestMethodPoint => Assert.True(afterTestMethodPoint.GetTrafficFrom(beforeTestMethodPoint).AllocatedMemory.SizeInBytes == 0));
}
}
安装的 NuGet 包是 JetBrains.DotMemoryUnit 3.1.20200127.214830
运行测试后(运行 在 dotMemory Unit 下)创建以下输出
Xunit.Sdk.TrueException
Assert.True() Failure
Expected: True
Actual: False
at TestsDotMemory.SomeTests.<>c__DisplayClass2_0.<SomeTest>b__0(Memory afterTestMethodPoint) in SomeTests.cs:line 25
at JetBrains.dotMemoryUnit.dotMemory.Check(Action`1 check)
at TestsDotMemory.SomeTests.SomeTest() in SomeTests.cs:line 25
[dotMemory Unit]: The workspace is saved to "file:///C:/Users/username/AppData/Local/Temp/dotMemoryUnitWorkspace/Run-2021-03-06T10-15-06.288/SomeTest.2021-03-06T10-15-11.629.dmw". (File size: 9 MB)
当我用 .dmw 文件点击 link 时,dotmemory 应用程序被打开
当前应用版本和许可信息
JetBrains dotMemory 2020.3.3 Build 203.0.20210217.101844 built on 2021-02-17
dotMemory 2020.3.20210217.101844
dotMemory 2020.3.3 free trial period is running. 2 days left.
并出现对话框 window
The workspace you are trying to open is incompatible with the current dotMemory version. Do you want to open the workspace in a compatible portable dotMemory version?
如果我 select 是,则打开 dotMemory 2019.1.3 并显示有关许可证信息的对话框已结束(我的许可证仅适用于 2020.3)
那么为什么 dotMemory 2020.3.3 不支持 .dmw 文件?
.dmw 文件格式经常更改以便为用户提供新功能。不幸的是,dotMemory Unit 产生了一个旧格式的工作空间,因为新版本已经好几年没有发布了。
据我所知,您没有 dotMemory 2020.3 的许可证,您可以使用试用期。而 dotMemory 2019.1.3 的试用期在您的机器上已经结束。
dotMemory 任何版本的付费许可肯定涵盖所有以前的版本。
我已经使用 .Net 5 目标框架创建了一个新的 XUnit 测试项目并进行了一次测试 class
public class SomeTests
{
private readonly ITestOutputHelper output;
public SomeTests(ITestOutputHelper output)
{
this.output = output;
DotMemoryUnitTestOutput.SetOutputMethod(output.WriteLine);
}
[Fact]
[DotMemoryUnit(CollectAllocations = true)]
public void SomeTest()
{
var beforeTestMethodPoint = dotMemory.Check();
var allocatedArray = new string[10];
dotMemory.Check(afterTestMethodPoint => Assert.True(afterTestMethodPoint.GetTrafficFrom(beforeTestMethodPoint).AllocatedMemory.SizeInBytes == 0));
}
}
安装的 NuGet 包是 JetBrains.DotMemoryUnit 3.1.20200127.214830
运行测试后(运行 在 dotMemory Unit 下)创建以下输出
Xunit.Sdk.TrueException
Assert.True() Failure
Expected: True
Actual: False
at TestsDotMemory.SomeTests.<>c__DisplayClass2_0.<SomeTest>b__0(Memory afterTestMethodPoint) in SomeTests.cs:line 25
at JetBrains.dotMemoryUnit.dotMemory.Check(Action`1 check)
at TestsDotMemory.SomeTests.SomeTest() in SomeTests.cs:line 25
[dotMemory Unit]: The workspace is saved to "file:///C:/Users/username/AppData/Local/Temp/dotMemoryUnitWorkspace/Run-2021-03-06T10-15-06.288/SomeTest.2021-03-06T10-15-11.629.dmw". (File size: 9 MB)
当我用 .dmw 文件点击 link 时,dotmemory 应用程序被打开
当前应用版本和许可信息
JetBrains dotMemory 2020.3.3 Build 203.0.20210217.101844 built on 2021-02-17
dotMemory 2020.3.20210217.101844
dotMemory 2020.3.3 free trial period is running. 2 days left.
并出现对话框 window
The workspace you are trying to open is incompatible with the current dotMemory version. Do you want to open the workspace in a compatible portable dotMemory version?
如果我 select 是,则打开 dotMemory 2019.1.3 并显示有关许可证信息的对话框已结束(我的许可证仅适用于 2020.3)
那么为什么 dotMemory 2020.3.3 不支持 .dmw 文件?
.dmw 文件格式经常更改以便为用户提供新功能。不幸的是,dotMemory Unit 产生了一个旧格式的工作空间,因为新版本已经好几年没有发布了。 据我所知,您没有 dotMemory 2020.3 的许可证,您可以使用试用期。而 dotMemory 2019.1.3 的试用期在您的机器上已经结束。 dotMemory 任何版本的付费许可肯定涵盖所有以前的版本。