简体   繁体   中英

How do I know if the machineKey section from my machine.config is being used?

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?

我进行了一个简单的测试...在您的machine.config放入一些垃圾(无效的XML),然后重新启动开发环境(而不是Cassini),看看Cassini是否阻塞,这表明它正在重新加载machine.config

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM