在Windows Azure中注册自定义区域性

编程入门 行业动态 更新时间:2024-10-12 03:16:38
本文介绍了在Windows Azure中注册自定义区域性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前正在为非洲市场开发ASP.NET MVC 4应用程序,并希望使用以下链接 msdn.microsoft/zh-CN/library/system.globalization.cultureandregioninfobuilder.register(v = vs.110).aspx .我的大多数目标国家/地区都没有预先安装的文化,因此听起来我需要注册这些文化.问题是,我用于进行注册的控制台应用程序需要管理员权限才能完成区域性注册.我以为Windows Azure不允许开发人员对云服务环境进行管理员控制.

I am currently developing an ASP.NET MVC 4 app for the African market and was hoping to register a custom culture using the steps detailed in the following link msdn.microsoft/en-gb/library/system.globalization.cultureandregioninfobuilder.register(v=vs.110).aspx. Most of my target countries are not in the pre-installed cultures so it sounds like I need to register these cultures. Problem is, my console app for doing the registration will need admin previlidges to complete the culture registration. I am presuming windows azure does not allow developers admin control of the cloud service environment.

问题:在没有管理员权限的情况下,在Windows Azure中注册自定义区域性的最佳方法是什么?显然,有一种方法可以在Framework 2.0上使用cultureandregioninfobuilderpile方法执行此操作,但这不是受支持的方法.有更好的解决方案吗?不想只为每种文化维护不同的项目解决方案,这样我就可以支持不同的语言.

Question: What is the best way to register a custom culture in Windows Azure without admin previlidges. Apparently there's a way to do this on Framework 2.0 using the cultureandregioninfobuilderpile method but this is not a supported method. Is there a better solution? Don't want to have to maintain different project solutions for each culture just so I can support different languages.

谢谢.

推荐答案

您可以创建一个以提升的特权运行的启动任务,还可以在有限的上下文中运行您的应用程序.您的服务配置文件应如下所示:

You could create a startup task that runs with elevated priviledges, and also run your application on a limited context. Your service configuration file should look like this:

<ServiceDefinition name="MyCloudService" xmlns="schemas.microsoft/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>

请注意,您可以在服务配置文件中指定所需的区域性.最后,您可以在.cmd文件中使用环境变量"CULTURE"将其用作执行此工作的.NET可执行文件的参数.

Note with this you can specify the desired culture in the service configuration file. Finally you can use the environment variable "CULTURE" in your .cmd file to use it as parameter to a .NET executable doing the job.

更多推荐

在Windows Azure中注册自定义区域性

本文发布于:2023-11-12 12:54:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581550.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:区域性   自定义   Windows   Azure

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!