![]() |
|
#1
|
|||
|
|||
|
I'm really struggling with getting app.configs to correctly propagate to agents. Everything behaves properly in one project but not another. As far as I can tell, both projects wire up their objects to be executed on an agent identically. However, one of them does not propagate the companion config files referenced by configSource attributes. I have all config files set to copy to the output directory.
In the project that does not propagate the companion configs, I am able to fudge it by explicitly adding the files to the JobTemplate.FileDefs collection. However, this is a poor design choice so I am hoping that I am just forgetting something before I go that route. This is my App.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings configSource="Deployment\Local.App.config" /> </configuration> |
|
#2
|
|||
|
|||
|
I ended up implementing a workaround. I don't believe Digipede resolves configSource attributes when calling JobTemplate.AddConfigurationFile. It would be great if someone from Digipede could confirm this. I didn't see any limitations defined in the docs. My solution just adds any files referenced in a configuration section's configSource attribute to the JobTeplate's FileDef's collection. I am using v2.2.
For what it's worth, this is the code: public void AddConfigSourceConfiguration(JobTemplate jobTemplate) { Configuration config = ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None); foreach (ConfigurationSection section in config.Sections) { if (!string.IsNullOrEmpty(section.SectionInformation. ConfigSource)) { FileDef configDefinition = jobTemplate.FileDefs.Add(); configDefinition.Id = jobTemplate.FileDefs.Count + 1; configDefinition.TransferType = TransferType.Streamed; configDefinition.LocalName = section.SectionInformation.ConfigSource; configDefinition.Stream = new FileStream(configDefinition.LocalName, FileMode.Open, FileAccess.Read); } } } Last edited by apitzele; 01-04-2010 at 08:35 AM. |
|
#3
|
|||
|
|||
|
While it looks like you have a workaround, can you let us take a look at the config file that isn't working (or isn't working reliably)? It may help us solve the problem in our code. Can you send an example config file to support at digipede.net?
|
![]() |
| Tags |
| configuration deployment |
| Thread Tools | |
| Display Modes | |
|
|