In the previous project created in the VS2015 RC open CTP, we introduced how to open the Universal project created in the CTP in RC, which is how we can migrate Windows 8.1/wp8.1 apps to Universal windows On the platform.
2015RC, we can migrate 8.1 of applications to the unified platform, and then use the new API for development, below we use the wp8.1 application as an example to explain the next step.
1. First we use 2015 to open the previous project.
2. Right click on the project and select "Uninstall Project".
3. Right click on the project and select "Edit Xxx.csproj"
4. As in the previous article, get the platform version number, the path is "\program Files (x86) \ Windows Kits\10\platforms\uap"
We're going to start revising the project file.
5. Find a PropertyGroup node with a child node targetplatformversionand a value of 8.1 (in fact the first PropertyGroup in general), make the following modifications:
- Change the value of Platform to x86
- Add a targetplatformidentifier node with a value of UAP
- Change the value of targetplatformversion to the version number obtained in 4
- Add a targetplatformminversion node with a value of version number 4
- Change the value of minimumvisualstudioversion to
- Change the value of projecttypeguids to {a5a43c5b-de2a-4c0c-9213-0a381af9435a};{ FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Add a enabledotnetnativecompatibleprofile node with a value of true
6. Replace all vs versions from 12.0 to 14.0, this step can be replaced directly (CTRL+H)
7. Remove the PropertyGroup node configured as AnyCPU
8. To see the remaining configuration is the release of the PropertyGroup node, if there is no usedotnetnativetoolchain child nodes, then add one, the value must be true, that is,:< Usedotnetnativetoolchain>true</usedotnetnativetoolchain>
9. If it is a mobile project, you also need to delete the following node
10. Now reload our project and you will find that the project type has become Windows Universal! There is still a need to modify manifest.
11. Open the manifest file, first we need to replace all schema, the package node with the following paragraph replacement.
< Package xmlns = "Http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap= "Http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:mp = "Http://schemas.microsoft.com/appx/2014/phone/manifest" ignorablenamespaces = "UAP MP" >
For Win8.1 applications, additional mp:phoneidentity nodes need to be added, such as Phoneproductid is the identity name, Phonepushedid is currently a fixed value
<Name= "fe8a6971-8349-489b-8941-83dd308e9b9b" Publisher= "CN =xxxxxxx " Version=" 1.0.0.0 "/> < Phoneproductid= "fe8a6971-8349-489b-8941-83dd308e9b9b" phonepublisherid= " 00000000-0000-0000-0000-000000000000 "/>
12. Add the following sub-nodes under the package, where the version number is the one we've been using before
< Dependencies > < Name= "Windows.universal" minversion= "10.0.10069.0" maxversiontested= "10.0.10069.0"/></Dependencies >
13. Delete the Prerequisites Node
14. Check your resources node, and if you use scale and dxfeaturelevel , add the uap namespace to them, as follows
<Resources> <resource language= "x-generate"/> <resource uap:scale= "+"/> < Resource uap:dxfeaturelevel= "dx11"/> </Resources>
15. Check your capability node, and if you use the following permissions, you need to add the UAP namespace.
- Documentslibrary
- Pictureslibrary
- Videoslibrary
- Musiclibrary
- Enterpriseauthentication
- Sharedusercertificates
- Removablestorage
- Appointments
- Contacts
Such as:
< Capabilities > < name= "documentslibrary"/> <name = "Removablestorage" /> </ Capabilities >
16. Change the namespace of the Virsualelements node and its child nodes to UAP
<uap:visualelementsDisplayName= "APP9"Square150x150logo= "Assets\logo.png"Square44x44logo= "Assets\smalllogo.png"Description= "APP9"BackgroundColor= "Transparent"> <Uap:defaulttileWide310x150logo= "Assets\widelogo.png"Square71x71logo= "Assets\square71x71logo.png"/> <Uap:splashscreenImage= "Assets\splashscreen.png"/></uap:visualelements>
For Win8.1 applications, it is important to note that the SIZE in the attribute Square{size}logo changes, 70x70 becomes 71x71, 30x30 becomes 44x44.
The old:
< m2:visualelements ..... Square30x30logo= "Assets\smalllogo.png" ... > < m2:defaulttile ..... Square70x70logo= "Images/70x70.png"></m2:visualelements >
NEW:
< uap:visualelements ..... Square44x44logo= "Assets\smalllogo.png" ... > < uap:defaulttile ..... Square71x71logo= "Images/70x70.png"></uap:visualelements >
17. Check the Extensions node to add a namespace for the following nodes UAP
- Windows.accountpictureprovide
- Windows.alarm
- Windows.appointmentsprovider
- Windows.autoplaycontent
- Windows.autoplaydevice
- Windows.cachedfileupdate
- Windows.camerasettings
- Windows.fileopenpicker
- Windows.filetypeassociation
- Windows.filesavepicke
- Windows.lockscreencall
- Windows.printtasksettings
- Windows.protocol
- Windows.search
- Windows.sharetarget
Such as:
<Extensions> <uap:extensionCategory= "Windows.alarm"/> <uap:extensionCategory= "Windows.search"entrypoint= "Myactivateableclassid.baz"/> <uap:extensionCategory= "Windows.protocol"> <Uap:protocolName= "mailto"Desiredview= "Usehalf"> <Uap:displayname>MailTo Protocol</Uap:displayname> </Uap:protocol> </uap:extension></Extensions>
18. Add UAP namespaces for background tasks of type chatmessagenotification
Such as:
<ExtensionCategory= "Windows.backgroundtasks"entrypoint= "Fabrikam.backgroundtask"executable= "MyBackground.exe"> <BackgroundtasksServerName= "Mybackgroundtasks"> <Uap:taskType= "Chatmessagenotification"/> </Backgroundtasks></Extension>
19. Modify Packagedependency, add publisher and MinVersion properties
< Dependencies > < packagedependency Name = "microsoft.vclibs.120.00" Publisher= "Cn=microsoft Corporation, O=microsoft Corporation, L=redmond, S=washington, C=us" minversion= "12.0.30113.0"/></Dependencies >
20. Replace the background task of type gattcharacteristicnotification and rfcommconnection with the Bluetooth type.
<ExtensionCategory= "Windows.backgroundtasks"entrypoint= "Fabrikam.backgroundtask"executable= "MyBackground.exe"><BackgroundtasksServerName= "Mybackgroundtasks"> <TaskType= "Bluetooth"/></Backgroundtasks></Extension>
21. Replace Bluetooth.rfcomm and Bluetooth.genericattributeprofile with the new Bluetooth capability
The old:
<Capabilities> <m2:devicecapabilityName= "Bluetooth.rfcomm"> <M2:deviceId= "any"> <m2:functionType= "Serviceid:34b1cf4d-1069-4ad6-89b6-e161d79be4d8"/> </M2:device> </m2:devicecapability> <m2:devicecapabilityName= "Bluetooth.genericattributeprofile"> <M2:deviceId= "any"> <m2:functionType= "Name:heartrate"/> </M2:device> </m2:devicecapability></Capabilities>
NEW:
< Capabilities > < Name= "bluetooth"/></capabilities>
22. Delete Windows.contact and Windows.contactpicker extensions
23. Delete Visualelements's Forgroundtext and Toastcapable properties
24. Delete Defaulttitle's DefaultSize property
25. Delete the Applicationview node
26. The manifest file has been modified, save it! Although there seems to be a bit more steps, many of the steps after 17 may not be available
27. Below we need to delete some additional files
- Check the subdirectory under the solution directory "\.vs\{project name}\v14" if there is a ". suo" file, delete it
- Remove all of the suffix. csproj.user files from the project directory
Now our project has been successfully migrated to Universal Windows platform, but for many applications there is still a need to modify code further because many of Windows 10 's APIs have changed.
Migrating win8.1/wp8.1 apps to Universal Windows Platform