Digipede Community and Technical Support  

Go Back   Digipede Community and Technical Support > Products > Digipede Framework SDK

Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2009, 01:57 PM
apitzele apitzele is offline
User
 
Join Date: Dec 2009
Posts: 2
Default app.config

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>
Reply With Quote
  #2  
Old 01-04-2010, 08:29 AM
apitzele apitzele is offline
User
 
Join Date: Dec 2009
Posts: 2
Default workaround

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.
Reply With Quote
  #3  
Old 01-04-2010, 08:34 AM
Robert W. Anderson Robert W. Anderson is offline
CTO
 
Join Date: Apr 2005
Posts: 113
Default

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?
Reply With Quote
Reply

Tags
configuration deployment

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 11:47 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2007 Digipede Technologies, LLC. All Rights Reserved.