3 Replies - 269 Views - Last Post: 03 September 2018 - 09:32 PM Rate Topic: -----

#1 maj3091   User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 2,005
  • Joined: 26-March 09

Can't seem to update applications settings on a WebApp under IIS

Posted 01 September 2018 - 04:34 AM

Hi,

I've having a bit of a dabble with WebAPI2 and I've got a simple WebApp running under IIS on Server 2016 without issue.

The WebApp wraps around another webservice.

I've added the webservice URL into the ApplicationSettings through the designer in visual studio with application scope, so it appears in the Setting.Settings file and I can access it in code using the syntax of Properties.Settings.Default.MyURL.

This may well be something trivial due to my lack of understanding, but I can seem to change this underlying URL in the deployed application.

Now it's deployed, I can't find a settings.settings file for the webapp and the MyURL property doesn't appear in the WebConfig file, nor does it appear under the WebApp configuration in IIS.

I did however find a file under the bin\properties folder called Settings.Designer.cs, which does contain the URL, but changing it in there doesn't seem to affect the WebApp, it still uses the original URL, even after restarting IIS and even restarting the server.

Do these settings get compiled into the application, as I'm sure I'd read I'd be able to change them once deployed.

If anyone could point me in the right direction, I'd greatly appreciate it.

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Can't seem to update applications settings on a WebApp under IIS

#2 maj3091   User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 2,005
  • Joined: 26-March 09

Re: Can't seem to update applications settings on a WebApp under IIS

Posted 01 September 2018 - 10:21 AM

Just an update to say I've moved this setting out the AppSettings part of the web.config file and it can be edited as expected.

I'd still be interested on any insight to the original post, even if it's just confirmation that what I tried to do wouldn't work how I expected.

Thanks

This post has been edited by maj3091: 01 September 2018 - 10:22 AM

Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is online

  • quantum multiprover
  • member icon

Reputation: 6778
  • View blog
  • Posts: 27,973
  • Joined: 12-December 12

Re: Can't seem to update applications settings on a WebApp under IIS

Posted 02 September 2018 - 03:55 AM

Don't change any designer files, they are created for us and any changes will be overwritten at some point.

I'm not sure if anything changes for webapi2, but double clicking settings.settings writes to web.config for me.
Was This Post Helpful? 0
  • +
  • -

#4 maj3091   User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 2,005
  • Joined: 26-March 09

Re: Can't seem to update applications settings on a WebApp under IIS

Posted 03 September 2018 - 09:32 PM

Thanks Andrew, I'll have a play in a separate project to see if I can figure out what's going on.

Definitely wasn't being written to the web.config, but was working correctly, almost like it was compiled in, so I've probably missed something.

Thanks again.

This post has been edited by maj3091: 03 September 2018 - 09:32 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1