Problem with LinqPad.exe integration
Hi,
I'm trying to integrate LinqPad in my environnement using beta version (I have added reference to any cpu version into my project).
All is working fine with "C# expression" query but I have a problem when I try to use my own dll inside a "C# Program" with Util.Run while it works well directly in LINQPad.
In fact I am using Unity in order to use Dependency injection (DbContext). Unity need to read a unity section inside the web.config file like this :
Unfortunatly when I call Util.Run with my web application the ConfigurationManager target the "C:\Program Files (x86)\IIS Express\iisexpress.exe.config".
I tried to use what I found on forums to force running good configuration file with :
and
The ConfigurationManager seems to target the good file but my "ConfigurationManager.GetSection("unity")" with unity always returning a null value.
With debug in my application I can see that "AppDomain.CurrentDomain.SetupInformation.ConfigurationFile" et "System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).FilePath" have the good value with "C:\Program Files (x86)\LINQPad4\LINQPad.config" but "ConfigurationManager.GetSection("unity")" always null.
Do you please have any idea ?
We really need this functionnality in our application to run program with our business logic.
Thank you very much
I'm trying to integrate LinqPad in my environnement using beta version (I have added reference to any cpu version into my project).
All is working fine with "C# expression" query but I have a problem when I try to use my own dll inside a "C# Program" with Util.Run while it works well directly in LINQPad.
In fact I am using Unity in order to use Dependency injection (DbContext). Unity need to read a unity section inside the web.config file like this :
UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
Unfortunatly when I call Util.Run with my web application the ConfigurationManager target the "C:\Program Files (x86)\IIS Express\iisexpress.exe.config".
I tried to use what I found on forums to force running good configuration file with :
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", @"C:\Program Files (x86)\LINQPad4\LINQPad.config");
and
File.Copy(@"C:\Program Files (x86)\LINQPad4\LINQPad.config", AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, true);
The ConfigurationManager seems to target the good file but my "ConfigurationManager.GetSection("unity")" with unity always returning a null value.
With debug in my application I can see that "AppDomain.CurrentDomain.SetupInformation.ConfigurationFile" et "System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).FilePath" have the good value with "C:\Program Files (x86)\LINQPad4\LINQPad.config" but "ConfigurationManager.GetSection("unity")" always null.
Do you please have any idea ?
We really need this functionnality in our application to run program with our business logic.
Thank you very much
Comments