terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Move the solution to VS2019 and v142 toolset

Open chunliu opened this issue 7 years ago • 36 comments

As mentioned in README, (also related to #534)

If you're running VS2019, you'll also need to install the "v141 Toolset" and "Visual C++ ATL for x86 and x64"

But actually v141 Toolset is not required in VS2019. The following are the configurations of my VS2019 and I can build the solution successfully.

C++ Desktop development image

UWP development image

Individual components image

To build the solution in VS2019, you need to have:

  • Windows 10 version 1903
  • Windows 10 SDK (10.0.18362.0)
  • VS2019 with C++ Desktop and UWP development workloads, as shown in the above screenshots

And retarget the solution to v142 platform and the latest Windows SDK.

chunliu avatar May 08 '19 06:05 chunliu

git clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule init
git submodule update
nuget restore OpenConsole.sln
msbuild /p:Configuration=Release;AppxBundle=Always;AppxBundlePlatforms="x64" /p:Platform=x64 /p:PlatformToolset=v142 /p:TargetPlatformVersion=10.0.18362.0 /p:PreferredToolArchitecture=x64 OpenConsole.sln

fcharlie avatar May 08 '19 06:05 fcharlie

Consider the README instructions as minimal build environment requirements. And v142 > v141.

Might be, but it's still very misleading. If you have VS 2019, you don't need the v141 tools, because it should install either v141 or v142 by default anyway. My first impression was also that I'd have to install those, too.

MarioLiebisch avatar May 08 '19 07:05 MarioLiebisch

@chunliu consider renaming this issue to "Move to VS2019 and v142 toolset" to be more directed at what is proposed.

timheuer avatar May 08 '19 14:05 timheuer

@fcharlie Did you run in Command Prompt for VS or cmd?

jongio avatar May 08 '19 14:05 jongio

@fcharlie Did you run in Command Prompt for VS or cmd?

If you run tools/razzle.cmd before what @fcharlie runs you can do it in cmd and not need the 'for VS' one (basically sets all the paths just in case)

timheuer avatar May 08 '19 14:05 timheuer

@timheuer if the source solution is moved to VS2019 and v142, people with VS2017 could have problem to build it as v142 toolset might not be installed on VS2017.

I think the proper way to address the building issue of VS2019 is to keep the source solution targeting on VS2017 and v141 toolset, but include the proper instructions for VS2019 and v142 toolset in README. The team can retarget the source solution when they don't need to support VS2017 anymore.

chunliu avatar May 08 '19 15:05 chunliu

@jongio I tried it with VS2019 command prompt and it is working fine. You need to include the path .\dep\nuget\ for nuget command.

chunliu avatar May 08 '19 15:05 chunliu

git clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule init
git submodule update
nuget restore OpenConsole.sln
msbuild /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142 /p:TargetPlatformVersion=10.0.18362.0 /p:PreferredToolArchitecture=x64 OpenConsole.sln

this worked, but how do I deploy? OpenConsole.exe starts old console

snooopcatt avatar May 08 '19 21:05 snooopcatt

@snooopcatt My notebook is too old, I have not tried how to package and deploy it on the command line.

fcharlie avatar May 09 '19 01:05 fcharlie

@snooopcatt the easiest way is to package or deploy it with Visual Studio.

chunliu avatar May 09 '19 02:05 chunliu

@snooopcatt there is a PowerShell script in build/scripts/Create-AppxBundle.ps1. I didn't try it, but maybe you can use it to package the app from command line.

chunliu avatar May 09 '19 12:05 chunliu

图片 I have thousands of "error MIDL2003: [msg]redefinition [context]". I 'm using VS 2019, v142 and SDK 10.0.18362

I can build it using SDK 10.0.17663 and v142

12101111 avatar May 09 '19 15:05 12101111

git clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule init
git submodule update
nuget restore OpenConsole.sln
msbuild /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142 /p:TargetPlatformVersion=10.0.18362.0 /p:PreferredToolArchitecture=x64 OpenConsole.sln

this worked, but how do I deploy? OpenConsole.exe starts old console

Don't you need to press CTRL+T to start a new tab?

Tuumke avatar May 09 '19 17:05 Tuumke

I have a error MIDL2011 [msg]unresolved type declaration [context]: Windows.UI.Xaml.Markup.IXamlMetadataProvider [ RuntimeClass 'TerminalApp.XamlMetaDataProvider' ] TerminalApp F:\GitHub\Terminal\src\cascadia\TerminalApp\x64\Release\XamlMetaDataProvider.idl 6 image

YYYGH avatar May 10 '19 02:05 YYYGH

@YYYGH and @12101111 Did you retarget the solution to the latest Windows SDK and v142 platform in Visual Studio?

chunliu avatar May 10 '19 04:05 chunliu

@YYYGH and @12101111 Did you retarget the solution to the latest Windows SDK and v142 platform in Visual Studio?

thank you! I renew the solution config and is build success. image but can't run WindowsTerminal.exe, is no reaction. windows 10 version: 1803

YYYGH avatar May 10 '19 05:05 YYYGH

@YYYGH to run it, you need Windows 10 1903 with Developer mode on. Then you can right click the solution in VS and choose Deploy Solution.

chunliu avatar May 10 '19 05:05 chunliu

@YYYGH to run it, you need Windows 10 1903 with Developer mode on. Then you can right click the solution in VS and choose Deploy Solution.

Thanks very much!

YYYGH avatar May 10 '19 06:05 YYYGH

git clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule init
git submodule update
nuget restore OpenConsole.sln
msbuild /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142 /p:TargetPlatformVersion=10.0.18362.0 /p:PreferredToolArchitecture=x64 OpenConsole.sln

Thanks!

JushPush avatar May 11 '19 17:05 JushPush

I'm not able to deploy the WindowsTerminal. I'm getting the following error telling me that the deployment target should be running on 10.0.18362.0 or higher image Though, in the project settings, the target SDK is 10.0.17763 image

And I'm sure that my Windows is running that version. image

I'm not sure where is the error coming from!

Backer-Sultan avatar May 12 '19 09:05 Backer-Sultan