0:000> !dumpheap -stat
total 1755874 objects
Statistics:
MT Count TotalSize Class Name
7b9b0c64 1 12 System.Windows.Forms.Layout.TableLayout+ColumnSpanComparer
....
7933303c 14006 4926456 System.Collections.Hashtable+bucket[]
65246e00 804 4982192 System.Data.RBTree`1+Node[[System.Int32, mscorlib]][]
054c55f0 44240 5662720 DevExpress.Utils.AppearanceObject
793040bc 98823 7613156 System.Object[]
793308ec 293700 55820016 System.String
002435f0 50315 138631888 Free
Total 1755874 objects
Fragmented blocks larger than 0.5 MB:
Addr Size Followed by
15a195c8 0.8MB 15ae3950 System.Collections.ArrayList
15d81468 1.6MB 15f23708 System.String
15f23984 1.0MB 16029ae4 System.String
... about 7 more objects here
1ee51764 0.5MB 1eedbaa4 System.WeakReference
1f0df96c 2.4MB 1f34d4b0 …Run Code Online (Sandbox Code Playgroud) 问题:未根据exclude属性中传递的值正确构建ItemGroups数组.
如果你运行这个脚本它会创建一些示例文件,然后尝试根据Include/Exclude属性创建一个名为TheFiles的数组,问题是当Exclude是硬编码以外的任何东西时,或者是一个非常简单的属性,它是错误的.
目标DynamicExcludeList错误地选择了这些文件:
.\ AFolder\test.cs;.\ AFolder\test.txt
目标
HardcodedExcludeList 正确选择这些文件:.\ AFolder\test.txt
任何帮助非常感谢,这让我疯了.
(注意它的msbuild v4)
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Run">
<Target Name="Run" >
<CallTarget Targets="CreateSampleFiles" />
<CallTarget Targets="DynamicExcludeList" />
<CallTarget Targets="HardcodedExcludeList" />
</Target>
<Target Name="CreateSampleFiles" >
<MakeDir Directories="AFolder" />
<WriteLinesToFile Lines="Test" File="AFolder\test.cs" Overwrite="true" />
<WriteLinesToFile Lines="Test" File="AFolder\test.txt" Overwrite="true" />
</Target>
<Target Name="DynamicExcludeList" >
<PropertyGroup>
<CommonFileExclusion>.\DIRECTORY_NAME_TOKEN\**\*.cs</CommonFileExclusion>
<FinalExcludes>$(CommonFileExclusion.Replace('DIRECTORY_NAME_TOKEN', 'AFolder'))</FinalExcludes>
</PropertyGroup>
<Message Text="FinalExcludes: $(FinalExcludes)" />
<ItemGroup>
<TheFiles
Include=".\AFolder\**\*;"
Exclude="$(FinalExcludes)"
/>
</ItemGroup>
<Message Text="TheFiles: @(TheFiles)" />
</Target>
<Target Name="HardcodedExcludeList" >
<PropertyGroup>
<FinalExcludes>.\AFolder\**\*.cs</FinalExcludes>
</PropertyGroup>
<Message Text="FinalExcludes: $(FinalExcludes)" />
<ItemGroup> …Run Code Online (Sandbox Code Playgroud) 嘿人...试图让我的模拟与asp.net MVC分类.
我在网上使用Moq找到了这个例子,基本上我理解它说:当调用ApplyAppPathModifier时,返回传递给它的值.
我无法弄清楚如何在Rhino Mocks中做到这一点,有什么想法吗?
var response = new Mock<HttpResponseBase>();
response.Expect(res => res.ApplyAppPathModifier(It.IsAny<string>()))
.Returns((string virtualPath) => virtualPath);
Run Code Online (Sandbox Code Playgroud) 我正在尝试在便携式类库中安装protobuf-net(2.0.0.602),我似乎无法让它工作.我收到此错误:
PM> install-package protobuf-net
'protobuf-net 2.0.0.602' already installed.
install-package : Could not install package 'protobuf-net 2.0.0.602'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile4', but
the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Run Code Online (Sandbox Code Playgroud)
检查包看起来似乎是针对portable-sl4 + wp71 + windows8,但是当我创建一个针对这些框架的vinalla项目时,我无法让它工作(profile4在上面列出,但我尝试了几个不同的看到什么坚持).我刚刚在工作室更新了nuget.从包管理器控制台运行'nuget'会将nuget版本显示为2.1.31022.9038.
如果我浏览到包中的protobuf-net.dll(在lib\_便携式-sl4 + wp71 + windows8下),它将允许我引用它,一切都很好.
我可以手动添加它,但我错过了一些明显的东西.
任何帮助赞赏.
.net ×1
asp.net-mvc ×1
c# ×1
itemgroup ×1
memory ×1
mocking ×1
moq ×1
msbuild ×1
nuget ×1
protobuf-net ×1
rhino-mocks ×1
windbg ×1