我如何知道是否正在使用machine.config中的machineKey部分? [英] How do I know if the machineKey section from my machine.config is being used?

查看:214
本文介绍了我如何知道是否正在使用machine.config中的machineKey部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试生成一个自定义密钥,用于在项目中加密web.config,并在多台计算机上使用相同的密钥。



此示例来自Microsoft: http://support.microsoft.com/kb/312906

但是,当我加密我的web.config(我使用的是cassini,而不是IIS,在我的机器上)似乎没有使用新创建的部分machine.config。还是吗?我怎么知道?当我做了更改和加密web.config,网站工作正常。为了尝试证明我的自定义键被使用,我改变一个字符的decryptKey值并重新启动dev环境。



我在这里缺少什么?

解决方案

我忘记指定加密时使用哪个提供程序。一切工作正常后。


I'm trying to generate a custom key for encrypting the web.config in a project, and use the same key on several machines.

I've followed this example from Microsoft: http://support.microsoft.com/kb/312906

However, when I encrypt my web.config (and I'm using cassini, not IIS, on my machine) it doesn't seem to use the newly created section in my machine.config. Or does it? How do I know? When I've made the changes and encrypted the web.config, the sites works just fine. And to try to prove that my custom key is used, I change a character in the decryptionKey value and restart the dev environment. But it still works, which I guess points to the fact that my keys aren't used.

What am I missing here?

解决方案

I forgot to specify which provider to use when encrypting. Everything worked fine after that.

这篇关于我如何知道是否正在使用machine.config中的machineKey部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