Issues when trying to test Windows Phone 8 app with actual device - sql-server

I actually have a problem while trying to test my application directly on my Windows Phone 8 device.
I have a SQL Database, and my Windows Phone 8 application connects to it successfully through a WCF Dataservice when using the emulator.
When I try to run the application with the Phone plugged to the computer, it doesn't run anymore, and I get those kind of unhandled exception before the managed limit:
`System.Net.WebException`
`System.Data.Services.Http.WebException`
`System.Data.Services.Client.DataServiceTransportException`
`System.Data.Services.Client.DataServiceClientException`
`System.Data.Services.Client.DataServiceQueryException`
Thanks a lot.

Related

Silverlight app not running on Windows Phone 10

We have a Silverlight app written for Windows Phone 8.
Everyone in the company has upgraded to Windows Phone 10 and the app still install and runs perfectly from the Microsoft Store. Except for one phone! Unlocking the phone for development and running it in debug gives the following errors in the output...
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.TypeLoadException' in mscorlib.ni.dll
Getting the detailed output for the FileNotFoundException gives the following...
Additional information: Could not load file or assembly
'System.Windows.RuntimeHost, Version=2.0.6.0,
Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
or one of its dependencies. The system cannot find the file specified.
The System.Windows.Runtimehost dll is the host for running a Silverlight application. That would explain why it does not run. But how can this be missing from the phone and not from any other phone?
We tried a factory reset of the phone and it still does not work.
Anyone else seem this, any ideas?
I managed to get a suggestion from a Microsoft forum that worked.
I used the Windows Device Recovery Tool that allows a new image to be downloaded and then installed on the phone. It automatically pulls down the correct image for your make/model of phone. I assume these are hosted at Microsoft. After the phone was updated with the new image it worked as expected.

Application crashes on start when running through remote desktop

I am developing a WPF application. I am accessing an admin account on a clients machine using remote desktop. When I try to run the application I am getting a xaml parse exception when the program attempts to initialise.
The strange thing is if I run the program without remote desktop on the same account it works fine.
Has anyone experienced anything like this before?

Unable to Deploy WP7 SDK Application on Windows Phone 8 Through VS2012

I have Registered my device for developer.
But after choosing device in VS2012 and start deploying , It Gives error .
Unable to install application. The maximum number of developer applications on this phone has been reached. Please uninstall a developer application and try again.
I am new to deployment on device . Please suggest .
Do you happen to have multiple Windows Phone 8 devices? It turns out that if you register two devices under the same name, this problem arises. I had registered two Windows Phone Devices for development, but I hadn't given them a unique name (they were both named the default, which is Windows Phone, I think). On the first device, I had multiple test apps installed and, obviously, on the second device, nothing was installed, hence my frustration regarding the error. I did the following to make it work:
Remove the phone(s) from the dev portal,
Unregister both devices using Windows Phone Developer Registration.
Rename the devices, making sure their names are not the same.
Re-register the phones again, now with new, unique names.
I hope it works for you as well.
Uninstall the unwanted applications from the device.
Restart the device
Try to deploy the solution. It will work now.
It means you have installed three(3) testing app. windows phone have limit of max 3 app installation for debug.
Uninstall one of your previously installed application.
Now deploy your new application again.
Hope will work now.

Differences between ScheduledTaskAgent for Windows Phone 8 and 7.1

I have a big problem.
I wrote an app for Windows Phone 7.1+, and it's also published on Windows Phone Store:
this app works well for Windows Phone 7.1 and also for Windows Phone 8, and there were no problems during app submission process (who also declares that my app is fully compatible with any OS since Windows Phone 7.5).
The problem is related only to my Scheduled Agent, which runs perfectly on Windows Phone Mango (7.1), but it is not firing at all on Windows Phone 8 (I've also tested my app on real devices, with both the OS').
When I upgraded to Visual Studio 2012 (Express for Windows Phone), I've noticed that it is possibile to add two different types of ScheduledTaskAgent project: one for Windows Phone 7.5 and one for Windows Phone 8 (obviously it wasn't so in Visual Studio 2010...and I used the only one available = the first) !
Dou you think this can be the reason while the scheduled agent is not working in WP8?
What's the difference between the two projects types?
How to manage (in code I mean) two projects of that type? Is it possible?
How can I choose which task I have to register (see code below)?
Will the submission process fail with two ScheduledTaskAgent projects (I think so)?
This is the critical part of the code, when I'm registering my task at startup:
PeriodicTask newTask = new PeriodicTask("MyTaskID");
newTask.Description = "my Description";
ScheduledActionService.Add(newTask);
#if DEBUG
Microsoft.Phone.Scheduler.ScheduledActionService.LaunchForTest("MyTaskID", TimeSpan.FromSeconds(5));
#endif
Thank you in advance.
The only difference between the two project types is (1) the Windows Phone 8 one targets Windows Phone 8 instead of 7.1 and (2) it references the Windows Phone 8 SDK instead of the Windows Phone 7 dlls.
I have an application where I have two projects (7.1 and 8.0). I also have two background agent projects (7.1 and 8.0) and I share code between them using linked files. I reference the 8.0 agent from the 8.0 project and the 7.1 agent from the 7.1 project. I used this example as a best practice for having the two versions of code.
You do not want to reference two agents since that will not work.
If you remove the #if DEBUG does your agent get called when you're debugging?
First make sure you got the proper reference in app manifest file.
<ExtendedTask Name="BackgroundTask">
<BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="MyApp.Agent" Source="MyApp.Agent" Type="MyApp.Agent.ScheduledAgent" />
</ExtendedTask>
Second the Agent library must be referenced in the main app project.
Third, make sure you are not exceeding the allowed running time or memory allocation. In WP8 the cap for background agent was raised to 11MB. Also there is a limit of app with registered background tasks, so it might be possible that there was no free slot for your task with bg agent.

Difference in Logoff notification events between Windows XP and Windows 7

I have a service / application which receives notifications of Windows session changes.
I have noted a difference in behaviour between Windows XP and Windows 7 and am trying to establish if it is a bug or a documented change of behaviour.
The notifications come in as a: WTSSESSION_NOTIFICATION.
Windows XP reports as expected: WTS_SESSION_LOGON at windows GUI logon and: WTS_SESSION_LOGOFF at Windows GUI logoff.
Under Windows 7 x64 at gui login WTS_SESSION_LOGON is generated but at logoff I get a WTS_CONSOLE_DISCONNECT event instead of the WTS_SESSION_LOGOFF event.
Is this a bug or have the constant values changed between versions? It is not massively critical for the service I have developed but I would still like to know why this behaves differently.
Only services can receive the WTS_SESSION_LOGOFF event under Windows 7. By the time that the service gets the notification the log off procedure is over (so all apps the user was running are already killed).

Resources