locked
Worker role can no longer access App.config RRS feed

  • Question

  • I have a Worker role that has been working well for Quite Some Time.  However I recently ran through some NuGet updates (which included the new Microsoft BCL stuff as a dependency ... grrr) and after this it appears that my Worker role can no longer get configuration data stored in the App.config file.  All my other Web and WebService roles are not experiencing this issue.

    Unless I'm mistaken, the build process automatically converts this App.config into the filename of the executable/DLL when done.  I searched on the server (E:\ typically) for any .config files and reviewed those.  The server didn't have a matching one to my file.  I then flipped the Copy Always setting and deployed again.  I confirmed the files were there (\bin\x64) but it made no difference.

    I note that this issue does NOT occur if I test locally with the emulator, or if I do a publish from Visual Studio (which unfortunately takes over an hour to upload).  But it DOES occur if I use TFS (visualstudio.com), which I'm using Continuous Integration with.

    So a few questions...

    Does anyone have any idea how or why this could have suddenly happened?  I'm attributing it to the NuGet updates, but I could be completely off base here.

    Does anyone know how to FIX this in a clean way?

    Any help would be appreciated!

    Monday, August 5, 2013 10:20 PM

Answers

  • Hi Ian,

    I would start with re-iterating the problem so you can confirm my understanding is correct before I make any suggested changes

    1) you have a worker role that reads configuration from a app.config file

    2) It was working locally and on cloud before you updated some packages using nuget (which had dependency on some BCL)

    3) Since you upgraded it stopped working locally and on cloud, and no code changes were made, I also assume it compiles successfully with no errors or warnings

    4) deployment has not changed and it takes more than an hour to deploy on azure.

    If my understanding is correct,

    Please see if your assemblies have copy local = true, it must be set to true if they are not already

    Ensure all the required assemblies are copied to azure deployment

    if its not working locally debug by putting a break point and see what exception is thrown / caught.

    this will help troubleshoot it further, also ensure no version change happened for azure sdk coz there are breaking changes between 1.8 and 2.0

    hope this helps

    ----------------------------------------

    Please mark as answered if it helped


    Please mark as answered if it helped Vishal Narayan Saxena http://twitter.com/vishalishere http://www.ogleogle.com/vishal/

    Monday, August 5, 2013 11:28 PM
  • Hi,

    You mentioned the problem only occures if you use TFS Continuous Integration to publish the application. It works fine if you use Visual Studio to publish. So one possible cause is the latest version of the NuGet packages have been uploaded to TFS. Please try to compare the file versions on your local machine and in TFS, make sure TFS has the latest version.

    Best Regards,

    Ming Xu


    Ming Xu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 6, 2013 1:50 PM

All replies

  • Hi Ian,

    I would start with re-iterating the problem so you can confirm my understanding is correct before I make any suggested changes

    1) you have a worker role that reads configuration from a app.config file

    2) It was working locally and on cloud before you updated some packages using nuget (which had dependency on some BCL)

    3) Since you upgraded it stopped working locally and on cloud, and no code changes were made, I also assume it compiles successfully with no errors or warnings

    4) deployment has not changed and it takes more than an hour to deploy on azure.

    If my understanding is correct,

    Please see if your assemblies have copy local = true, it must be set to true if they are not already

    Ensure all the required assemblies are copied to azure deployment

    if its not working locally debug by putting a break point and see what exception is thrown / caught.

    this will help troubleshoot it further, also ensure no version change happened for azure sdk coz there are breaking changes between 1.8 and 2.0

    hope this helps

    ----------------------------------------

    Please mark as answered if it helped


    Please mark as answered if it helped Vishal Narayan Saxena http://twitter.com/vishalishere http://www.ogleogle.com/vishal/

    Monday, August 5, 2013 11:28 PM
  • Hi,

    You mentioned the problem only occures if you use TFS Continuous Integration to publish the application. It works fine if you use Visual Studio to publish. So one possible cause is the latest version of the NuGet packages have been uploaded to TFS. Please try to compare the file versions on your local machine and in TFS, make sure TFS has the latest version.

    Best Regards,

    Ming Xu


    Ming Xu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 6, 2013 1:50 PM