473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

app.config access from DLL with MTS on NT4 - Interop

I have a DLL created by vb.net using the comclass template.
This Dll will be running in MTS on Windows NT4.

When testing the DLL from a stub EXE, the config file is located with the EXE.

Where should the app.config be located in a MTS environment?
And what is the app exe name?

Here is a code snippit:
Dim objNameValueCollection As NameValueCollection =
ConfigurationSettings.GetConfig(strHost)

strHost will be either 'EDS' or 'GPS' in this example.

Here is the config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<configSections>
<sectionGroup name="Gateway">
<section name="EDS" type="System.Configuration.NameValueSectionHandler " />
<section name="GPS" type="System.Configuration.NameValueSectionHandler " />
</sectionGroup>
</configSections>

<Gateway>
<EDS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOutSeconds" value = "10" />
<add key="RecvTimeOutSeconds" value = "10" />
<add key="RecvBufferSize" value = "3000" />
<add key="ConnectRetrys" value = "5" />
<add key="ConnectRetrySleepMilliseconds" value = "1000" />
</EDS>
<GPS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOutSeconds" value = "10" />
<add key="RecvTimeOutSeconds" value = "10" />
<add key="RecvBufferSize" value = "3000" />
<add key="ConnectRetrys" value = "5" />
<add key="ConnectRetrySleepMilliseconds" value = "1000" />
</GPS>

</Gateway>
--
Thank You
Robert Hill
Jul 21 '05 #1
6 1713
No matter what you are building the highest level process in that domain
controls the config file. Having said that ... in general, COM+/MTS processes
are best served from a known location rather than attempt to use the .NET
config file. There may be a way around this, but technically you are in the
COM world when you start playing around with component services. As such, you
are playing, at least in part, by COM rules.

If someone knows an exception to my understanding, please post. I would love
to learn some new tricks.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"RobertHillEDS" wrote:
I have a DLL created by vb.net using the comclass template.
This Dll will be running in MTS on Windows NT4.

When testing the DLL from a stub EXE, the config file is located with the EXE.

Where should the app.config be located in a MTS environment?
And what is the app exe name?

Here is a code snippit:
Dim objNameValueCollection As NameValueCollection =
ConfigurationSettings.GetConfig(strHost)

strHost will be either 'EDS' or 'GPS' in this example.

Here is the config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<configSections>
<sectionGroup name="Gateway">
<section name="EDS" type="System.Configuration.NameValueSectionHandler " />
<section name="GPS" type="System.Configuration.NameValueSectionHandler " />
</sectionGroup>
</configSections>

<Gateway>
<EDS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOutSeconds" value = "10" />
<add key="RecvTimeOutSeconds" value = "10" />
<add key="RecvBufferSize" value = "3000" />
<add key="ConnectRetrys" value = "5" />
<add key="ConnectRetrySleepMilliseconds" value = "1000" />
</EDS>
<GPS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOutSeconds" value = "10" />
<add key="RecvTimeOutSeconds" value = "10" />
<add key="RecvBufferSize" value = "3000" />
<add key="ConnectRetrys" value = "5" />
<add key="ConnectRetrySleepMilliseconds" value = "1000" />
</GPS>

</Gateway>
--
Thank You
Robert Hill

Jul 21 '05 #2
The reason I am looking to use the app.config .net functionality is because
it is my understanding that .net will read the values on the first reference.
The values are then cached for future use. I wish to avoid reading the
config file or a database on every call of this DLL. This is going to be a
Sockets DLL with a somewhat high volume of activity.

Thanks for the input.
Robert Hill

"Cowboy (Gregory A. Beamer) - MVP" wrote:
No matter what you are building the highest level process in that domain
controls the config file. Having said that ... in general, COM+/MTS processes
are best served from a known location rather than attempt to use the .NET
config file. There may be a way around this, but technically you are in the
COM world when you start playing around with component services. As such, you
are playing, at least in part, by COM rules.

If someone knows an exception to my understanding, please post. I would love
to learn some new tricks.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"RobertHillEDS" wrote:
I have a DLL created by vb.net using the comclass template.
This Dll will be running in MTS on Windows NT4.

