I have a project where I am using a customized .xml file which is necessary for the solution to run. This XML file can be/should be allowed to change based on what we want the solution to support, for example, we can change the language from English to French and vice Versa.
I know I can add that file as a miscellaneous file and get the path at Runtime but that would mean the .xml file would be a part of the openspan.zip package and not outside it. I want the file to be outside the .openspan package and not inside it because the change can be managed easily or by someone else who has access to that folder.How can I achieve this?
I have attached a screenshot where I can see that a folder option is present under miscellaneous file dialog. Can I know what is the function of the Folder there?
You do not want to use miscellaneous files as they are included with the deployment package as you have stated. If you want the file to be external to the project, then you would simply include the path to it in your project somewhere in a variable (you'll want the file stored on a network location that all users would have access to).
Expanded at Runtime just means that you can use a special user-specific folder like "%AppData% which would get expanded to the real path when the project is loaded.
Is there a way to access files that are included with the deployment packages through a relative path or as a .NET resource? (a resource that would be accessed like this in a C# application)
var myXMLfile = MyNamespace.Properties.Resrouces.HorizonSCValueList
Putting the restraint on developers to use hard coded absolute file paths destroys the portability of the code. This makes it difficult to set up automated builds and share solutions between different development machines. Surely there is another way.
yeah I can use the variable logic but wanted to know if we can do this at Runtime.
On the other hand, is there a way I can get the value of the Startup Project value inside the Runtimeconfig.xml at Runtime. I dont want the deploymentpath or the project path which are available under the Runtime component of the Toolbox .
Posted: 4 years ago
Posted: 2 May 2018 11:48 EDT
Thomas Sasnett (ThomasSasnett)
Lead Robotics Architect
You can use the XML component to read the %AppData%\OpenSpan\RuntimeConfig.xml file (assuming that the config file location has not been changed) if that is what you want to do.
I do not understand what you mean by "do this at runtime". If you have an external config file, then it will need to be in a known place. If you also want that known place to change at Runtime, then you need something else that is constant that you can look at. You need a way to logically determine where the file is.