且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MVC3发布策略

更新时间:2023-02-22 15:19:30

要使用不同的配置不同的web.config,你必须换这个配置和构建过程中,发布,部署此配置将被使用。您可以通过从配置管理器上生成菜单中的底部更改活动配置。或者从绿色箭头运行后,选择权。

To use different web.config in different configuration you have to swap this configuration and during build, publish, deploy this configuration will be used. You can change active configuration by from configuration manager on bottom of Build menu. Or from select right after green Run arrow.

有关web.congig转换有关数据源读取听到:

For web.congig transformations regarding DataSource read hear:

http://blog.discountasp.net/how-web-config-transformation-simplifies-web-deployment/

至于问题,我会建议自授权属性,它会掉一些你的predefined角色的名字从你的code那些还web.config中保存的等效第一部分。
这将是更容易做到,因为你可以有比环境,只是不同的web.config转型为他们每个人多。

As for first part of question I would recommend custom Authorize attribute that will swap some your predefined roles names from your code to equivalent of those saved also in web.config. This will be easier for accomplish since you have can have more than to environments and just different web.config transformation for each of them.