当我尝试在 godaddy 共享服务器中部署与 Dynamics CRM 2011 在线通信的应用程序时遇到问题。我在本地运行时没有任何问题,我使用 sdk\samplecode\cs\wsdlbasedproxies\online 中提供的 wsdlbaseproxies 在线代码来验证动态 CRM。此过程正在本地系统中创建 LiveDeviceID.xml,但未能在 godaddy 共享托管服务器中创建相同的。
此应用程序是在 .net 中开发的,它可以在线捕获潜在客户、机会并在 CRM 2011 中/从 CRM 2011 中保存/检索相同的内容。
我非常感谢您对此的帮助和意见。
更新错误消息:
数据保护操作不成功。这可能是由于没有为当前线程的用户上下文加载用户配置文件,这可能是线程模拟时的情况。说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详情:
System.Security.Cryptography.CryptographicException:数据保护操作不成功。这可能是由于没有为当前线程的用户上下文加载用户配置文件,这可能是线程模拟时的情况。
源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常起源和位置的信息。
堆栈跟踪:
[CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.]
System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope) +522
Microsoft.Crm.Services.Utility.DeviceUserName.Encrypt(String value) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:970
Microsoft.Crm.Services.Utility.DeviceUserName.UpdateCredentials(String encryptedValue, String decryptedValue) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:941
Microsoft.Crm.Services.Utility.DeviceUserName.set_DecryptedPassword(String value) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:897
Microsoft.Crm.Services.Utility.DeviceIdManager.GenerateDeviceUserName() in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:462
Microsoft.Crm.Services.Utility.DeviceIdManager.GenerateDevice(String deviceName, String devicePassword) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:377
Microsoft.Crm.Services.Utility.DeviceIdManager.RegisterDevice(Guid applicationId, Uri issuerUri, String deviceName, String devicePassword) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:189
Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice(Uri issuerUri, String deviceName, String devicePassword) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:116
Microsoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice(Uri issuerUri) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\DeviceidManager.cs:99
Microsoft.Crm.Sdk.Samples.WsdlTokenManager.Authenticate(ClientCredentials credentials, String appliesTo, String policy, Uri issuerUri) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\WsdlTokenManager.cs:141
CRMDynamicsService.CRMDynamicsOnline.Authenticate(LiveIdAuthenticationPolicy policy, String userName, String password) in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\CRMDynamicsService.cs:262
CRMDynamicsService.CRMDynamicsOnline.GetLeads() in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Models\CRMDynamicsService.cs:420
hcrm.Controllers.LeadsController.Leads() in C:\Users\Aashritha\Documents\Visual Studio 2010\Projects\hcrm\hcrm\Controllers\LeadsController.cs:20
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970061
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184