473,395 Members | 1,539 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,395 software developers and data experts.

Modify values for WCF config in app.config

Hi misters,

i have an app.config of my App that uses WCF.

I need change the configuration servicemodel, and I want update somes values.

//standard method from System.Configuration
Configuration appConfig = ConfigurationManager.OpenExeConfiguration( "Path
to my App.config");

//the main section in the app.config file for WCF
ServiceModelSectionGroup serviceModel =
ServiceModelSectionGroup.GetSectionGroup( appConfig );

First, how can I set values for modify some endpoint address, for change
localhost and port and set another values.

<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NewBinding0" maxReceivedMessageSize="100000000">
<readerQuotas maxArrayLength="163840000" />
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="None"
/>
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8090/ServicioBase/servicio"
binding="netTcpBinding" bindingConfiguration="NewBinding0"
contract="GRUPOBACKUP.WCF.ServicioBase.Contrato.IS ervicioBase"
name="AgenteServicioBase" />
<endpoint address="net.tcp://localhost:8091/ServicioLog/servicio"
binding="netTcpBinding" bindingConfiguration="NewBinding0"
contract="GRUPOBACKUP.WCF.Log.Contrato.ILog"
name="AgenteLog" />
</client>
</system.serviceModel>

Then, how I can refresh section or app.config ? using
System.Configuration.ConfigurationManager.RefreshS ection(...) ???
ConfigurationManagerRefreshSection("system.service Model")
ConfigurationManager.RefreshSection("system.servic eModel/services")
ConfigurationManager.RefreshSection("system.servic eModel/bindings")

Any ideas, suggestions, comments ?

Thanks in advance, greetings, your help is very grateful !!


--
http://www.alhambra-eidos.es/web2005/index.html
www.kiquenet.com/churrosoft
http://www.setbb.com/putainformatica...opic.php?p=843
www.trabajobasura.com/solusoft

Sep 23 '08 #1
0 2446

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

Similar topics

2
by: Neelima Godugu | last post by:
Hi All, Is there a way to modify AppSettings key values during installation of a web app using a web setup project. Thanks in advance. Neelima
5
by: Alberto | last post by:
I need to modify a value in the app.config file with this code: System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); string key =...
9
by: Will | last post by:
I have given up looking for a solution so I figured I would break down and ask. I am trying to modify a CSS class in page_load. I have no problem doing it with an ID with the simple ...
1
by: Joey | last post by:
Is this possible? I have an app where we are using forms authentication and are allow editing/changing of security role names. Since I have set permissions with <locationtags in web.config (i.e....
1
by: =?Utf-8?B?Q2h1Y2sgUA==?= | last post by:
I have an asp.net solution with a web deployment project. When we try to build/debug, we get the message: An editor or project is attempting to check out a file that is modified in memory,...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
1
by: =?Utf-8?B?TGV2ZW50IERhZ2lzdGFubGk=?= | last post by:
I think you are running your code from VS. Just run the exe from outside and it will work. Thanks, Levent Dagistanli "Andrew" wrote:
6
by: Ramesh | last post by:
Hello, I am using the ofstream class to create a text file with keys and values like: Key1=Value10 Key2=Value15 Key3=Value20 In case I need to set a new value for Key2, say value50 - I am...
5
by: ziycon | last post by:
I have two PHP files, modify.php & config.php, I have the below code in config.php and I'm wondering how I would go about searching config.php from modify.php and changing the values in config.php? ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
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,...
0
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...
0
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...

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.