Can';t generate NHibernate.Moles.dll-生成代码中的生成错误
我正试图使用下载附带的可执行文件为NHibernate.dll生成程序集,但生成的代码附带了一些生成错误,我不知道如何修复(如果可能的话) 我就是这么做的:Can';t generate NHibernate.Moles.dll-生成代码中的生成错误,nhibernate,moles,Nhibernate,Moles,我正试图使用下载附带的可执行文件为NHibernate.dll生成程序集,但生成的代码附带了一些生成错误,我不知道如何修复(如果可能的话) 我就是这么做的: 将NHibernate.dll和Iesi.Collections.dll复制到新目录 站在该目录中,运行。/pathtomoles/moles.exe NHibernate.dll Moles然后输出以下内容: Microsoft Moles v0.94.51023.0 - http://research.microsoft.com/mol
。/pathtomoles/moles.exe NHibernate.dll
若我生成所有类型,我确实会得到一个错误,但你们可以在nhibernate中对类型进行子选择,这样就有可能生成摩尔 我的vs.net项目中的NHibernate.moles文件:
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="NHibernate" />
<StubGeneration >
<Types >
<Clear />
<Add TypeName ="Session"/>
</Types>
</StubGeneration>
<MoleGeneration >
<Types >
<Clear />
<Add TypeName ="Session"/>
</Types>
</MoleGeneration>
</Moles>
好的,我得到了使用.moles文件的参数:
"C:\Program Files\Microsoft Moles\bin\moles.exe" /mfo /nologo /tfv:v4.0 /r:"<full path>\NHibernate.dll;<full path>\Iesi.Collections.dll" "NHibernate.moles"
“C:\Program Files\Microsoft Moles\bin\Moles.exe”/mfo/nologo/tfv:v4.0/r:“\NHibernate.dll;\Iesi.Collections.dll”“NHibernate.Moles”
如果不使用这些类型,我不确定是否需要包含Iesi.Collections。我尝试使用NHibernate dll将名为NHibernate.moles的文件添加到目录中,并运行
moles.exe NHibernate.moles
,但没有成功。鼹鼠似乎找不到任何可以存根的东西,所以它什么也不做就离开了moles.exe/mfo NHibernate.dll
抱怨找不到用于mole的程序集。我更新了moles参数。我测试的NHibernate版本是3.2。您现在正式成为我的英雄=)
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="NHibernate" />
<StubGeneration >
<Types >
<Clear />
<Add TypeName ="Session"/>
</Types>
</StubGeneration>
<MoleGeneration >
<Types >
<Clear />
<Add TypeName ="Session"/>
</Types>
</MoleGeneration>
</Moles>
"C:\Program Files\Microsoft Moles\bin\moles.exe" /mfo /nologo /tfv:v4.0 /r:"<full path>\NHibernate.dll;<full path>\Iesi.Collections.dll" "NHibernate.moles"