locked
update xxx.resources file on server - error message RRS feed

  • Question

  • User-2132746437 posted

     I'm making changes to some xxx.resources files on our web server, everytime I try and copy the new file out to the server I keep getting the error:

     

    'the process cannot access the file because it is being used by another process.'

     

    I get this for about 20 minutes or so after I check the web site. Is there another way to update/copy the xxx.resources file on the web server without waiting 20 minutes or so to do so?

     

     

    Thursday, July 15, 2010 8:25 AM

Answers

  • User579345625 posted

    Hello,


    It is not recommended to change .resx files runtime. When the application is first compiled framework generates .cs files of of the resource files, that later are converted into MSIL.

    Thus if you forcefully change your resource files while the application is running then application gets reset and your logged-in users might get thrown of of application. Behavior is same when you change the web.config file.


    If you want to change the resource strings run time then you have to implement  the database driven localization. Changing the resources in database will not cause the application to reset.

    However changes wont reflect unless the server is reset as the resources are cached by framework, there is a way to synchronize the database and cached, if you are interested in going database way I would tell you how to do it.

    Following is useful link about how to implement database driven localization. Please note that there will be NO change in how you access the resource strings after implementing this as same interfaces are implement as ,resx files internal default implementation. Thus the transition would be very smooth.

    http://www.west-wind.com/weblog/posts/117287.aspx


    Thanks,

    Anup Daware 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 18, 2010 9:52 PM

All replies

  • User326230061 posted

    I'm going on a limb here and some folks with more knowledge than me might be better suited to answer, however it's possible that users are logged in your application while you are trying to update it.

    I'd say to make a temporary "Sorry, we're updating something, come back in 30 minutes" replacement page for the index page,  replace it, wait a little while for the current users to see it and thus, free up the file, update and then put back the old index page.

    However, as I said, I'm going on a limb here...

    Friday, July 16, 2010 12:28 PM
  • User579345625 posted

    Hello,


    It is not recommended to change .resx files runtime. When the application is first compiled framework generates .cs files of of the resource files, that later are converted into MSIL.

    Thus if you forcefully change your resource files while the application is running then application gets reset and your logged-in users might get thrown of of application. Behavior is same when you change the web.config file.


    If you want to change the resource strings run time then you have to implement  the database driven localization. Changing the resources in database will not cause the application to reset.

    However changes wont reflect unless the server is reset as the resources are cached by framework, there is a way to synchronize the database and cached, if you are interested in going database way I would tell you how to do it.

    Following is useful link about how to implement database driven localization. Please note that there will be NO change in how you access the resource strings after implementing this as same interfaces are implement as ,resx files internal default implementation. Thus the transition would be very smooth.

    http://www.west-wind.com/weblog/posts/117287.aspx


    Thanks,

    Anup Daware 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, July 18, 2010 9:52 PM