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

AssemblyPlaceholder / ILDummy #1

Open
dbent opened this issue Feb 26, 2016 · 3 comments
Open

AssemblyPlaceholder / ILDummy #1

dbent opened this issue Feb 26, 2016 · 3 comments

Comments

@dbent
Copy link

dbent commented Feb 26, 2016

@hvacengi Hit a snag with generics working on the improved ILDummy so I just threw up the old code in AssemblyPlaceholder. It's not perfect but it gets the job done; it takes a single command line parameter which is the path to a direct containing assemblies, it then spits out dummies of them into a subdirectory Dummies. I'll continue to work on the improved ILDummy.

@hvacengi
Copy link
Member

Thanks for sharing! I'll download that copy and poke around to get familiar. I'll try to do what I can to help you improve it as you go!

@djungelorm
Copy link

I just came across this after writing my own tool that does the same thing - although it uses the opposite approach of loading the assembly then stripping out non-public types/methods/etc.

It's here if you're interested: https://github.com/djungelorm/stubber

@dbent
Copy link
Author

dbent commented Jun 6, 2016

Cool @djungelorm. My rationale for using the additive method was that if there was a bug in the implementation at worst you get a non-functioning assembly, whereas with the subtractive method a bug in the implementation could lead to proprietary code being inadvertently distributed.

For reference, there's a Microsoft tool to do just this (sort of) as part of .NET Core. In .NET parlance assemblies without implementation are "Reference Assemblies". A prerelease version of the tool is on NuGet (although it doesn't seem to have been updated in a while). The repository is here. It looks like the tool reads an assembly and then spits out a C# source file with just the public members. Presumably you can then compile the source into an actual assembly, but I haven't really tried messing around with it. My method, as janky as it is, continues to work.

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

No branches or pull requests

3 participants