Register user culture in Windows Azure

I am currently developing an ASP.NET MVC 4 application for the African market and was hoping to register a custom culture using the steps described in the following link http://msdn.microsoft.com/en-gb/library/system.globalization.cultureandregioninfobuilder.register (v = vs. 110) .aspx . Most of my target countries are not in pre-established cultures, so it seems to me that I need to register these cultures. The problem is that my console application for registration will need the introduction of antiviruses to complete the registration of the culture. I assume that windows azure does not allow administrators to administer the cloud services environment.

Question. What is the best way to register custom culture in Windows Azure without admins. There seems to be a way to do this in Framework 2.0 using the cultureandregioninfobuilder.compile method, but this is not a supported method. Is there a better solution? You don’t want to support different design decisions for each culture, so that I can support different languages.

Thanks in advance.

+4
source share
2 answers

You can create a launch task that runs with elevated privileges, as well as launch an application in a limited context. Your service configuration file should look like this:

<ServiceDefinition name="MyCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8"> <WebRole name="MyWebRole" vmsize="Small"> <Runtime executionContext="limited"> </Runtime> <Startup> <Task executionContext="elevated" commandLine="scripts\SetupCulture.cmd" taskType="simple"> <Environment> <Variable name="CULTURE"> <RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting[@name='Culture']/@value" /> </Variable> </Environment> </Task> </Startup> ... </WebRole> </ServiceDefinition> 

Please note that you can specify the desired culture in the service configuration file. Finally, you can use the "CULTURE" environment variable in your .cmd file to use it as a parameter of the .NET executable executing the job.

+1
source

I used the approach described by David - running a script with elevated administrator privileges.

To create a custom culture, I used this article How to Preserve Custom Cultures Without Administrative Privileges .

The code still requires administrator privileges, although it says the opposite, but works when executed as described above.

Proven work on the Sitecore project in Azure.

+1
source

All Articles