ProductId validation error after upgrading Windows Phone 8.1 Store App project to UWP - windows-phone-8.1

I upgraded my Windows Phone 8.1 Store App project to the new Universal Windows Platform following this guide. After some minor errors everything looks good so far except this error:
Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 16, Column 21, Reason: '12345.User.MyAppName' violates pattern constraint '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'. The attribute 'PhoneProductId' with value '12345.User.MyAppName' failed to parse.
Step 4 from the guide I used states:
For Windows Store only: You need to add a <mp:PhoneIdentity> child element to the <Package> element. Add a PhoneProductId attribute and a PhonePublisherId attribute. Set the PhoneProductId to have the same value as the Name attribute in the <Identity> element. Set the PhonePublishedId value to: 00000000-0000-0000-0000-000000000000.
This is exactly what I did, but my Name attribute of course doesn't match the pattern that is (now) expected. I also read here that PhoneProductId matches to the ProductId of the published Windows Phone 8 app, but either this is the same as I used above (not quite sure) or I can't find it (looking at my app's details on the Developer Dashboard on MSDN).
How can I fix this without losing reference of my upgraded solution to the app already published?

To make your Universal Windows App link to your already published Windows Phone 8.1 app, put your Windows Phone 8.1 ProductID and PublisherID that you can find in your AppxManifest.xml (or the Package.appxmanifest in Visual Studio), in the Universal App's corresponding PhoneProductId and PhonePublisherID in the element.

Related

IsolatedStorageSettings after application update from store

I am writing my Windows Phone 8.1 Silverlight App (NOT RunTIME framework).
I have to questions:
Which is the App manifest file for Windows Phone 8.1 Silverlight? WMAppManifest or Package.appxmanifest? as my project contains both
I created a method in Mainpage of application which detects that is it the first time this application is running or not. If it is first time execution of this app, registry of 120 keys (IsolatedStorageSettings.ApplicationSettings) is created and app moves to WelcomePage.If the execution is not the firsttime, means user has opened this app before, it skips the registrycreation method and directly goes to homepage.
When I upload this version 1 of app to store and users install and use it. What when I add more keys to registrycreate method in version 2 and upload version 2 to store. How will be those new keys get created? Even, when user updates the app, the registrycreation method will never run.
The "Silverlight" app manifest is WMAppManifest.xml, but you still need to include the "RT" manifest Package.appxmanifest and, if you ever use any of the RT namespaces that require certain capabilities, you should check those capabilities in the Package.appxmanifest too. Eg "Internet (Client & Server)" if you are using things like Windows.Networking.BackgroundTransfer.
You'd need to add some code to check if the information or information structure has changed every time the app is run (or resumed), so that in the event of an update (and change in the keys), they get added, even if your "first run" code doesn't fire. Make sense?
If you know the keys numbers will always get bigger then watching the key count will work. You could also include a key with the version so you can tell which version the data was created with.
You can use Windows.Storage.ApplicationData instead of IsolatedStorageSettings in Windows Phone Silverlight 8.1. ApplicationData supports versioning with the ApplicationData.SetVersionAsync method so you can change the data format safely when you update the app.
Either way, when the app runs check if the data's version is the latest that the app knows about. If not then run your setup and migration code to add the new keys and replace the out-of-date ones.
The data version doesn't have to match the app version (you may update the app's version without changing the data). You can compile a data version constant into the app's data handling code and bump it whenever you change the data format.

How to add PCL Profile 259

