algorithmic modeling for Rhino
Hi,
I am trying to use an external SDK (from Amazon Web Services) in my plugin. This assembly requires authentication through a App.config file that must be present in the application that is currently executing. This all works fine for console applications or Unit-testing as long as the App.config file is present, in the respective executing application or assembly.
However in grasshopper I am having some trouble to pin-point where exactly I should store my config file locally so that it is picked up by rhino/ grasshopper/ my plugin.
To clarify the AWS support shows in some examples how to test the presence of the config file using the:
NameValueCollection appConfig = ConfigurationManager.AppSettings;
By checking the keys/ values of the returned collection you can check if the credentials are set. I call this same method in Grasshopper and it returns nothing. When calling a method from the Amazon SDK I get the following:
1. Solution exception:Could not load file or assembly 'AWSSDK, Version=2.0.8.0, Culture=neutral, PublicKeyToken=9f476d3089b52be3' or one of its dependencies. The system cannot find the file specified.
I think file that cannot be found is my config file. However where should I put it? Using some reflection I have found:
Can someone explain me how I should interpret the default runtime configuration of Grasshopper? Should I store my config in the Rhino system directory or in the grasshopper directory? (neither worked for me)
What about my own .gha plugin?
Thanks,
Dion
Tags:
Update:
(For future reference) I managed to resolve the Solution Exception by placing a copy of the AWS assembly in the folder from where Grasshopper loads my *.gha plugin.
Now in order to access the config file I just needed to copy it the the Rhino system folder and rename it to the executing directory Rhino.exe.config.
Thanks for posting the solution.
--
David Rutten
david@mcneel.com
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by