简体   繁体   中英

How to change target of visual studio project?

There is a visual studio solution, which is a host-container for react native. There are 7 projects in the solution

  1. ChakraBridge (Universal Windows, C++)
  2. Facebook.Yoga.Shared
  3. ApplicationMobile (Universal Windows, C#)
  4. ReactNative (Universal Windows, C#)
  5. ReactNative.Shared
  6. ReactNativeWebViewBridge (Universal Windows, C#)
  7. yoga.uwp (Universal Windows, c++)

All the projects targeting 14393 version: 在此处输入图像描述

On compile I have lot of errors, that can be grouped in three types:

  1. Predfined type "System.String" is not defined or imported 在此处输入图像描述

  2. Your project does not reference "UAP,Version=v10.0.14393" framework. Add a reference to "UAP,Version=v10.0.14393" in the "TargetFrameworks" property of your project file and then re-run NuGet restore. for ApplicationMobile

  3. Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. for react native

On my machine windows 1809-17663 is installed. I have tried to install the latest WDK, solution failed to build. I have changed the target version to 1809-17663 for all the projects in the solution, the application successfully built and run, however later discovered, that some features work only under 14393. I have installed SDK for 14393, from here https://developer.microsoft.com/en-us/windows/downloads/sdk-archive , but still has all the errors from above. Does somebody know how to build projects targeting 14393 when I am on windows 17663?

to sum up

  1. Download 14393 SDK from https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
  2. Set build target and min version to 14393 for all projects
  3. right-click on the solution -> retarget solution -> set target to 14393
  4. Restart visual studio

details

On my machine windows 1809-17663 is installed. I have tried to install the latest WDK, solution failed to build. I have changed the target version to 1809-17663 for all the projects in the solution, the application successfully built and run, however later discovered, that some features work only under 14393. I have installed SDK for 14393, from here https://developer.microsoft.com/en-us/windows/downloads/sdk-archive , but still has all the errors from the question.

Finally, I have accidentally seen an option in solution properties, retarget solution, on the screen it is disabled because project was running when making a screen.

在此处输入图像描述

  1. Retarget solution to 14393
  2. Restart visual studio
  3. Unload/Load project ApplicationMobile (maybe optional:))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM