views:

46

answers:

3

New to C# here. So I have an application that utilises the BouncyCastle framework, how can I package this application so that I dont have to manually put BouncyCastle's .dll on others computers? I'm assuming that this can be done with an install or something? And where do applications look for referenced third party libraries by default?

+1  A: 

You need to create installer. Best one to start with is ClickOnce. It will give you ability to put all needed files into one and provide UI for installation.

Second question. The default place to look for assemblies is GAC.

Andrey
+1  A: 

Since BouncyCastle is a managed library, if you create an installer project in Visual Studio and add your application's exe to it, the installer will automatically detect the dependency on BouncyCastle, and add it to the installer project. When users install your application, BouncyCastle's dlls will be automatically copied to the installation directory and everything will be good.

Tesserex
Muchos gracias mi amigo.
Petey B
+1  A: 

As an alternate approach, you can inject assemblies into your main assembly. There are cemmercial tools that support this like DeepSea Obfuscator or you can use ilmerge.

The general way of working is that you develop using separate assemblies and when you ship the product you do an additional build step that merges assemblies into one big assembly. You can even internalize the injected assemblies so only your public interface is accessible.

This way you can deploy your product as a single assembly which is especially nice if you're building components.

To answer your second question; the .NET framework will look in a couple of locations. The GAC is dominant but if you make sure the referenced assembly is in the same folder as your main assembly .NET will find it. No need to register it in the GAC.

Marnix van Valen