Windows Phone Background Agents - Custom Control causing Unknown parser error: Scanner 2147500037 - windows-phone

I am attempting to use a custom control for a live tile in my background agent. I have my live tiles successfully generating with user controls, but I now want to reference a custom control in my user control Xaml. At design time everything looks correct, no errors and I see the custom control presented in the designer, but when I run the app and the background agent runs, I receive this error:
Unknown parser error: Scanner 2147500037
The position noted in the error is the location in the Xaml where I have my custom control. If I remove the custom control the error goes away.
The custom control I am attempting to use (and its source code) can be found here:
http://blogs.u2u.net/diederik/post/2013/11/05/A-Modern-UI-radial-gauge-control-for-Windows-Phone-8-apps.aspx
I do not believe there are any references in this custom control to anything that cannot run in a background agent, so I am wondering if there is some limitation in general to using custom controls in background agents for windows phone?
If anyone has any ideas as to the cause of this error, please let me know.

I was not able to get the control to work but refactored the code to implement the straight Xaml rather than using the control. The end result is the same as what the control offered, but more complicated.

Related

Cannot click on specified element on UI-Windows Tree using G1ANT Robot

I'm trying to use UI addon command-click. After looking for an element in windows tree I decided to use that tool to choose a specific button, which opens in the dialog window on my desktop application. Unfortunately, it wasn't working in the main script -> sometimes it clicked, but not on the button itself, it chose the point outside of the dialog box. The tricky part is that line worked, but in different robot file, I placed only one line, exactly the same and it used to work. Today none of the above works...
The error it's giving me sounds like this: "Access denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)" do somebody knows how to make it work properly?
I tried switching on/off addons, focusing on different windows, different delays, changing scaling from windows side, etc.
The line I'm using: ui.click wpath "path to element from UI tree"
Also, res. of the screen is 1920x1080p
I can use image recognition on that part of my script, but if it's in the UI windows tree it should work correctly right?
The path could change, check whether you use any properties that could be dynamic (like #id). Consider using keyboard command if the button is focusable or has assigned a keyboard shortcut.

Windows Form renders unevenly in designer

I have a Windows Form that, for some reason, has changed in looks. Even though no UI changes have been made, certain controls look smaller and some controls, such as the Text in a GroupBox wraps when the app is run. However, when I run the app on other workstations, it looks fine. I don't understand what would cause this unless there were Microsoft updates. Any ideas?
I have attached 2 screenshots, one in the designer mode and the other in execution mode.
Execution Mode
Thanks,
Looks like you didn't design your app with a DPI aware state. Try redesigning it in UWP instead of WFP as UWP is automatically DPI aware.
Also the button that disappears on the right side that says finish, try making sure the Button.visible property is not set to false.

Visual Studio error: "Cannot activate background task. Background Task activation failed."

When I try to launch a particular background task using Visual Studio, I currently receive the following error:
I tried pressing the Help button, which took me to How to trigger suspend, resume, and background events in Windows Store apps. The page said to look at a certain section in Event Viewer that didn't contain any entries.
The corresponding Windows Store application is both requesting background task permission and registering the task. The application is enabled for the lock screen. The application's project is referencing the background task project, and its manifest is specifying the correct fully-qualified class name of the background task. The correct type of background task has been specified in the manifest.
I was able to resolve this by changing the task registration/location code to call RequestAccessAsync before registering the background task. (Previously, it had registered the background task before asking for access.)
For some reason, this caused the application to request access again. After running the application and granting it permission, I reverted the code back to the previous state.
Now it works correctly again even though the code is the same as it was originally.
For me, I had a problem where I had updated TaskEntryPoint in my manifest but forgot to update it in my code... Frustrating to have to maintain it both places!
It got out of sync via the process of refactoring some classes into a new library, so don't forget to update after the fact if you do that!
You may be able to use reflection to help with this e.g. typeof(LocationTask).FullName
Restarting Visual Studio (2015) solved this problem for me.
You probably already did this, but sometimes one forgets about the easy things.

VS2012/ Blend 5: Debugging an Exception (only) occurring in design view

I'm developing a Metro-style app (for Windows 8) using C# and XAML. I have set up my viewmodels to be used as design-time datacontexts, like so:
xmlns:vm="using:hub.ViewModels"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type=vm:ViewModels
My app appears to work perfectly when run, but in the design views of both VS 2012 and Blend, I occasionally get this (unhelpful) error message:
An Exception was thrown. TargetException: Error in the application.
Stacktrace
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
InnerException: None
This only happens in the design view - meaning I can't set breakpoints around all my INotifyPropertyChanged() events.
What is the best approach to debugging design-time errors?
If this happens consistently or semi-consistently, you can attach the debugger to the XAML designer:
Start Visual Studio; open your project and open a XAML file, causing the XAML designer to load
Start a second instance of Visual Studio. Open your project but make sure no XAML documents are open.
Ensure that Just My Code is disabled: From the Tools menu, select Options. Select the Debugging category. In the General page, ensure the check box next to Enable Just My Code is unchecked.
From the Debug menu, select Exceptions... and check the Thrown check box next to Common Language Runtime Exceptions. This will enable first chance handling of all CLR exceptions. If you know the specific type of the exception, you can enable first chance handling for just that type.
From the Debug menu, select Attach to Process. In the Attach to: field, click Select... and check the Managed (v4.5, v4.0) entry in the list and click OK.
This is necessary because the debugger may misdetect the process as a native process if it attaches while the process is executing native code. If your project contains native code, you'll want to check the Native check box in the list as well (you can debug both managed and native code at the same time).
In the Available Processes list box, find the xdesproc.exe that corresponds to your project and click Attach.
If there are multiple processes (usually because you have multiple projects open or because the designer is reloading or has recently reloaded), it can be difficult to determine which designer process belongs to which Visual Studio instance. It's often easiest just to attach to all of them. A tool like Process Explorer can help you figure out which designer process belongs to which instance of Visual Studio.
Note: Do not attach the debugger to a designer process (xdesproc) that belongs to the same instance of Visual Studio that you are using for debugging: doing so is likely to cause Visual Studio to hang. You must always use two different instances of Visual Studio.
Do whatever you need to do to repro the bug. When it occurs, the debugger will break at the point where the exception is thrown. The debugger should load the symbols for your assemblies.
I got here while looking for info on how to debug designer time instance problems, though I did not have the same problem as rikkit. But...I'm sharing the solution to a related issue just in case others having the same problem reach here as well:
Make sure you have the "Enable/Disable Project Code" toggle set to "enabled"...in VS/Blend 2015 it's a small icon below the XAML editor
as shown here.
If it's disabled, this could be the reason your design time instance doesn't seem to be working.
Further, if it's disabled and you attempt to debug using a second VS instance, then when you attach to the XDesProc any breakpoints you set in the code-behind will report that they "will not currently be hit. [because] No symbols have been loaded for this document".
You might think that you need to somehow load the symbols, but if you open up the Modules window attempting to do so, you won't even see your module in the listing.
I lost a couple hours on this issue because of this setting being disabled. Hope this helps others not do the same.
I'm not sure about it but I believe you can check for the IsInDesignModeProperty Field. I remeber having to do so on WinForms sometimes.
Also take a look at this link Troubleshooting WPF Designer Load Failures

Silverlight 2 User Control - Unknown attribute name on element

Update:
Screenshot http://farm4.static.flickr.com/3277/3048788466_661e8e5e78_b.jpg
To reproduce:
Get this sample project from Silveright.net - http://download.microsoft.com/download/5/9/2/5922d533-7ed5-4065-a138-ce3d9ca266e5/4-UserControls_Source_CS.zip
Open the UserControlDemo Solution. Then on Line 9 of Page.xaml, you'll see the error.
http://download.microsoft.com/download/5/9/2/5922d533-7ed5-4065-a138-ce3d9ca266e5/4-UserControls_Source_CS.zip
I'm creating a User Control in Silverlight 2 using this as my guide.
The problem is that when I use my User Control in Page.xaml, the XAML canvas shows this error: "Unknown attribute Name on element ... ."
Due to this error, I can no longer preview my XAML canvas. The strange thing is that the project still builds and renders my User Control beautifully.
Upon investigating the problem, I've found out the the cause of the problem was that my User Control was using a Style which is a StaticResource. When I remove this Style Property, the error in my Page.xaml XAML file disappears.
This error has been talk about in other online threads but unfortunately to no resolve.
I'm using the latest release and service packs of Visual Studio 2008 and Silverlight 2.
Is there something wrong with what I'm doing or is this a VS/Silverlight bug?
Thanks in advance!
In my experience the Visual Studio XAML designer, especially with Silverlight, will crap out for pretty much anything. I can't open a XAML file without all sorts of those mysterious errors and when it does render in the designer, it's not usually very useful.