Settings.Settings file

Settings.Design.cs file defaultInstance returns the localhost url instead of remote machine url. The webservice is hosted in remote machine so that the defaultinstance should be returns remote machine url but instead of it returns localhost url. The solution caches the settings somewhere in the physical path? Please anyone know the solution let me know. Thanks.

0
periasamy_PM
8/25/2008 11:31:00 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

1 Replies
1106 Views

Similar Articles

[PageSpeed] 9

The Settings.designer.cs file is the automatically-generated settings that you edit in the Settings.settings file.

You should edit the value using the settings editor, not in the .cs file. To do that, double-click on the settings.settings file or double-click on the project and click "Settings". After you make the change, it then appears in the .cs file as (among other attributes):

[global::System.Configuration.DefaultSettingValueAttribute("MyValue!")]

This allows you to specify a value in your project and then have that initial value become the default. 

If you edit the settings.settings file and the value in the settings.designer.cs file does not change, you can delete the settings.designer.cs file and then right-click on the settings.settings file and select "Run custom tool". That will regenerate the settings.designer.cs file.

After all that's done, you can change the settings in your web.config file as well. You can use the config file to change the value and not have to recompile your application. This is nice for deploying to different environments where you need settings to change, but don't want to change code. For that to happen, you will need to have this section in the web.config file, with the placeholders replaced for your particular site (like MyWebSite, MySetting, MyValue):

<configSections>
 
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
    <section name="MyWebSite.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </sectionGroup>
</configSections>

And then...

<applicationSettings>
 
<MyWebSite.Properties.Settings>
    <setting name="MySetting" serializeAs="String">
      <value>myValue!</value>
    </setting>

  </
MyWebSite.Properties.Settings>
</applicationSettings>

This is all assuming you're using C# - if you're in VB, the names of the generated classes are slightly different.


Wes
www.umbyersw.com
0
umbyersw
8/25/2008 10:30:32 PM
Reply:

Similar Artilces:

Problems with Web Reference, Settings.Settings file and Web.Config
Hi all!I have added a Web Service to my application and noticed it added a Settings.Setting file with the url to my Web Service. My question is how to change this value after i compiled the project and are on my web server. As far as i can see the Settinsg file is compiled and is "inside the dll" .. Can't i make the URL for the webservice to be added to the Web.Config instead of the Settings file? Or is there any other solution here that i have missed, im not so familiar with the Settings file .. Br, Ola I actually solved it myself. My Web.Config was missing the section <sectionGrou...

how to set SMTP Server setting in web.config file
hi,   I want to send email from passwordrecovery control so that user can get there password by email, i am using this this code in web.config file.  This is the  SMTP Server: mail.musiciq.co.uk given to me by discountasp.net. When i use this code then it gives error   <system.net>  <mailSettings>   <smtp deliveryMethod="Network">    <network defaultCredentials="false" host="mail.musiciq.co.uk" password="password" userName="definitivem" from="info@musiciq.co.uk" />   </smtp>  </...

After migration from .Net 1.1 to .Net 3.5 do I have to incorporate new web.config settings in old *.config file
Hi,I have successfully migrated web application from .Net 1.1 to .Net 3.5. Could you let me know whether I have to incorporate setting in new web.config (this new web.config file was generated automatically due to migration) into old *.config file?FYI: Old *.config file contains all application level settings required. So I will continue to use old.config file by removing new web.config file. Settings which are in new web.config file are:<configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,...

Web.Config and Settings.settings
Say you have a web application that references a class library.  How can you put values in the web.config file so that the settings.Designer.vb file (in the class library) can access them?  I have just cut and pasted the "applicationSettings" section from the app.config of the class library to the web.config of the webApp, but this does not seem to have worked.E.G.  I have a setting "MyTestURL" in the settings.settings file of the class library. This results in an autogenerated property  "MyTestURL" in the corresponding settings.designer file...

getting forms authentication settings from web.config file
I'm trying to programmatically determine the loginUrl defined in my web.config file. When debugging, I can see that: ConfigurationSettings.GetConfig("system.web/authentication") returns an object of type: System.Web.Configuration.AuthenticationConfig However, this class is inaccessible. Anyone know of any other way to get the authentication mode?? You could try using reflection. Alternatively (and probably better), you can load your web.config file into an XmlDocument and get the relevant attribute using an XPath expression. Something like this sho...

How to programatically manipulate forms authentication settings of web.config file
Hello,  I am looking for a way to programatically edit the web.config file for the section below. Most importantly I will need to set the password to a certain value stored in the database. It is only the password that keeps changing in database, username remains the same. Can you please suggest a way this can be done in C# 2.0? <authentication mode="Forms">  <forms loginUrl="Login.aspx" timeout="60" protection="All">     <credentials passwordFormat="Clear">      <...

How we Call settings from this web.config settings
Edited by SomeNewKid. Please post code between <code> and </code> tags. -----------------Web Config---------------------------------------- <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="yafnet" type="yaf.SectionHandler,yaf" /> </configSections> <yafnet> <connstr>Trusted_Connection=yes;data source=(local);initial catalog=yafnet;timeout=90</connstr> <root>/yetanotherforum.net/</root> <language&...

