Custom Job Processor Configuration File

Custom Job Processor Configuration File

Anonymous
Not applicable
1,139 Views
2 Replies
Message 1 of 3

Custom Job Processor Configuration File

Anonymous
Not applicable

Is there any way to read from an assembly configuration file (xxx.dll.config) from a Vault Job Processor using the standard method of Properties.Settings.PropertyName?

 

I attempted to use a config file for NLog in a previous processor that I wrote, but none of the options were read (and thus logging did not work). Before I go down the path of rolling my own configuration, I wanted to check to see if I was doing something wrong or if the options need to be added to the JobProcessor config file instead.

0 Likes
1,140 Views
2 Replies
Replies (2)
Message 2 of 3

Redmond.D
Autodesk
Autodesk

I've only used .exe.config files.  I'm not sure if there is such a thing as .dll.config files.  You will have to look at the .NET documentation from Microsoft to find out more.

 

I don't suggest adding your own content to JobProcessor.exe.config.  That's a component installed with the Vault client.  An update or hotfix may overwrite your change.  In my plug-ins, I usally just load the settings file directly from my code.



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes
Message 3 of 3

Anonymous
Not applicable

If you have an addin called addin.dll, you can access its configuration file (addin.dll.config) like this

 

var executingAssembly = System.Reflection.Assembly.GetExecutingAssembly();
var location = executingAssembly.Location;
var config = ConfigurationManager.OpenExeConfiguration(location);
var sections = config.Sections;
string tempPath = config.AppSettings.Settings["OutputFolder"].Value.ToString();


Hope it helps

Nick

 

 

 

 

 

 

0 Likes