When testing the DLL from a stub EXE, the config file is located with the EXE.

Where should the app.config be located in a MTS environment?
And what is the app exe name?

Here is a code snippit:
Dim objNameValueCollection As NameValueCollection =
ConfigurationSettings.GetConfig(strHost)

strHost will be either 'EDS' or 'GPS' in this example.

Here is the config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<configSections>
<sectionGroup name="Gateway">
<section name="EDS" type="System.Configuration.NameValueSectionHandler " />
<section name="GPS" type="System.Configuration.NameValueSectionHandler " />
</sectionGroup>
</configSections>

<Gateway>
<EDS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOutSeconds" value = "10" />
<add key="RecvTimeOutSeconds" value = "10" />
<add key="RecvBufferSize" value = "3000" />
<add key="ConnectRetrys" value = "5" />
<add key="ConnectRetrySleepMilliseconds" value = "1000" />
</EDS>
<GPS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOutSeconds" value = "10" />
<add key="RecvTimeOutSeconds" value = "10" />
<add key="RecvBufferSize" value = "3000" />
<add key="ConnectRetrys" value = "5" />
<add key="ConnectRetrySleepMilliseconds" value = "1000" />
</GPS>

</Gateway>
--
Thank You
Robert Hill

Jul 21 '05 #3
Thanks for Gregory's quick response!

Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know where to put the
config file for the DLL when you're using it from an MTS on NT4. If there
is any misunderstanding, please feel free to let me know.

As far as I know, only an EXE uses config file to store data, DLL doesn't
have a config file. If you're referring to the .config file for the caller,
I think it has to be in the same directory as the EXE.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4
Thanks for Gregory's quick response!

Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know where to put the
config file for the DLL when you're using it from an MTS on NT4. If there
is any misunderstanding, please feel free to let me know.

As far as I know, only an EXE uses config file to store data, DLL doesn't
have a config file. If you're referring to the .config file for the caller,
I think it has to be in the same directory as the EXE.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #5
When calling a .net program from a DLL within MTS, the .net app config file
will be located with the MTX.EXE program. And its name will be
MTX.EXE.CONFIG. This location on our server was WINDOWS/SYSTEM32.

Robert.
"Kevin Yu [MSFT]" wrote:
Thanks for Gregory's quick response!

Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know where to put the
config file for the DLL when you're using it from an MTS on NT4. If there
is any misunderstanding, please feel free to let me know.

As far as I know, only an EXE uses config file to store data, DLL doesn't
have a config file. If you're referring to the .config file for the caller,
I think it has to be in the same directory as the EXE.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #6
Hi Robert,

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cui | last post by:
Hello, I make an application in ASP.NET (using VB.NET and some web services). For my needs, I use also the SQL DMO library (with the SQL DMO.interop assembly) and the Microsoft Web UI controls...
4
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
6
by: RobertHillEDS | last post by:
I have a DLL created by vb.net using the comclass template. This Dll will be running in MTS on Windows NT4. When testing the DLL from a stub EXE, the config file is located with the EXE. Where...
0
by: Laura Papez | last post by:
(note: orginally posted to the dotnet.framework.webservices.enhancements folks - thought this group may have more experience in this area. Ta, Laura.) Hi, I have created a secure Web Service...
1
by: Joseph Geretz | last post by:
I've been using the following (client-side) configuration block to allow WSE/DIME transfer of files larger than 4 meg: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging> (Of...
1
by: Joseph Geretz | last post by:
I need to download a greater than 4 megabyte attachment via WSE / DIME. The only way I know how to configure this is via a .config file. Normally, the ..config file is the same name as the base...
0
by: SuperJason | last post by:
We have a web application that uses 2 different virtual directories. - The first is an ASP.NET application that has web services that can be used to authenticate various clients. - The second is...
3
by: prabu.girirajan | last post by:
Hi, I have a web application which internally calls certain web methods of a web service. This web service has a interop to ATL COM Component and that ATL component calls a .NET assembly. I would...
0
by: iprogram2008 | last post by:
I have a huge complex app.config and one of the sections in the config is connection strings. I have a dot net class that uses this app.config and a com interop is generated for this dot net class....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.