Dynamic Web References in Settings.Settings
Greetings, With ASP.Net in the 1.1. framework, I commonly created web site solutions that contained a project for web pages, and a separate assembly project(.dll) for business objects.  The web project would reference in the business object .dll.  The business object project had an app.config file in which I contained a dynamic reference to a web service (typically for database access).  The reference needed to be dynamic, so that I could change the reference for different deployments simply by changing the entry in the config file. In the ...

Web.config vs Settings.settings
Fellow .NETers,  Can you tell me what the difference is betweens the Web.config and Settings.settings and when I should use either.  Currently I am only using the Web.config like so <appSettings><add key="SMTPServer" value="xxxx" /> <add key="DealEmailFromDefault" value=""/><add key="SMTPHost" value="xxxx"/><add key="SecurityTeamEmail" value="xxxxx"/>   </appSettings> Then call in my code like so -  ConfigurationManager.AppSettings["SecurityTea...

How to deploy .Net Windows/Web applications
Hello can anyone please advise me guide me how to deploy .Net Windows/Web applications. I know how to do basic deployment but i want to know more about database connection string, Support files specific to application.   Please help--------ThanksSK Hi there,Database connections will not change too much, you will only need to change the Uid,password, server and sometimes database name.you can also create a setup file which will setup all the things. check out these:http://support.microsoft.com/kb/818016 http://15seconds.com/issue/041229.htm http://www.microsoft.com/tec...

How to assign an XML file to a data set without reading it from a file. The data set is in a string.
I want to bind some XML data to a data list control on my web form. Here is my problem:   I have a data set that is populated via a call to a sql stored procedure. I need the data set data to be in XML format though. I can convert the data to an XML formatted string using the GetXML() method. But  I don't know how to assign it back to the DataSet. Does anyone know how to do this. Here is some code I have written. It is close but it does not completely do what I want done. 1. DataSet myDataSet = myWebService.GetData(); // Populate the data set via a SQL stored proc ...

Where are the Novell Client settings like file-caching and file-commit set in the registry on the Win7 client?
I know that they were stored under HKLM\System\CurrentControlSet\Services\NetwareWorkstation\Parameters in the XP client and earlier versions. On Win7 this entry is almost empty and some "cryptic" settings like "Enable Cache", "Enable Write Behind" are found in HKLM\SOFTWARE\Novell\Client\Parameters . Is this now the location for the advanced client settings with changed names to complicate things or should they be found somewhere else? -- W. Prindl Yes, that's where those particular settings are kept, but there is at least one other change i...

save settings // import settings // export settings
Name: miguel mayol Email: mitcoes_at_gmail.com Product: Firefox Summary: save settings // import settings // export settings Comments: I've just have a stack overflow problem in one of the computers of my office with internet explorer. The other ones, does work with our provider web site ok. But Firefox and Opera does work OK ata all the computers with this site, with problems of bad reading of contents at some pages (I supose becouse of MS HTML non compatible isues). If IE would have export // import settings, probably I've solved all the problems, but I would...

web.config and Settings.settings (overrides) issue
Hi, Our team have several ASP.NET C# projects and have been using Settings.settings and web.config without issues. Basically we like Settings.Settings when development because it provides a nice interface to add configuration values. When we deploy to production, we just update the values in web.config file without touch Settings.Settings, and it has been working fine. Recently however we have this issue and it is quite clear that the value in Settings.settings (or Settings.Designer.cs) is in use but not the value in web.config file. It is causing us problems as we seem to have to upda...

Web resources about - Settings.Settings file - asp.net.web-forms

Help:Contents/Account settings and maintenance - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Campaign setting - Wikipedia, the free encyclopedia
A campaign setting is usually a fictional world which serves as a setting for a role-playing game or wargame campaign. A campaign is a series ...

Privacy Setting For New Facebook Users Aged 13-17 Now Defaults To ‘Friends’
Facebook is changing the initial default privacy setting for users aged 13 through 17 to friends, from friends of friends, but those teen users ...

Facebook changes default privacy settings for new users to friends-only
Facebook announced today a shift in privacy settings for new users. Now, when someone signs up for a profile, their default posting status is ...

Woolworths to tap Chinese consumer by setting up shop on Tmall
Woolworths is aiming to tap China's demand for Australian food and grocery products on China's largest online business-to-consumer market.

Setting Up TV Ads With Facebook Ads
How do consumers respond to television ads that they have already seen, either on Facebook or on TV? Facebook IQ commissioned a study by neuromarketing ...

Woolworths to tap Chinese consumer by setting up shop on Tmall
Woolworths is aiming to tap China's demand for Australian food and grocery products on China's largest online business-to-consumer market.

Here's all the dramatic video from last night's record-setting landing by SpaceX
SpaceX has set a record in the race to make commercial space flight a reality. Elon Musk and his company have successfully launched and landed ...

Amazon Celebrates a Record-Setting Holiday for Prime, Amazon Original Series and Amazon Devices
Amazon Celebrates a Record-Setting Holiday for Prime, Amazon Original Series and Amazon Devices&nbsp;

Man charged with setting Houston mosque afire says he was a devout attendee
Chron.com Man charged with setting Houston mosque afire says he was a devout attendee Chron.com A Houston man has been arrested in connection ...

Resources last updated: 1/4/2016 4:59:16 PM