Q:

Why am I able to debug my assembly?

I am working on an assembly that handles various color transformations.  When I load the assembly into a new project to test, if there happens to be an bug in the assembly, Visual Studio opens the offending code from the DLL.  I can step through all of the code in the assembly.
I definitely don't want the code to be so easily visible/available.  I would like the code to be somewhat "locked" in the assembly.
How can I set the DLL to simply throw some sort of error instead of opening?
Edit
I'm not interested in the code being "safe" and I have no need to obfuscate.  This library is being used internally and the code itself is perfectly accessible to tohers.  What I don't want is for someone using the library to find themselves suddenly debugging the assembly.  If there is a problem, I prefer to have an error thrown instead of the assembly code opening in Visual Studio.

A:

This is happening because you have VS installed on the machine, and because you are deploying the PDB files - you will not get this dialogue box if VS is not installed.
Additionally: 

Do not deploy code that has been built in the Debug configuration. These contain additional information that helps with debugging.
Make sure you do not deploy the PDB files with the executables. Same as above, and they are not needed for running the code.

Both these will help, but any assembly would be easily decompiled with reflector, so you may also want to investigate obfuscators to stop other programmers from easily seeing your code.

A:

There is a list of C# obfuscators here : http://www.csharp411.com/net-obfuscators/

