Looking for old forum posts and information? View the old forum archive here ยป
Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

A static copy of our previous forums website is available online for reference. Click here to access the forum archive.

Learn more about...

AspDotNetStorefront
DotFeed

What is causing error product.aspx?

updating from 9.4 to 9.5.

When i try to edit a product or add a new product I'm getting the error below. How can i decipher  this error message further? I have looked at product.aspx.cs , I see the reference to 'GTINValue as  'int GTINValue;' As far as i know this is the updated product.aspx.cs file so why is this throwing an error? What file needs to be updated or is missing that it thinks this variable is undefined or out of scope?

I've updated this question becuase i think i was going down the wrong path before thinking it was an xml package issue but i realy don't know. Thanks

 


 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)

 

related to an answer for: category error in version 9.5
asked Feb 22, 2016 in MultiStore by Mden (310 points)
retagged Mar 10, 2016 by Mden

1 Answer

+1 vote
The error is basicly still finding issues with older XmlPackages.

Do you have source code? If so I would highly recomend putting a try on GetXmlPackageDisplayName in ASPDNSFCore\XmlPackageManager.cs. That way with catch you can throw the package name so you know what xmlpackage has issues.
answered Mar 9, 2016 by mmcgeachy (3,890 points)
Thanks for the answer.

I do not have source code. are there any other ways to track down which xml package is causing the error?

I found a temp soultion. I was pointed in the right direction here.

http://stackoverflow.com/questions/35901780/aspdotnetstorefront-system-web-httpunhandledexception-error/35919470#35919470

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.

We only use one xml package for products so I didn't remove all of them I just went to the one we use and commented out any references to 'GTINValue' and i'm not getting the error now.

nothing out of the box that I know of checks all products xmlpackges. Assuming it is just the primary xmlpackage folder with issues the code below woul create a list of problematic xmlpakcages (based off older code to make this drop down).

StringBuilder bad_xmlpackages = new StringBuilder();
String SFP = CommonLogic.SafeMapPath(CommonLogic.IIF(AppLogic.IsAdminSite, "../", String.Empty) + "XmlPackages/bogus.htm").Replace("bogus.htm", String.Empty);
DirectoryInfo dirInfo = new DirectoryInfo(SFP);
FileSystemInfo[] myDir = dirInfo.GetFiles("product.*.xml.config");
for (int i = 0; i < myDir.Length; i++)
{	
	try
	{
		var xmlpackage = new XmlPackage2(myDir[i].ToString().ToLowerInvariant(),((AspDotNetStorefrontPrincipal)HttpContext.Current.User).ThisCustomer,AppLogic.DefaultSkinID(),String.Empty,String.Empty,"QueryThatDoesNotExistSoThisNewsUpFaster");	
	}
	catch 
	{
		bad_xmlpackages.Append(myDir[i].ToString().ToLowerInvariant()+"<br />");	
	}
}

There is a chance a skin xmlpackge is the cause issues also. Which would require having aditonal loop/s to check those folders. The code would simliar past checking the app_templates folder with the skin ID.

 

...