473,804 Members | 3,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 objNameValueCol lection As NameValueCollec tion =
ConfigurationSe ttings.GetConfi g(strHost)

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

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

<configSections >
<sectionGroup name="Gateway">
<section name="EDS" type="System.Co nfiguration.Nam eValueSectionHa ndler" />
<section name="GPS" type="System.Co nfiguration.Nam eValueSectionHa ndler" />
</sectionGroup>
</configSections>

<Gateway>
<EDS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOu tSeconds" value = "10" />
<add key="RecvTimeOu tSeconds" value = "10" />
<add key="RecvBuffer Size" value = "3000" />
<add key="ConnectRet rys" value = "5" />
<add key="ConnectRet rySleepMillisec onds" value = "1000" />
</EDS>
<GPS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOu tSeconds" value = "10" />
<add key="RecvTimeOu tSeconds" value = "10" />
<add key="RecvBuffer Size" value = "3000" />
<add key="ConnectRet rys" value = "5" />
<add key="ConnectRet rySleepMillisec onds" value = "1000" />
</GPS>

</Gateway>
--
Thank You
Robert Hill
Jul 21 '05 #1
6 1736
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!
*************** ************

"RobertHill EDS" 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 objNameValueCol lection As NameValueCollec tion =
ConfigurationSe ttings.GetConfi g(strHost)

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

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

<configSections >
<sectionGroup name="Gateway">
<section name="EDS" type="System.Co nfiguration.Nam eValueSectionHa ndler" />
<section name="GPS" type="System.Co nfiguration.Nam eValueSectionHa ndler" />
</sectionGroup>
</configSections>

<Gateway>
<EDS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOu tSeconds" value = "10" />
<add key="RecvTimeOu tSeconds" value = "10" />
<add key="RecvBuffer Size" value = "3000" />
<add key="ConnectRet rys" value = "5" />
<add key="ConnectRet rySleepMillisec onds" value = "1000" />
</EDS>
<GPS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOu tSeconds" value = "10" />
<add key="RecvTimeOu tSeconds" value = "10" />
<add key="RecvBuffer Size" value = "3000" />
<add key="ConnectRet rys" value = "5" />
<add key="ConnectRet rySleepMillisec onds" 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!
*************** ************

"RobertHill EDS" 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 objNameValueCol lection As NameValueCollec tion =
ConfigurationSe ttings.GetConfi g(strHost)

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

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

<configSections >
<sectionGroup name="Gateway">
<section name="EDS" type="System.Co nfiguration.Nam eValueSectionHa ndler" />
<section name="GPS" type="System.Co nfiguration.Nam eValueSectionHa ndler" />
</sectionGroup>
</configSections>

<Gateway>
<EDS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOu tSeconds" value = "10" />
<add key="RecvTimeOu tSeconds" value = "10" />
<add key="RecvBuffer Size" value = "3000" />
<add key="ConnectRet rys" value = "5" />
<add key="ConnectRet rySleepMillisec onds" value = "1000" />
</EDS>
<GPS>
<add key="IPAddress" value = "127.0.0.1" />
<add key="Port" value = "8000" />
<add key="SendTimeOu tSeconds" value = "10" />
<add key="RecvTimeOu tSeconds" value = "10" />
<add key="RecvBuffer Size" value = "3000" />
<add key="ConnectRet rys" value = "5" />
<add key="ConnectRet rySleepMillisec onds" 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 misunderstandin g, 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 misunderstandin g, 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 misunderstandin g, 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
1946
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 (in order to have the tree view, multi bar controls). When I make the compilation and the execution, I obtain then the next error: "
4
12286
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
6
346
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 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 =
0
1810
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 via WSE with the use of WS-Policy. The Web Service has been tested using a .NET client Console Application and everything works. However, the Web Service needs to be called from a VB6 application (running
1
1920
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 course, I have a similar encoding on the Server. However, my question relates to the client side.)
1
2570
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 application. I built a .NET driver program to test this, NetBrokerDriver and provided a NetBrokerDriver.exe.config file which specifies the following: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging>
0
1333
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 simply an ASP application, that uses a .NET dll registered for COM interop, so that it can talk to the other virtual directory. The problem is that the .NET interop DLL we've been using for a long time, now is breaking. On machines with .NET...
3
1910
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 like to access a key value in the .NET assembly. I added this to the Web.Config of the Web Service however it didnt read the value. I also tried adding to the Web.config of the Web application however i am faced with the same problem. Am I...
0
968
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. I developed an unmanaged c++ app and it calls the com interop tlb. The problem I was getting was when I call from C++ the tlb I get an null reference exception at the following line in .NetClass: ...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5515
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.