我在VS2012中运行我的应用程序,我收到运行时错误;

当我查看"原始位置"时,我看到mscorlib.dll,但不是mscorlib.pdb.
为什么会发生这种情况,我该如何解决?
我正在使用WIF(.net 4.5)和Azure Active目录进行身份验证.该网站将位于Azure上.
一切都在本地工作,但是当我把它放到azure上时我得到错误:
数据保护操作失败.这可能是由于没有为当前线程的用户上下文加载用户配置文件引起的,这可能是线程模拟时的情况.
我理解这是因为应用程序无法使用DAPI,因此我需要切换到使用MAC保护我的应用程序.
在本地我把它添加到我的webconfig: -
<securityTokenHandlers>
<remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</securityTokenHandlers>
Run Code Online (Sandbox Code Playgroud)
正如文档中所建议的,我添加了一个静态机器密钥,但我找不到关于密钥长度的任何建议 - 所以我假设256.
但是,此配置只会出现此错误:
[CryptographicException:加密操作期间发生错误.] System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func,Byte [] input)+115 System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.Unprotect(Byte [] protectedData)+59 System.Web.Security.MachineKey.Unprotect(ICryptoServiceProvider cryptoServiceProvider,Byte [] protectedData,String []用途)+62 System.Web.Security.MachineKey.Unprotect(Byte [] protectedData,String []用途)+ 122 System.IdentityModel.Services.MachineKeyTransform.Decode(Byte [] encoded)+161 System.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte [] cookie,Boolean outbound)+123 System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader reader) ,SecurityTokenResolver tokenResolver)+575 System.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(Byte [] token,SecurityTokenResolver tokenResolver)+76 System.IdentityModel.Services.SessionAuthenticationMod ule.ReadSessionTokenFromCookie(Byte [] sessionCookie)+833 System.IdentityModel.Services.SessionAuthenticationModule.TryReadSessionTokenFromCookie(SessionSecurityToken&sessionToken)+186 System.IdentityModel.Services.SessionAuthenticationModule.OnAuthenticateRequest(Object sender,EventArgs eventArgs)+210 System.Web.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute()+ 136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean&completedSynchronously)+69
我删除了machinekey部分,因为我没有指定格式正确的密钥,但错误不会消失.
什么是战斗WIF!