M
M Irfan
Recently I have started working in .NET 2.0. I am developing a web
service application that references a DLL component written in C# 2.0.
The component has its own config file which contains settings related
to business logic coded in that component. I can reference and load
the component but unable to read load the custom config file of that
component. I know that the same thing is possible if my host
application is any Exe application and using
"ExeConfigurationFileMap", "OpenMappedExeConfiguration" I can read
configuration file other than app.config but the same is not possible
if I use "WebConfigurationFileMap" and "OpenMappedWebConfiguration".
Using both these we can only define the mappings b/w virtual and
physical directories but can't read config file other than
web.config.
string dummyVirtualPath = "/test_web_2005";
string physicalPath = @"C:\Inetpub\wwwroot
\test_web_2005\Bin";
string configFileName =
System.IO.Path.GetFileName(assembly.CodeBase) + ".config";
WebConfigurationFileMap map = new WebConfigurationFileMap();
map.VirtualDirectories.Add(dummyVirtualPath, new
VirtualDirectoryMapping(physicalPath, true));
Configuration config =
WebConfigurationManager.OpenMappedWebConfiguration(map,
dummyVirtualPath);
Is there any other idea to implement the same. Thanks in advance.
Regards
Irfan
service application that references a DLL component written in C# 2.0.
The component has its own config file which contains settings related
to business logic coded in that component. I can reference and load
the component but unable to read load the custom config file of that
component. I know that the same thing is possible if my host
application is any Exe application and using
"ExeConfigurationFileMap", "OpenMappedExeConfiguration" I can read
configuration file other than app.config but the same is not possible
if I use "WebConfigurationFileMap" and "OpenMappedWebConfiguration".
Using both these we can only define the mappings b/w virtual and
physical directories but can't read config file other than
web.config.
string dummyVirtualPath = "/test_web_2005";
string physicalPath = @"C:\Inetpub\wwwroot
\test_web_2005\Bin";
string configFileName =
System.IO.Path.GetFileName(assembly.CodeBase) + ".config";
WebConfigurationFileMap map = new WebConfigurationFileMap();
map.VirtualDirectories.Add(dummyVirtualPath, new
VirtualDirectoryMapping(physicalPath, true));
Configuration config =
WebConfigurationManager.OpenMappedWebConfiguration(map,
dummyVirtualPath);
Is there any other idea to implement the same. Thanks in advance.
Regards
Irfan