Differences between ScheduledTaskAgent for Windows Phone 8 and 7.1 - silverlight

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.

Related

Which cab should I deploy to my handheld device to install CF version 2?

Based on what I read here, in order to install CF version 2 on my handheld device, I should copy over one of the cab files here:
...but which one?
The device in question is a Symbol 3090, which currently has only CF version 1.0.3316.00 (1.0 SP2) installed. The OS version of the device is 05.00.1400
The device CPU is presumably 'ARMV4I' as a similar device (Motorola 3190) says that it is equipped with such.
UPDATE
Based on what I see here when I click "this link" here:
-- OR -- If you have Windows Mobile 5 or newer on your device, click this link and save the file to the desktop of your computer.
...it seems "NETCFv2.wm.armv4i.cab" is probably the best choice.
Any refutations?
UPDATE 2
I copied the file I reckoned to be the one, and clicked it on the device, but:
What in Sam L. Clemens' illustrious memory is going on here?!?
UPDATE 3
I then copied over the other file from the link above, which was slightly different (2.12MB as opposed to 2.14MB, for one thing), and tried to run it, and got the same err msg as above.
UPDATE 4
Trying to install from the last link, I see:
UPDATE 5
Actually, it turns out that what I might really need is to install CF version 1 after a cold boot of the device...but I don't know if version 1 of CF is still available. That's the only version the existing .exe will run on, but my PC only has cab files for versions 2 and 3.5...???
UPDATE 6
In the most recent version of the .exe (builds and compiles, but won't run on either device), it has three, count 'em three mscorlibs in its References area; the versions are:
1.0.5000.0
2.0.0.0
3.5.0.0
They all have the same public key token (the same as shown in the screen shot)
The only other multi-reference is System, which has both version 2 and 3.5
AND, below System.Xml, there are three coredll.dlls, albeit spelled differently:
coredll.dll
CoreDll.dll
CoreDll.DLL
(no info for any of them...???)
UPDATE 7
I copied NETCFv2.wce4.ARMV4.cab to the 3090.
I 2-clicked it on the device, but got this:
And so, I retreated (selected "No").
Thus continue unabated the travails of an accidental handheld developer.
UPDATE 8
The project is set to Framework Version == v2.0, Platform == Windows CE, Target Device == Windows Mobile 6 Classic Emulator (one of the few emulator choices I have), and the output shows that it is ARMV4i that is being deployed:
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i
\sqlce.ppc.wce5.armv4i.CAB'
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i
\sqlce.repl.ppc.wce5.armv4i.CAB'
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i
\sqlce.dev.enu.ppc.wce5.armv4i.CAB'
Deploying 'C:\Program Files (x86)\Motorola EMDK for .NET\v2.8\SDK\Smart Devices\wce500\armv4i\symbol.all.arm.cab'
And when I run the .exe in the emulator, it fails with, "Error - An unexpected error has occurred in Platypus.exe
Select Quit and restart this program, or select Details for more information.
This application requires a newer version of the MS .NET Compact Framework than the version installed on this device."
Selecting the "Details" button augments the mental anguish with, "TypeLoadException
This application requires a newer version of the MS .NET Compact Framework than the version installed on this device."
Assuming your are using the WinCE 4.2 version of the 3090 (it comes in 4.2 and 5.0), you should proceed with the install using NETCFv2.wce4.ARMV4.cab. "The program is not compatible..." message is a warning only, and not a very smart one. There is even a way to edit the cab to remove that warning if you wanted to, though my memory fails me on the exact way to do it. I've had to do it to allow a silent install before (otherwise the nag screen gets in your way).
First you need to figure out what version of CE you are running. You can find this by going to System Properties. Also while you are in System Properties note what processor you are running ( arm, mips ...). If you are running windows ce 4.2 or higher you will pick a cab file out of the wce400 folder. If you are running windows CE 5.0 or higher you will pick a cab file out of the wce500 folder. Note you can't install .net 2.0 on windows ce 4.1 or lower, according to Microsoft documentation, however, I have noticed that the minimum version setting on the cab files is 4.0, so you might be able to hack it.
Like I said before on also the System Properties page is the type of processor you are using. From that select the appropriate sub-folder in either wce400 or wce500. In most of the folders for each processor there should be only one cab file. If there is more than one cab file see if the file name contains wm for windows mobile, wce for windows ce, or ppc for pocket PC and pick the one most appropriate for you.
You can also take the guess work out of this whole process by creating an ini file with the fallowing text and using ceappmgn.exe to pick and install the right cab file for you.
[CEAppManager]
Version = 1.0
Component = NETCF
[NETCF]
Description = .NET Compact Framework v2.0
CabFiles=wce400\armv4\NETCFv2.ppc.armv4.cab,wce400\armv4\NETCFv2.wce4.ARMV4.cab,wce400\mipsii\NETCFv2.wce4.MIPSII.cab,wce400\mipsiv\NETCFv2.wce4.MIPSIV.cab,wce400\sh4\NETCFv2.wce4.sh4.cab,wce400\x86\NETCFv2.wce4.x86.cab,wce500\armv4i\NETCFv2.wm.armv4i.cab,wce500\mipsii\NETCFv2.wce5.mipsii.cab,wce500\mipsiv\NETCFv2.wce5.mipsiv.cab,wce500\sh4\NETCFv2.wce5.sh4.cab,wce500\armv4i\NETCFv2.wce5.armv4i.cab

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.

How to Resolve Quickbooks Interface Error: QBFC Error "Could Not Load File or Assembly Interop.QBFC7 or one of its dependencies"

I recently inherited a C# Winforms application that communicates with Quickbooks via their QBFC interface. The application contains a reference to the COM Server Interop.QBFC7.dll. The application works fine in our test environment and in several of our client's environments. Although, yesterday when I attempted to install it on a new customer's system I continued to get the following error:
Could Not Load File or Assembly 'Interop.QBFC, Version=8.0.0.87, Culture=neutral, PublicKeyToken=...' or one of its dependencies. The system cannot find the file specified.
I know that we have several customers running this application on various versions of Quickbooks (i.e. Quickbooks Pro, Premier and Enterprise between 2008 and Enterprise 11.0). To my knowledge, this is the first customer that we have attempted to deploy this application that has Enterprise 12.0.
I have attempted the following to resolve the issue with no success:
1) Install the QBFC7_Installer from the Intuit Developer Network Site
2) Install the Quickbooks SDK 10 Installer from the Intuit Developer Network Site
3) Verified that the Interop.QBFC7.dll file is present on the file system.
4) Attempted to manually register the COM object Interop.QBFC7.dll via the command prompt: regsvr32 Interop.QBFC7.dll (This fails as well and windows returns an error stating that it cannot find the object).
Does anyone have any suggestions or feedback about additional things that I can try to resolve this issue? I get the same error on 3 different machines at their site running different operating systems (i.e. Windows Server 2008, Windows 7, and Windows Vista)? I have also tried compiling in both x86 and 64-bit configurations to no avail.
Thanks in advance for any help.
First of all, you should be targeting an x86 build only. The QuickBooks SDK won't work if you target Any CPU or x64. Your main problem, though, is that you are looking for the wrong version of QBFC. Notice the version stamp on your error message:
Could Not Load File or Assembly 'Interop.QBFC, Version=8.0.0.87,
Culture=neutral, PublicKeyToken=...' or one of its dependencies. The
system cannot find the file specified
This is QBFC8, not QBFC7. So you should be able to fix the problem with the QBFC8 installer.
The version of QuickBooks should not make a difference, since QBFC 8 (or 7, for that matter) will work with the 2008 and Enterprise 11 or 12.
You should look into using a setup project to install your application in order to avoid this problem in the future. A setup project should detect the QBFC dependency automatically. Once you see this happening, go to SearchPath property of your setup project and add the MergeModule directory from the SDK that is installed on your machine. Once you do this, you should see that the QBFC and Xerces merge modules are added to your project automatically as dependencies. Of course, you'll also need to update your code to a more recent version of QBFC, but that's probably a good idea in any case.

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).

