locked
ClickOnce and External Config Files RRS feed

  • Question

  •  

    We have an application written in VS.NET C# and want to distribute it using ClickOnce but it uses a DLL that includes it's own config file. When we deploy the application, this config file does not get deployed even though we have told the solution to include it in the project (right click -> Include ).

     

    My question is this, when we did NoTouch deployment (in version 1.1)  this was a major problem in the fact that other DLLs utilizing their own configuration files (or other external resource files) would not automatically download with the application.  I thought this scenario had been addressed with ClickOnce so how can I distribute an external configuration file that is required by one or more of the DLLs my application is utilizing?

     

    Surely this is possible now?

     

    Thanks for any insight.

     

    Mark

    Friday, November 30, 2007 1:38 PM

Answers

  • Hi, Mark,

     

    Based on my understanding, you want to know if the config files for you dlls would be downloaded automatically in ClickOnce, don't you?

     

    The answer is yes, but you should change the settings a bit.

    First, you should add the custom config file into your project through "Adding existing files", lets say ClassLibrary.dll.config.

    Then please right click the file and choose Properties.

    In the Properties Window, you should set build option to "Content" and Copy to output directory to "Copy Always".

     

    After that, you should add the ClassLibrary as a reference into the project and set its "Copy local" to true.

     

    Well, now when you publish your project with ClickOnce, the Dll and the Config file would be automatically deployed into the Client's computer.

     

    Hope this helps,

    Regards

     

    Wednesday, December 5, 2007 10:02 AM

All replies

  • Hi, Mark,

     

    Based on my understanding, you want to know if the config files for you dlls would be downloaded automatically in ClickOnce, don't you?

     

    The answer is yes, but you should change the settings a bit.

    First, you should add the custom config file into your project through "Adding existing files", lets say ClassLibrary.dll.config.

    Then please right click the file and choose Properties.

    In the Properties Window, you should set build option to "Content" and Copy to output directory to "Copy Always".

     

    After that, you should add the ClassLibrary as a reference into the project and set its "Copy local" to true.

     

    Well, now when you publish your project with ClickOnce, the Dll and the Config file would be automatically deployed into the Client's computer.

     

    Hope this helps,

    Regards

     

    Wednesday, December 5, 2007 10:02 AM
  •  

    Thanks for the post Yu Guo, it helped to solve my problem.

     

    I've got some improvement ideas; how about making Visual Studio a little smarter and automatically add config files?  It's smart enough to know about dlls and pdbs.

     

    Also under the current "work around" you provided if any changes are made to the .config file from the external dll the .config file has to be re-added to the project, this is a pain and can lead to debugging headaches since it is a manual process.

     

    Regards,

    Mike

    Friday, April 11, 2008 3:31 PM