IsolateApps导致指定的解密密钥具有无效的十六进制字符 [英] IsolateApps causes Decryption key specified has invalid hex characters

查看:1356
本文介绍了IsolateApps导致指定的解密密钥具有无效的十六进制字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在其中有一个MVC 4现场工作使用身份验证。该网站要求我指定的计算机密钥值。我这样做是通过IIS接口已经取消了在运行时自动生成,生成的密钥值,并在选择为每个应用程序的唯一钥匙

I working on a MVC 4 site which has uses Authentication. The site requires that I specify the Machine Key values. I did this via the IIS interface having deselected the "automatically generate at runtime", generated the key values and having selected "generate a unique key for each application"

在web.config条目看起来是这样的:

The web.config entry looks something like this:

<machineKey decryption="DES" decryptionKey="{hex-key value},IsolateApps" 
    validationKey="{hex-key value},IsolateApps" />;

虽然这似乎是另一个Web项目它会导致指定的解密密钥具有无效的十六进制字符的开发机我现在工作(无论是在IIS-Ex的preSS和IIS 7.5)上的错误做工精细。

While this seems to work fine on another web project it causes the "Decryption key specified has invalid hex characters" error on the dev machine I am working on now (both in IIS-Express and IIS 7.5).

删除,IsolateApps从键值解决了这个问题,但因为我需要在生产中我不此选项,现在要被删除它只是有这个问题当部署。

Removing ",IsolateApps" from the key values solves the issue but since I need this option on in production I dont want to be removing it now only to have this issue when deploying.

怎么办? dev的框是一个SQL 2008 R2盒.NET 2.0和.NET 4.0。

What gives? The dev box is a SQL 2008 R2 box with .net 2.0 and .net 4.0.

推荐答案

IsolateApps 修改使ASP.NET为您的服务器上的每个应用程序的唯一关键。在运行时,如果你正在为ASP.NET此方法仅适用自动生成密钥。

The IsolateApps modifier causes ASP.NET to generate a unique key for each application on your server. This is only applicable if you are getting ASP.NET to auto-generate keys at runtime.

如果您没有收到ASP.NET自动生成密钥,并用正在而不是指定键 decryptionKey ={十六进制键值},那么办法让每个应用程序就是指定在每个应用程序的Web.config不同的密钥ASP.NET使用不同的密钥。

If you are not getting ASP.NET to auto-generate keys, and are instead specifying the keys using decryptionKey="{hex-key value}", then the way to get ASP.NET to use a different key for each application is to simply specify a different key in each application's Web.config.

在IIS配置界面允许您创建与 IsolateApps 修改,这是无效的明确键一起Web.config文件,在我看来是一个错误在配置GUI。

The IIS config GUI allows you to create a Web.config with an explicit key together with the IsolateApps modifier, which is invalid, and in my opinion is a bug in the config GUI.

这篇关于IsolateApps导致指定的解密密钥具有无效的十六进制字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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