无法获取公共密钥StrongNameKeyPair [英] Unable to obtain public key for StrongNameKeyPair
问题描述
我已经开发移植到另一台计算机,如果我跑项目,我有这样的例外:
I have ported developing to another computer and if i run project, i have this exception:
无法获得公钥StrongNameKeyPair。
Unable to obtain public key for StrongNameKeyPair.
HibernateException的:创建代理实例失败。
HibernateException: Creating a proxy instance failed
在原来的电脑它的工作原理确定没有问题。
On original computer it works OK without problems.
我发现在谷歌,这是问题的一些crypting,我应该尝试SN -mn,由我不知道怎么办。 SN.EXE在多个文件夹,我tryed命令行一些运行,但它写道:
I found on google that it is problem with some crypting and I should try "sn -m n", by I don't know how. sn.exe is in more folders, i tryed some run from command line but it writes:
未能打开注册表键 - 无法格式化错误信息00000005
Failed to open registry key -- Unable to format error message 00000005
我不知道问题是因为NHibernate的还是不行,还有更多类似的whitch对话框,它只有在一种情况下抛出此异常。
I don't know if problem is because NHibernate or not, there are more similar whitch dialogs and it throw this exception only in one case.
还有就是code部分whitch抛出异常:
there is part of code whitch throw exception:
public IList<DTO> GetAll(GridSortOptions sortOptions, DTOListModel<DTO> listModel)
{
return GetAllCriteria(sortOptions, CreateCriteria(), listModel).List<DTO>();
}
没有从溶液中使用签约一个项目。 我不明白,究竟这样的错误意味着,我应该寻找什么。
No one project from solution use signing. I don't understand what exactly this errors means and what i should look for.
推荐答案
NHibernate的是动态地创建.NET程序集(dynaic代理),需要给他们签名。默认情况下,Windows操作系统配置为机器级别的加密密钥存储和存储密钥在C:\ Documents和Settings \所有用户\应用数据\微软\加密\ RSA \ MachineKeys的。最有可能你的用户可以创建(例如)此文件夹中的文本文件,但不能删除它,因为你没有完全控制。
NHibernate is dynamically creating .NET assemblies (dynaic proxies) and needs to sign them. By default the Windows OS configures the crypto key storage to be machine level and stores the keys in C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys. Most likely your user can create (for example) a text file in this folder, but not delete it because you do not have full control.
您的选项
-
获取完全控制C:\ Documents和Settings \所有用户\应用数据\微软\加密\ RSA \ MachineKeys的修改可能不被推荐的权限
Get full control of C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys by modifying permissions which might not be recommended.
从Windows SDK运行SN.EXE -mn更改您的密码密钥存储到用户级别。 http://msdn.microsoft.com/en-美国/库/ k5b5tt23(V = VS.90)的.aspx 这将会把加密密钥存储在用户的本地配置文件,你应该始终有充分的contorl下。
Change your crypto key storage to user level by running the "sn.exe -m n" from the Windows SDK. http://msdn.microsoft.com/en-us/library/k5b5tt23(v=VS.90).aspx This will put crypto key stores under under your users local profile which you should always have full contorl to.
有一些网上的文章,描述了类似的问题。例如,请参见 http://support.targetprocess.com/Default.aspx ?G =职位和放大器; T = 305
There are several articles online that describe a similar problem. For example, see http://support.targetprocess.com/Default.aspx?g=posts&t=305.
这篇关于无法获取公共密钥StrongNameKeyPair的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!