How is it possible to setup Profile 259?
Right now my dev environment has VS 2012(Update 4), Xamarin Studio 5.5.2 & Windows Phone SDK 8 (in which I haven't activated a phone yet).
When I try to create a PCL project (to be used with a MVVMCross framework) I can select the iOS & Android frameworks but not the Windows Phone 7. The process of "adjusting" profile 259 is described in this article, which assumes the profile already exists in a physical folder.
In my situation there is only profile 78.
As always in life...insight comes after having spoken out the question!
Well I can't say that i found a real solution, but for my requirements..it works:
Create the PCL project with the following frameworks selected: iOS, Android, .NET4.5.
Add the reference to MVVMCross.
Change the target frameworks (in project-properties), adding Windows Phone 8.

Windows Phone 8.1 - DLL reference problems when using the camera

I'm trying to create a simple camera application according to the MSDN tutorial.
All I did was installing Visual Studio 2013 Update 3 and then created a new Visual C# \ Store-Apps \ Windows Phone-Apps \ Empty App Template and added the code to my MainPage.xaml.cs.
The first problem is, that it does not find the namespaces Microsoft.Xna.Framework.Media, System.IO.IsolatedStorage and Microsoft.Devices. According to the tutorial, I have to add the Xna DLL in the "Add references" .net Tab, but unfortunately, there is no .net tab. I only have the following categories:
-Assembly (All Assemblys are already references)
-Project
-Windows Phone 8.1 (only 5 DLLs, but different ones)
After a lot of searching, I found them in 'C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\MdilXapCompilev8.0\Framework', but there is no System.IO.IsolatedStorage DLL.
When I ommit this using directive, I end up getting an error because it does not know this.Dispatcher.
Am I missing something? Do I have to install anything else?
The problem is probably that the link you have provided concerns WP8.1 Silverlight and you might have chosen WP8.1 Runtime project. Those are different API's - XNA is not supported in RunTime, you also won't find Microsoft.Devices there.
If you want to create your Camera App for WP8.1 Silverlight encure that you have chosen (Windows Phone Silverlight) template. Otherwise, of course you can also write Camera App but with different API - you may take a look here,also you may find something useful here at blog.

FileSavePicker and deprecated ApplicationViewState

In the documentation for the FileSavePicker, it states:
Warning If you try to show the file picker while your app is snapped the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped or by unsnapping it before you call the file picker.
I'm currently checking to see if the app is snapped or not, and my app responds differently in each case. My default behavior isn't showing the FileSavePicker, either, so I can't just try and then fall back to something else. Nor do I want to force the app to unsnap.
However, ApplicationViewState is deprecated post-8.1. In that documentation and related searching, developers are advised to access the window size directly in order to determine proper behavior. However, if the view state is no longer available, how do I know if the file picker will throw an exception or not? At what size is the app considered 'snapped'?
Also, I'm using C++, so an answer compatible with C++ would be splendid. I wouldn't mind seeing the C# solution, too.
In regards to the FileSavePicker documentation - I believe that it is just an oversight. The text you quote was from the Windows 8 version, and to me it looks like it didn't get updated for Windows 8.1.
If you look at the FileOpenPicker documentation, you see that it was updated:
Important In Windows 8 if you attempt to display the file picker while your app is snapped, the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped, or by unsnapping it before you call the file picker. ...Note that Windows 8.1 does not define a specific snapped window size. Instead, users can resize apps to any width, down to the minimum. Therefore, if your app will deploy only on Windows 8.1, you can ignore the EnsureUnsnapped function and calls to it in this topic's example code.
The last sentence (in bold) above essentially says that you can ignore state and safely open the file dialogs if you are running under Windows 8.1.
To test the above, I used VS 2012 to create a Windows 8 application with a file save picker (in C#). I believe the outcome will be the same with C++, but I am not 100% certain.
I should note that my test application does not check for view state and always tries to open a file dialog.
When the application is run under Windows 8 in the snapped state, the application causes an error. That same application (same binary) when run under Windows 8.1 allows the file save dialog to open without issue. As mentioned previously there is no snapped state in Windows 8.1, so the way I tested the application was to open the application to the minimum width (320 pixels).
To summarize:
If you are targeting Windows 8.0, you will have to make sure the application is unsnapped prior to opening the file picker dialogs.
If you are targeting Windows 8.1, you do not have to worry about state, as the file picker dialogs no longer throw any exceptions.

VS2013 deploys Windows Phone app to emulator only after 'Rebuild Solution' command

Something weird happened to one of my C# Windows Phone 8 Silverlight projects.
It's a simple page with one TextBox I'm experimenting with, building a customized style for it. First I placed a TextBox on the PhoneApplicationPage, generated a style template for it using the 'Edit Template\Edit a Copy' command from the context menu in the designer. Now I'm changing some setters and property values in the style, but when I hit F5, an old version of my project is launched in the emulator - all my recent changes aren't taken into account. The latest changes are reflected in the launched app only after I issue the 'Rebuild Solution' command from the Build menu.
The XAML markup has no errors, and it seems all stuff is correct. Other WP8 projects are built and deployed to the emulator ok too. The problem does not depend on the selected emulator (WVGA 512Mb, 720p, etc). Restarting VS/emulator has no effect too.
What it can be and how to fix it?
Some more info. For any normal project I see this in the Output window when I hit F5 (the app full path was shorten to save space):
But for the problem project, the output log ends on the line '1> Xap packaging completed successfully' and the old version of the app is opened in the emulator immediately.
It seems, I have managed to find the reason of this strange issue. This can happen if the name of a WP app includes spaces! I noticed that if we create a new project and use the space character in its name, the spaces are replaced with the underscore characters on the phone (for instance, "WP Test App" is deployed under the name "WP_Test_App"). I also found this while searching for a solution of this problem:
App doesn't get updated then debugging - incrmental update not correctly working?
I played a little bit with the names of my project and solution, i.e. removed the spaces in them, and it helped to solve my puzzle.
BTW, as the author of the question under the above link states, this problem never occurred in the WP 7.1 SDK - it is specific only for the WP 8 SDK.