"Win 10 Application Development" RTM version of UAP project anatomy

Source: Internet
Author: User

After Windows 10 was released, the SDK was secretly appearing in the Custom installation list of VS, and today the Dev Center has also updated the download. The official version of the SDK in the API structure and the previous preview is the same, but the version becomes 10240, so we do not ask the old week what the new API.

Although the API has not changed, the application project in VS has changed. After all, is the preview, and now is the "Regular Army", used to use the potato gun when training, and now is real thing dry, so the application project is a change.

I used to talk to you about the changes to the project template, the method of removing the Telemetry class library is only for the preview version, and now we do not need to do so, when you create a new project, you can choose whether you need telemetry in the New dialog box. Such as.

If I didn't enable telemetry while I was creating a project, and the project was created, then I wanted to add telemetry. Easy, just right click on the project name and select "Add Application Insights Telemetry ..." menu.

Let's look at another focus of the application project-the reference.

Some people will ask, what good-looking, to play. NET who do not know. Don't worry, this time the UAP project is quoted in a more interesting way. Look first.

Have you noticed anything different? First of all, there must be universal Windows this generic API collection, this is the same as before, I remember to introduce you to the win API collection is through the API protocol to archive, remember? Do not remember even if, does not affect you to write code.

In addition to the UAP-API provided by the UWP platform, we know that there is another one. NET class Library set, but everyone notices the name, now is not called. NET for Windows Store app, now called. NET Core for Universal Windows platform. Someone asked, is there a difference, not a change of name. Of course not that simple, this new. NET Core version number is 5.0, formerly 4.5. Of course this is not the key, the key is that there is a. NET type that was not previously available, but it is now available. Like this: System.IO.IsolatedStorage.

Of course, most of them are the same, but the Windows app is forced to compile into native code, and it's estimated that this new core is for this purpose. It doesn't affect us writing code anyway.

However, I would like to say, is to let everyone carefully observe the above, there is no discovery Microsoft.NETCore.UniversalWindowsPlatform This reference icon comparison of the alternative? Its icon is different from other references.

If you double-click it now, you cannot view it in the Object Browser.

However, you can view it in the Object Browser by selecting ". NET for Windows Universal".

Why does the guy have such a personality, and the icons are different? Have you noticed that there is a file called Project.json in the project, which is in JSON format and you will have a surprise after opening it.

{  "dependencies": {    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"  },   "Frameworks": {    "uap10.0": {}  },  "runtimes": {    " Win10-arm ": {},    " Win10-arm-aot ": {},    " Win10-x86 ": {},    " Win10-x86-aot ": {},    " win10-x64 ": {},    " Win10-x64-aot ": {}}  }

Seeing the above, you understand why the. NET for UWP reference icon is different. This is not obvious, this reference is configured through this JSON file.

Take a closer look, you will also find that this Project.json file generation operation is none, not copied.

Mean, this guy is dispensable, so, we put this project.json from the project, attention is excluded, not delete, do not hurry to remove, otherwise you will regret.

After you exclude this JSON file, you generate the project again, success, no error.

Next, you go to the folder where the project is located, delete that Project.json file (there is also a Project.lock.json also delete), just put in the Recycle Bin, remember!

Then, re-generate the project, and you'll find the disaster is imminent.

As you can see, the. NET for UWP Reference is described by this JSON file, but this file does not have to be included in the project as long as it is in the project directory.

After my follow-up experiment found that:

1, Project.json and Project.lock.json exist at the same time, the compilation is normal.

2, Project.json Delete, project.lock.json exist, compile normal.

3, Project.json exist, Project.lock.json exist, compile normal.

4, as long as project.json exist that can be compiled successfully, will automatically generate Project.lock.json files.

5, if Project.json and Project.lock.json are not present, compile error. and the. NET for UWP is missing from the list of references in the project.

As for the specific role of this project.json, or until the official reference document is perfect before you know. But from the above test, this JSON should be used to describe the. NET for UWP reference.

Of course, we actually develop, you can ignore this file, or write code is OK.

"Win 10 Application Development" RTM version of UAP project anatomy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.