Azure SDK/Depoloyment bug - around Resource file (localization)
There needs to be a description of Best Practices for Localization of Azure Solutions.
We built a solution that has WebWorker with both JScript client side code and Server side code. In one case we need to send an email alert from the server side and in other cases the JScript side needs to display text to the user
A standard practice for traditional web apps is to put all of the strings in a resource file. That way I can hand off the file for translation, without having to go searching for the strings everywhere.
But this causes a serious problem on deployment:
To allow the Server to access the resource file, it needs to be configured as "Embedded Resource"
for the Jscript file it needs to be deployed as "Content"
IF it is deployed as "Embeded" nothing shows up for the client side JScript to load from
IF it is deployed as "Content" there is no way for the Server side to load it.
IF we set it to "Embeded Resource - ALWAYS COPY" the resource data gets put in a DLL for the Server side, and the Content resource file DOES get copied.
Except it gets copied to the BIN subdirectory.
initially this meant that we had to manually connect to the deployed machine and copy the files from the Bin to the Siteroot directory.
But this fails if the machine is auto-restarted or "autoscaled". (ie it prevents us from using AutoScale).
Our Hacked solution is to put in code in Webconfig.cs that OnStart goes and finds
a) what drive the deployment is on
b) the files in the Bin Directory
c) copies them to the SiteRoot directory
And this works - but it is an ugly ugly ugly hack.
and for localization I ought not need to do this.