Arg_COMException Error in Silverlight 5 - silverlight

One of our clients suddenly got an Arg_COMException since last Wednesday (30th Aug 2017).
Here is the error message with the stack trace.
[Arg_COMException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.50907.00&File=mscorlib.dll&Key=Arg_COMException
Stack track: __________________________________
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports...
...
Here is the full error message
Any help would be highly appreciated as this is a production issue.

We identified, some of dropdowns and AutoComplete is causing issue while loading. So hide those controls and make it visible after a short delay one by one. Now the form is functioning. This is kind of workaround.
Still no clue what is causing the issue and what could be the correct fix.
Thanks

If you have a Extended ASCII charactors in your XAML or in your data, you may get this error.
In our application we had a one extended ASCII charactor in our XAML which looks like hypen ( '-' ). We assumed it is just an hypen (or minus) charactor. This is causing issue in our application. After changing this, the issue is resolved.

Related

Comments not shown in wordpress - wp_list_comments(), comments_form()

In 90% of the cases, that is refreshing the same page, functions wp_list_comments(), comments_form(), has_comments() and other functions alike aren't yielding the expected results.
So I refresh the same page and these functions return different results, for example either 0 comments, 5 or 21 comments, while no other user is using the database since it's a test system with XAMPP. It's noticeable that only values 0, 5 and 21 seem to pop up for the numer of comments.
Looking further down the call stack I could notice that sometimes $wpdb->has_comments() returns 0 although the post contains comments.
I suspect this may be something related to wordpress caching system of my version 4.5 and the only issue I found on their bug tracker was related to including wp_list_comments() twice in the same file, which is not the case. Updating to latest version also does not solve this.
I have noticed that the below debug log was printed in the debug.log file, but only once although the page has been reloaded hundreds of times:
WordPress database error You have an error in your SQL syntax; check the
manual that corresponds to your MariaDB server version for the right syntax to
use near 'WHERE AND comment_parent IN (61,62,66) ORDER BY comment_date_gmt
ASC, comment_' at line 1 for query WHERE AND comment_parent IN (61,62,66)
ORDER BY comment_date_gmt ASC, comment_ID ASC made by
require('C:\xampp\htdocs\boxify\chef\wordpress\wp-blog-header.php'),
require_once('C:\xampp\htdocs\boxify\chef\wordpress\wp-includes\template
loader.php'), include('C:\xampp\htdocs\boxify\chef\wordpress\wp-
content\themes\mytheme\single.php'), get_template_part, locate_template,
load_template, <...more files here...>, comments_template,
WP_Comment_Query->__construct, WP_Comment_Query->query, WP_Comment_Query-
>get_comments, WP_Comment_Query->fill_descendants
Issue occurs on multiple self-hosted wordpress installations.
With other themes, like twentysixteen or others I don't see this sort of behavior, so it's definitely something wrong on my side and I suspect the caching configuration, which I didn't touch.
Also, I've checked for wp_reset_postdata() usage and there's none in my single template. Add theme support is used for comments and everything. Any hint or some direction in which I should dig further would be great!
Found out what the issue was.
Somewhere in the code, in the middle of THE MAIN LOOP a file was included with get_template_part() and in that file a function running a new WP_Query was missing wp_reset_postdata(). This caused the global $post to become corrupt, at least from my point of view.
Since that WP_Query was used to get a random post, this caused comments to be shown for that random post. Sometimes they existed, other times they didn't.
Also, further functions like get_next_post() and get_previous_post() that were relying on $post were now returning results relative to the new random post instead of the old post, as expected.
Only when I noticed these adjacent functions were returning invalid results did I understand where the issue was.

ng-model problems in a directive

I am trying to write my first non-trivial directive and am having problems.
What I am trying to do is similar to http://plnkr.co/nYSBnm
This works as intended apart from the two inputs are using the same field. When I try and get them to use the intended fields, by putting
ng-model="record.{{field.name}}"
in the formInput attributes to replace ng-model="record.name" I get an error
Error: Syntax Error: Token '{' is an unexpected token at column 8 of the expression [record.{{field.name}}] starting at [{{field.name}}].
For what it is worth the plunk is at http://plnkr.co/O2uosO27khbcxZEeEb6V
I have looked at various somewhat similar questions on here and stack overflow and so far failed to get anything to work.
I would be grateful for any light anyone can throw on it.
Mark
I had also asked this question on the AngularJS group (I posted here after a day or so of silence on there). Then I got a response from Pawel Kozlowski who pointed out that
ng-model="record[field.name]"
"kind of starts to work" as he put it. There is a plunk here.
Not sure what he meant by his comment but when I put that in a real page and hit refresh I get two copies of the fields (unless I clear the cache), but he certainly solved the stated problem.

Error converting 0 to double on user's machine with Silverlight

I have a Silverlight application that gets down data from the server in the form of an XML string, opens it as a document, and parses through things.
This works on all other machines, but we have client with a user who's machine is unable to run things properly. Her box gives her an InvalidCastException that looks like it's trying to convert 0 to a Double.
This seems like an environmental issue, but I can't figure out what the cause of this would be or how to fix it. Her cultural settings appeared okay, at least for the numeric settings.
Anyone bumped into anything similar or have any next steps for diagnosis or possible fixes? I don't think we can attach to the machine or anything.
Relevant stack trace included below:
[InvalidCast_FromStringTo]
Arguments: 0,Double
Debugging resource strings are unavailable. Often the key and arguments
provide sufficient information to diagnose the problem. See
http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.10411.0&File=Microsoft.VisualBasic.dll&Key=InvalidCast_FromStringTo
Type: System.InvalidCastException
at
Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String
Value, NumberFormatInfo NumberFormat)
at MyNamespace.MyLoader.LoadXml(String xml)

Unknown error caused by DataTemplate

Since a few days back the WPF editor no longer works. Whenever I click somewhere in any editor it becomes disabled with this message:
'NullReferenceException was thrown on "DataTemplate": ... (etc.)'
I have spent a few hours trying to locate the problem without success so if anyone could give a hint on where to look I would greatly appreciate it.
I have tried to debug with CLR exceptions enabled when thrown (VS2010->Debug->Exceptions...->Common Language Exceptions (Thrown) 'Checked') but I get no exceptions from it.
Apparently there's a problem some DataTemplate somewhere that's only showing in design time but I just can't figure out how to locate it.
Cheers
I finally traced the problem to a small markup extension I wrote. Having removed it the DataTemplaring system stopped behaving badly.

How to Debug XAML Parsing Errors in Silverlight?

I run into the following issue semi-regularly: I make changes to XAML or some resources used by it and when I go to load up the Silverlight project in debug mode it only gets as far as the spinning Silverlight-loading animation.
I've tried attaching the VS08 debugger to the process but it doesn't do anything at this point (works fine once I'm in the Silverlight but not before.)
From previous experience I've noticed this happens when there're problems with the XAML or the resources in it but my only solution so far has been to dissect the code line-by-line until I spot the problem.
Is there an easy way to debug/diagnose these situations?
UPDATE
I found this question with some help, but it still doesn't provide a good way to debug these types of issues.
This has been a real pain to debug but I finally found the problem hidden deep in the constructor to one of our custom controls (which was looking for a resource that wasn't there.) The real problem isn't fixing the issue but finding it.
I found that IE responds to exceptions in passed from Silverlight to the DOM but you don't get that same sort of feedback in the Chrome browser (which I use.) A solution that actually helps a great deal (even moreso than the IE tip) is to modify the ReportErrorToDOM() method in App.xaml.cs to the following:
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
{
string errorMsg = String.Empty;
try
{
errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", #"\n");
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
}
catch (Exception)
{
#if DEBUG
MessageBox.Show(errorMsg);
#endif
}
}
This gives you the position in the XAML where the issue is starting. It's not an ideal debugger, but it does help.
This is not the ultimate answer but can often help
In Visual Studio :
Click Debug > Exceptions
Click 'Find' and search for XAML
Click the 'Thrown' button next to System.Windows.Markup.XamlParseException
Start your project in debug mode. Any Xaml exceptions will be shown immediately. Check the inner exception sometimes for further information.
I wasted soooo much time before I finally figured this one out!
This may not apply, but one frequent source of XAML errors is due to uncaught exceptions within converters that you're using as resources. People often forget to use a try-catch block in their converters, and when something blows up in there you end up having to dissect your code line by line.
And, take this with a grain of salt, but depending upon the situation, you may be able to copy-and-paste some of your XAML into a WPF project and get better error messages. I've never relied on this tactic myself, but I recently heard about it from an experienced WPF/SL developer who's far smarter than me, so it might be worth a shot. :-)
Per microsoft: The end user at this time cannot debug the XAML Parser, only MS can do this. The new version of Silverlight 4 XAML Parser has been completely re-written using managed code and hopfully they will give us a better way to debug it. I know this as I just had an issue and opened a support case and was informed this by a Silverlight Dev.
The clkosest I could ever come to seeing what was going on with the parser was using Silverlight Spy:
http://firstfloorsoftware.com/silverlightspy/download-silverlight-spy/
Great tool.

Resources