views:

398

answers:

1

I guess that this is a really stupid question, knowing that .net-code can be viewed with tools such as Reflector but here it comes.

I have written a library in VS2008 (vb.net) which I am distributing to some people for testing. With the distibution, I am also attaching a sample-project(application) which uses my library. I thought that I would distribute the whole project-folder of the sample-application but then it struck me that the testers through debug-mode perhaps could "step into" the code of the library since a pdb-file (nameofmylibrary.pdb) is present.

I don't know how it all works but I just want to be sure that in case there is an error in my library, the testers can't access my library-code in debugging-mode (which I can having the sources of the library). How can I proceed in distributing the sample-application?

Thank you.

+1  A: 

Just don't give them the PDB. In fact, I'd suggest cleaning the build before you distribute at all - don't include the bin and obj directories. They just bloat the thing massively.

Include:

  • The source of the sample project
  • The DLL of the library
  • The XML documentation for the library (alongside the DLL) if you're producing it

Note that Reflector doesn't actually present the original source code. It presents a version with no comments, no local variables unless the PDB is there, and often more obscure code based on what the compiler's been doing. You can use an obfuscator if you're really worried, but personally I think most of the value of a library is usually in its design (which pretty much has to be viewable) rather than the implementation. There are exceptions, of course.

Jon Skeet
I tried and it works - I only needed to add the "My Project"-folder. Thanks.
moster67