Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase docs on how to partially sub classes with internal virtual members #591

Open
djeikyb opened this issue Sep 30, 2019 · 1 comment

Comments

@djeikyb
Copy link

djeikyb commented Sep 30, 2019

I think it would be helpful if the partial subs page mentioned the need to add:

<ItemGroup>
    <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
        <_Parameter1>YOUR TEST ASSEMBLY</_Parameter1>
    </AssemblyAttribute>
    <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
        <_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
    </AssemblyAttribute>
</ItemGroup>

Usually when I'm reaching for a partial sub, I need to invoke a public method that calls a subbed internal virtual. It took me a long time to discover this assembly configuration. While writing this feature request, I actually found an nsub page that talks about this! Unfortunately, I never saw it while I was troubleshooting. I actually gave up on nsub for that specific test and imported moq. I mean why not both, right? 😄 Seeing moq crash gave me the insights needed to get nsub going again. I'm excited to see progress on making nsub crash too!

@dtchepak
Copy link
Member

dtchepak commented Oct 4, 2019

Thanks for the feedback @djeikyb! Will try to get this in for the next round of documentation updates 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants