473,748 Members | 11,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Configur ation
Configuration appConfig = ConfigurationMa nager.OpenExeCo nfiguration( "Path
to my App.config");

//the main section in the app.config file for WCF
ServiceModelSec tionGroup serviceModel =
ServiceModelSec tionGroup.GetSe ctionGroup( appConfig );

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

<system.service Model>
<bindings>
<netTcpBindin g>
<binding name="NewBindin g0" maxReceivedMess ageSize="100000 000">
<readerQuotas maxArrayLength= "163840000" />
<security mode="None">
<transport clientCredentia lType="Windows" protectionLevel ="None"
/>
<message clientCredentia lType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tc p://localhost:8090/ServicioBase/servicio"
binding="netTcp Binding" bindingConfigur ation="NewBindi ng0"
contract="GRUPO BACKUP.WCF.Serv icioBase.Contra to.IServicioBas e"
name="AgenteSer vicioBase" />
<endpoint address="net.tc p://localhost:8091/ServicioLog/servicio"
binding="netTcp Binding" bindingConfigur ation="NewBindi ng0"
contract="GRUPO BACKUP.WCF.Log. Contrato.ILog"
name="AgenteLog " />
</client>
</system.serviceM odel>

Then, how I can refresh section or app.config ? using
System.Configur ation.Configura tionManager.Ref reshSection(... ) ???
ConfigurationMa nagerRefreshSec tion("system.se rviceModel")
ConfigurationMa nager.RefreshSe ction("system.s erviceModel/services")
ConfigurationMa nager.RefreshSe ction("system.s erviceModel/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 2475

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

Similar topics

2
3052
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
9451
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 = "Path"; string value = "New value"; config.AppSettings.Settings.Add(key, value); config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection("appSettings");
9
2026
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 HTMLID.Style = "10px"; however I need to apply it to a CSS class not a single ID. What is the code for that?
1
1828
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. allow roles="Administrator"), I will also need to modify the values there. TIA, JP
1
2788
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, which will result in saving it. Saving files during the build process is dangerous and can result in incorrect build outputs in future. Do you want to continue with the check out?
3
13660
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 B's app.config. I've referenced System.configuration.dll within Project B, and from one of the classes inside Project B's namespace, I'm trying to use ConfigurationManager to write to its app.config. Unfortunately, it only finds Project A's...
1
3247
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
4977
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 able to
5
5485
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? Should I be using something like file_get_contents() or is there an easier way? config.php <?php ##################### ##################### //WARNING: DON'T CHANGE BELOW HERE
0
9537
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
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...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
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
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
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...
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
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.