Guest User

Untitled

a guest
May 21st, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.58 KB | None | 0 0
  1. Error performing post-save operation on entity 373c595e-843b-45a1-82d0-aa166daf75de of type SS2DAL.EntityClasses.SurveyResponseEntity: SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
  2. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
  3. at System.Security.CodeAccessPermission.Demand()
  4. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
  5. at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
  6. at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
  7. at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
  8. The action that failed was:
  9. Demand
  10. The type of the first permission that failed was:
  11. System.Data.SqlClient.SqlClientPermission
  12. The first permission that failed was:
  13. <IPermission
  14. version="1"
  15. AllowBlankPassword="False">
  16. <add KeyRestrictions=""
  17. KeyRestrictionBehavior="AllowOnly"/>
  18. </IPermission>
  19.  
  20. The demand was for:
  21. <IPermission
  22. version="1"
  23. AllowBlankPassword="False">
  24. <add KeyRestrictions=""
  25. KeyRestrictionBehavior="AllowOnly"/>
  26. </IPermission>
  27.  
  28. The granted set of the failing assembly was:
  29. <PermissionSet
  30. version="1">
  31. <IPermission
  32. version="1"
  33. Access="Open"/>
  34. <IPermission
  35. version="1"
  36. Allowed="ApplicationIsolationByUser"
  37. UserQuota="512000"/>
  38. <IPermission
  39. version="1"
  40. Flags="Execution"/>
  41. <IPermission
  42. version="1"
  43. Window="SafeTopLevelWindows"
  44. Clipboard="OwnClipboard"/>
  45. <IPermission
  46. version="1"
  47. PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100B55C03865E07BCB230B04EF7D9ACF1E7BF41C618DB1327895C25328446039F51CF237A50989E542D3FA9BB5991D303388C5AAC7AE4E071CD7B42B96B16256FF905EC610107DB2A0872E971253919BA528187489FC89FD083118F562319BF3B66CB79035EC50D2291561D4F2B9733AD5E0ECD9BFF9B80B94C40F5888D4E1C5BDD"
  48. Name="ProjectHelpers.Extensions"
  49. AssemblyVersion="2.2009.208.1821"/>
  50. <IPermission
  51. version="1"
  52. Url="file://dc01.bizspeed.datacenter/websites/sitesupervisor files/prjh/ProjectHelpers.Extensions.dll"/>
  53. <IPermission
  54. version="1"
  55. Zone="Internet"/>
  56. <IPermission
  57. version="1"
  58. Level="SafePrinting"/>
  59. </PermissionSet>
  60.  
  61. The assembly or AppDomain that failed was:
  62. ProjectHelpers.Extensions, Version=2.2009.208.1821, Culture=neutral, PublicKeyToken=4405fd38c7d52787
  63. The method that caused the failure was:
  64. SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2 AfterSave(SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2, SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase)
  65. The Zone of the assembly that failed was:
  66. Internet
  67. The Url of the assembly that failed was:
  68. file://dc01.bizspeed.datacenter/websites/sitesupervisor files/prjh/ProjectHelpers.Extensions.dll
  69. --- End of inner exception stack trace ---
  70. at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
  71. at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteSingleRowRetrievalQuery(IRetrievalQuery queryToExecute, IEntityFields2 fieldsToFill, IFieldPersistenceInfo[] fieldsPersistenceInfo)
  72. at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingFilter(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfos, IRelationPredicateBucket filter)
  73. at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingFilter(IEntity2 entityToFetch, IPrefetchPath2 prefetchPath, Context contextToUse, IRelationPredicateBucket filter, ExcludeIncludeFieldsList excludedIncludedFields)
  74. at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntity(IEntity2 entityToFetch, IPrefetchPath2 prefetchPath, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
  75. at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntity(IEntity2 entityToFetch, IPrefetchPath2 prefetchPath)
  76. at ProjectHelpers.Extensions.SurveyResponseSaveHelper.AfterSave(EntityBase2 entity, DataAccessAdapterBase adapter)
  77. at SS2.RemoteObjects.DataPortal.EntitySaveWithoutRemoting(EntityBase2 entity, AuditSettings auditSettings, AuthTicket at) [NDC:(null)]
  78.  
  79. public EntityBase2 AfterSave(EntityBase2 entity, DataAccessAdapterBase adapter)
  80. {
  81. SurveyResponseEntity response = entity as SurveyResponseEntity;
  82.  
  83. if (response.IsComplete) // we only really want to do this if the survey has been completed.
  84. {
  85. SurveyEntity survey = new SurveyEntity(response.SurveyRefId);
  86. IPrefetchPath2 questionSetPath = new PrefetchPath2((int)SS2DAL.EntityType.SurveyEntity);
  87. IPredicateExpression filter = new PredicateExpression(QuestionSetFields.Current == 1);
  88. questionSetPath.Add(SurveyEntity.PrefetchPathQuestionSetCollection, 1, filter)
  89. .SubPath.Add(QuestionSetEntity.PrefetchPathQuestionPageCollection)
  90. .SubPath.Add(QuestionPageEntity.PrefetchPathQuestionCollection);
  91.  
  92. if (adapter.FetchEntity(survey, questionSetPath))
  93. {
  94. // we need to instantiate the survey template save handler from this survey response (if it exists)
  95. // then execute
  96.  
  97. if (!String.IsNullOrEmpty(survey.PostSaveAssemblyName) && !String.IsNullOrEmpty(survey.PostSaveClassName))
  98. {
  99. try
  100. {
  101. string assemblyPath = (new FileService()).GetRootAssemblyURL();
  102.  
  103. Assembly asm = Assembly.Load(File.ReadAllBytes(Path.Combine(assemblyPath, survey.PostSaveAssemblyName)));
  104.  
  105. if (asm != null)
  106. {
  107. Type t = asm.GetType(survey.PostSaveClassName);
  108. ISurveyPostSaveHandler cls = (ISurveyPostSaveHandler)Activator.CreateInstance(t);
  109. if (cls != null)
  110. {
  111. cls.AfterSave(response, survey, adapter);
  112. }
  113. }
  114. }
  115. catch (Exception ex)
  116. {
  117. // at some point, we need to add some logging here.
  118. Logger.ErrorFormat("There was an error post-processing survey response {0} from survey {1}: {2}", response.SurveyResponseId, survey.Name, ex.ToString());
  119. throw ex;
  120. }
  121. }
  122. }
  123. else
  124. {
  125. Logger.ErrorFormat("Could not post process response {0} because the parent survey could not be located", response.SurveyResponseId);
  126. throw new ApplicationException(String.Format("Could not post process response {0} because the parent survey could not be located", response.SurveyResponseId));
  127. }
  128. }
  129.  
  130. return response;
  131. }
  132.  
  133. #endregion
  134. }
Add Comment
Please, Sign In to add comment