reading web.config from a com exposed c# assembly

S

spacekid

Hi there

I am exposing a c# assembly as a COM component (regasm /codebase) and
calling it from classic asp. When I try to call the
ConfigurationSettings.AppSettings function in the c# assembly, it does
not return the values from my web.config.

The web.config is located in the root of the web application. The
classic asp page that calls the COM exposed c# assembly is located in a
subfolder called message. Can anyone help me out here?

Martyn
 
S

spacekid

so that means that there is no easy way of reading from the web.config
through a COM exposed c# assembly from classic asp?
 
O

Ollie Riches

what you can do is defined a config file for the c# COM assembly

i.e. define an application manifest file the dll and then define the
app.config for the file.

foobar.dll
foobar.manifest
foobar.config

This config file would only be used by the c# COM assembly.


foobar.manfiest

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
</assembly>

foobar.config


<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<appSettings>

<add key="connString" value="connectionString" />

</appSettings>

</configuration>





--
HTH

Ollie Riches
http://www.phoneanalyser.net

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top