Is it possible to degrade from Internet Explorer 7 to Internet Explorer 6 for debugging purposes?

I'm having Internet Explorer 6 problems on one of my sites, and I really wish I had it installed instead of Internet Explorer 7. Is there a quick way to do this?
Download Microsoft VirtualPC. Then download any of the files in Internet Explorer Application Compatibility VPC Image. The second download contains four VHD (virtual hard drive) files which have:
XP SP2
IE 7
XP SP3
IE 6, IE 8 Beta 2
Vista SP1
IE 7
Multiple IE:
It is possible to run Internet Explorer in standalone mode without having to over-write previous versions thanks to Joe Maddalone who came up with a way of achieving that in November 2003. Basically, Internet Explorer is run by exploiting a known workaround to DLL hell - which was introduced in Windows 2000 and later versions - called DLL redirection.
Manfred Staudinger perfected the standalone versions by adding IE version numbers to the title bar of the standalone browser window. Moreover, by removing the "IE" key in the registry subkey [HKLM\SOFTWARE\Microsoft\Internet Explorer\Version Vector] Internet Explore defaulted to respecting conditional comments based on the version number prebuilt in the program.
It is not difficult to follow the instructions and get any version of IE running in standalone along side other versions. Most of you probably know of evolt's archive of Internet Explorer which has them readily packaged in ZIP files. Now suppose you want to download them all. An installer that would conveniently automate the whole process would be great. Thanks to this comment for the idea.
So I made an installer which contains IE3 IE4.01 IE5 IE5.5 and IE6...
Download Virtual PC and set up a bunch of them for testing with various browsers/OS's. Once set up, this makes it trivial to test on IE6,7 and 8, various Firefox flavours, Konqueror, Opera, Safari, etc...
See Samuel's answer for a helpful VPC image in getting this started:
I recommend always testing your sites using BrowserShots. You can see how your site looks across multiple browsers, with multiple versions, on multiple operating systems. You can do something like 50 tests a day on their free service.
Also check out IETester, which gives you 5.5, 6, 7, 8b2 in one app.
Litmus is another BrowserShots-esque service.
This works fine for me: Multiple IE
Edit: looks like the minute it took me to find the URL was enough for 3 people to beat me to it..wow
IETester is pretty good, compare IE5.5/IE6/IE7/IE8 side by side.

Resources