I am trying to create a Template Wizard in C# for adding Project Items to a project in Visual Studio and am running into some problems regarding app.config files.
Essentially I am trying to replace a separate application that was made by my company for creating ORM objects for their own custom ORM system. However though, I've been told that even in utilizing my own Template Wizard, I still have to instantiate and use their own logging mechanisms that they've created in C#.
So, from the template wizard's dll (which I have strongly named and installed to the GAC), here is the line where I have trouble.
Assembly cricketRunAsm = Assembly.Load("Cricket.Cor
Type runType = cricketRunAsm.GetType("Cri
(Cricket is the name of their framework, and it's not strongly-named either, so basically I copy it to the current directory (which in my case is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE running from the Wizard), and then load the assembly. Then I try to instantiate the Start class which is the startup class to instantiate all of the logging and everything. From the Wizard I get an error when instantiating this class though, doing a little more debugging I found that the problems happen on this section of code in their core:
String primaryServer = System.Configuration.Confi
String secondaryServer = System.Configuration.Confi
String tertiaryServer = System.Configuration.Confi
Essentially, these are all coming up blank because there is no app.config for the Template Wizard app, and thus the core code is failing when instantiated since there is no server to point to (and unfortunately I have no control over changing their core code), they use these settings to determine a server name to point to for their services. I can of course find these server settings off of their SVN server and have seen the app.conig that they use, but I have no way of getting them to into ConfigurationManager.AppSe
ttings when calling this dll as a Template Wizard inside VS.
I tried some suggestions from this site as well:
As it shows how to point to a separate .config file and load it as the application's config, this seems to work fine when running from a standalone application running the dll, but not as a template wizard running inside VS.