none
How do i configure an assembly programmatically? RRS feed

  • Question

  • Hi

    I would like to create an MSI where i amongst other configure an assembly.

    What I would like to be able to do in code is what i would do manually like this.

    1. Open Microsoft .Net 2.0 Configuration
    2. Right click "Configure an application", and select Add.
    3. Enter information on redirect and binding.

    Is this possibly to do in code, or by calling some cmd line tool?

    I can't seem to figure out how caspol should be able to do this.

    Hope someone can help me with this.

    /Anders
    Wednesday, November 26, 2008 9:52 AM

All replies

  • You have a couple of design issues. Even if you can configure the assembly (using system.configuration for instance), it won't apply to your currently executing application because assembly binding occurs long before your first line of code executes. The normal approach is to use the MSI or some other installation tool to configure the environment before your application starts . To do that, you prepare your application configuration policy and then create an MSI from that policy (run caspol at a command prompt). Once you have that setup file created, you simply run it (with admin privileges) at application installation and setup. Then you execute your application.
    Wednesday, August 5, 2009 1:48 AM