why 'Windows.UI.Xaml.Markup.XamlParseException' happens when XAML is valid - xaml

An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in myproj.UWP.McgInterop.dll but was not handled in user code
Additional information: The text associated with this error code could not be found.
Cannot find a Resource with the Name/Key category [Line: 0 Position: 0]

You are setting the resource key either from Page.Resources/App.Resources or Standard Resources that has a spelling mistake. Check where you are setting the resources and make sure the spelling is correct. Unfortunately XAML Designer does not show squiggly error when the spelling of resource is incorrect

Related

Error when uploading Image to user when registering?

I am trying to upload the profile picture for my user when registering, but the error "An unhandled exception occurred while processing the request" happens, what is this and how can I fix it. I have successfully loaded the image for the Index page, but my Register got the error as shown below. Here is my code
Error Picture
enter image description here
The error seems to indicate that you did not register the implementation of IProfileRepository. Please, check if you are doing something like below, in you Startup:
services.AddScoped<IProfileRepository, ProfileRepository>()
If you are not, I believe that's the cause. The important error message is actually the "Unable to resolve service..." phrase, shown in the image :)

UWP XAML designer exception - Template10 stopped working suddenly

From one moment to another I am receiving the following error messages:
When starting the UWP app:
One of the content dialog constructor -> InitializeComponent() throws the following exception:
Windows.UI.Xaml.Markup.XamlParseException: 'The text associated with this error code could not be found.
Cannot deserialize XBF metadata property list as 'Behaviors' was not found in type 'Microsoft.Xaml.Interactivity.Interaction'. [Line: 0 Position: 0]'
http://prntscr.com/rb8bdj
And I can't open the XAML Designer:
http://prntscr.com/rb8boo
Template10 version: 1.1.12
Microsoft.Xaml.Behaviors.Uwp.Managed: 2.0.1
So the latest.
There was no any previous sign, this error come up from one moment to another today, everything was working smoothly before.
Can you please suggest anything how can I fix it or debug it?
Solution:
Finally figured out that anything went wrong with the project configuration, after deleting and readding the debug config solved the problem.

Visual Studio giving generic debug errors, but gives specific errors out of debug

I don't even know what to call this, but here's the situation - I use Visual Studio 2013 to create a Windows Forms Project. At some point, the debugger started throwing out this error:
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.
However, I happened to notice that when I run the program without debugging, and the error occurs, it gives me:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
It's not a complicated program, I'm not doing anything like multithreading or delegating yet. No matter what I try, it only gives the first error. I've gotten it when I was try to delete a file that didn't exist, when the index was out of bounds, when a control threw an error. All these errors just quoted the first one in debug mode, but the normal errors out of debug mode.
I just threw the code in another project and it works fine. Maybe it's a option in the debugging menu, but I've tried everything I could imagine. I also tried updating to VS2013 Update 4 and it still does it. Help?
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.
A TargetInvocationException is a wrapper around the actual exception.
"The client application's event-handler delegate should check the Error property; otherwise, the property will raise a TargetInvocationException"
Try returning a try catch and get the ex.InnerException
and see why it is giving this error
System.IndexOutOfRangeException: Index was outside the bounds of the array.
try this as well
try {
//here you read the arguments and pass to a variable
}
catch(System.IndexOutOfRangeException) {
//other codepart
}
Hope this helps

org.eclipse.xtext.linking.impl.IllegalNodeException popups an error instead of just being written to the log

I am writing an editor based on xtext. (v 2.2.1)(Eclipse Indigo)
I have a class that extends DefaultLinkingServic and overrides the method:
public List getLinkedObjects(EObject context, EReference ref, INode node) throws IllegalNodeException.
The method throws IllegalNodeException when an object cannot be resolved.
When the exception is thrown (and it should be thrown) the error is not only written to the error log, but it causes a popup window to appear with the error:
An internal error occurred during: "Xtext validation".
org.eclipse.xtext.linking.impl.IllegalNodeException: Action App.f is not applicable for the specified arguments.
This is very problematic especiallyif the file has multiple errors which makes it impossible to edit anything in the editor, since the popup repeatedly appears on screen.
This problem is consistent in several IDE's but in others is not reproducible.
Any help would be greatly appreciated.
You are stumbling accross this bug which was already fixed for 2.3 (due June).
As a workaround, you may want to bind a custom implementation of the LazyLinkingResource and catch the IllegalNodeException in #getEObject. Alternativley you could return an empty list from your custom LinkingService instead of raising an IllegalNodeException.

XamlParseException was unhandled

I faced the problem debugging my WPF-WCF simple chat application. There's an exception like:
Blockquote XamlParseException was unhandled. 'The invocation of the constructor on type 'ChatGUI.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'.
I see that's a XAML exception, so here's the XAML code listing:
http://www.codeproject.com/Questions/310851/XamlParseException-was-unhandled
Have you ever seen the same problem? I would be glad to see every useful advice.
Thanks in advance.
The XamlParseException can be a little bit misleading. Check if you're doing something in the constructor of your class MainWindow that throws an exception. This will cause the same behavior. Unfortunately the debugger won't break at the real initiater but show you this error.
E.g. use an try catch state statement in the constructor, the catch block will show you the exception.