XmlPackage Exception: Exception=Function 'aspdnsf:AddtoCartForm()' has failed.
Exception has been thrown by the target of an invocation.
Request failed.
System.Xml.XPath.XPathException: Function 'aspdnsf:AddtoCartForm()' has failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: Request failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at AspDotNetStorefrontCommon.DB.GetRS(String Sql)
at AspDotNetStorefrontCommon.AppLogic.ShowProductBuyButton(Int32 ProductID)
at AspDotNetStorefrontCommon.ShoppingCart.GetAddToCartForm(Customer ThisCustomer, Boolean forPack, Boolean showWishListButton, Boolean showGiftRegistryButton, Int32 ProductID, Int32 VariantID, Int32 SiteID, Int32 DisplayFormat, String LocaleSetting, Boolean ColorChangeProductImage)
at AspDotNetStorefrontCommon.XSLTExtensions.AddtoCartForm(Int32 ProductID, Int32 VariantID, Boolean ColorChangeProductImage)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Xml.Xsl.XsltOld.XsltCompileContext.FuncExtension.Invoke(XsltContext xsltContext, Object[] args, XPathNavigator docContext)
at MS.Internal.Xml.XPath.FunctionQuery.Evaluate(XPathNodeIterator nodeIterator)
--- End of inner exception stack trace ---
at MS.Internal.Xml.XPath.FunctionQuery.Evaluate(XPathNodeIterator nodeIterator)
at System.Xml.Xsl.XsltOld.Processor.ValueOf(ActionFrame context, Int32 key)
at System.Xml.Xsl.XsltOld.ValueOfAction.Execute(Processor processor, ActionFrame frame)
at System.Xml.Xsl.XsltOld.ActionFrame.Execute(Processor processor)
at System.Xml.Xsl.XsltOld.Processor.Execute()
at System.Xml.Xsl.XsltOld.Processor.Execute(TextWriter writer)
at System.Xml.Xsl.XslTransform.Transform(XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver)
at System.Xml.Xsl.XslTransform.Transform(IXPathNavigable input, XsltArgumentList args, TextWriter output, XmlResolver resolver)
at AspDotNetStorefrontCommon.XmlPackage2.TransformString()
at AspDotNetStorefrontCommon.AppLogic.RunXmlPackage(XmlPackage2 p, Parser UseParser, Customer ThisCustomer, Int32 SiteID, Boolean ReplaceTokens, Boolean WriteExceptionMessage)