Aspdotnetstorefront System.Web.HttpUnhandledException Error

274 views Asked by At

The Problem

I am getting the error below when trying to access 'admin'/product.aspx to update or add new products in the back-end of the staging site that was set up for us as we upgrade our AspDotNetStorefront cart from version 9.4 to 9.5. Our existing database was copied and set up to test out the new version.

The error:

 Exception of type 'System.Web.HttpUnhandledException' was thrown.
Inner Exception:
Page URL:/aesys/product.aspx
Source:System.Xml
Message:The variable or parameter 'GTINValue' is either not defined or it is out of scope.
Stack Trace:
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at System.Xml.Xsl.XslCompiledTransform.Load(IXPathNavigable stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at AspDotNetStorefrontCore.XmlPackage2..ctor(String PackageName, Customer cust, Int32 SkinID, String UserQuery, String AdditionalRuntimeParms, String OnlyRunNamedQuery, Boolean UseExtensions)
at AspDotNetStorefrontCore.XmlPackage2..ctor(String PackageName, Customer cust, Int32 SkinID, String UserQuery, String AdditionalRuntimeParms, String OnlyRunNamedQuery)
at AspDotNetStorefrontCore.XmlPackageManager.GetXmlPackageDisplayName(String packageName, Nullable`1 skinId)
at AspDotNetStorefrontCore.XmlPackageManager.<>c__DisplayClass0_2.b__5(String filePath)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.d__14`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.d__0.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at AspDotNetStorefrontCore.XmlPackageManager.GetXmlPackageInfosByPrefix(HttpContextBase httpContext, XmlPackageLocation searchLocations, String prefix, IEnumerable`1 skinIds)
at AspDotNetStorefrontControls.XmlPackageSelector.BuildXmlPackageListItems()
at AspDotNetStorefrontControls.XmlPackageSelector.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Question 1:

The change has caused issues with some of our existing xml packages where files reference things that have been renamed or removed in the newer version. I have been able to update the packages or use newer ones. I'm not sure what to do about this error though.

Is this an xml package error? I see in the stack trace references to 'xmlPackageManager' etc. is this maybe concerning what the documentation refers to as an 'internal package'?

Question 2:

what is system.xml? Is this a file? Where is it?

Question 3:

Is it possible to learn more about whats going on by looking at the 'stack trace' listed below? what other information would i need?

What I've Tried:

I can't find anything related to this online. I'm think I'm way off but since It is complaining about 'GTINValue' not being delcared or out of scope I found that reference in the file 'admin'/product.aspx.cs file. I've tried removing the line 'int GTINValue;', assigning it a value 'int GTINValue = 1', and changing to 'GTIN' becuase i found that instead of 'GTINValue' in the database table reference. in each case I still get the same error? I figured changing that line would have some impact and since it doesn't i'm not sure if it is a caching thing where the change isn't being registered or the error is coming from something entirely different.

I'm really just totally lost with how to go about resolving this so any help at all would be greatly appreciated.

Thanks.

1

There are 1 answers

3
dubloons On

Question 1:

Yes, this is an XMLPackage error. Version 9.5 tries to get XMLPackage names out of the XMLPackages themselves. To do this it needs to compile each XMLPackage it's trying to list. One of your product.*.xml.config files references $GTINValue which doesn't exist. You can find it be searching or remove all the product XMLPackages (this will fix the error) and add them back one at a time until you get the error again.

Question 2:

System.Xml is part of .Net: https://msdn.microsoft.com/en-us/library/system.xml(v=vs.110).aspx .This is where the error is coming from because this is the library that compiles XMLPackages. The last (from the bottom up) relevant piece of code in this stack trace:

at AspDotNetStorefrontCore.XmlPackage2..ctor(String PackageName, Customer cust, Int32 SkinID, String UserQuery, String AdditionalRuntimeParms, String OnlyRunNamedQuery, Boolean UseExtensions)

Question 3:

I don't think there is much to learn from this stack trace. It does show that the error is coming from building an XMLPackage list and then trying to get an XMLPackage name, but that's only useful if you know it needs to compile the packages to get their names.