Fakes assembly is not generating

纵饮孤独 提交于 2019-12-04 03:12:30

I found out what my problem was. I thought StubGeneration and ShimGeneration were supposed to be child elements of Assembly, but they aren't. They are supposed to be children of Fakes, and siblings of Assembly. After changing my .fakes file to this, it works:

<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/"
       Diagnostic="true">
  <Assembly Name="[assembly name]" />
  <StubGeneration>
    <Clear />
  </StubGeneration>
  <ShimGeneration>
    <Clear />
    <Add Namespace="[namespace that the 1 class I want to shim is in]" />
  </ShimGeneration>
</Fakes>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!