Closed ZgblKylin closed 5 years ago
Add some supplements if you encountered many errors in VS2017:
Open CMD.exe, run tools/razzle.cmd, it will set up some environment variables. Notice, it needs to run every time when you opening new CMD.exe window.
Run "git submodule update --init --recursive" to update sub modules.
Run "nuget restore OpenConsole.sln".
Open "OpenConsole.sln" in VS2017, make sure the "x64" or "x86" is selected base don your OS.
Start project should be set to "CascadiaPackage".
Back to CMD.exe window, which razzle.cmd was run above. Then run "msbuild OpenConsole.sln" to start the build. Or run "tools/bcz dbg" to build debug version. MSbuild will not report error but some warnings.
Back to VS2017, right click the solution name and select "Deploy Solution"
After the "Deploy Solution" completes, go to start menu to run "Windows Terminal (Preview)"
git submodule update --init --recursive
Thanks @kbalint I had run it but had run it in the folder above where I ran git clone and I had not cd'd into the Terminal sub-directory. That error is now resolved and trying to build again. Thanks for the help! Robin
Now I am getting this error and now only 7 fail to build so it is progress:
error C3859: Failed to create virtual memory for PCH
Does anyone know how to fix this one?
hi, I have got this error too, I have gooogle it, and get some information. so I closed some app in windows, only leave vs2017 and Chrome, build it again, and everything is ok, build success.
:)
Fair warning: I installed Insider Build a day ago, got this all working, things were fine, nothing intense running, all the sudden the computer just gave me nonstop BSOD, and nothing worked, no system restores, couldn't boot into safemode. Only thing that worked was resetting pc and keeping files, but have to reinstall all software, grumble. Not really sure why it happened, but maybe related.
Some time build project have an error :cann't find file winrt/TerminalApp.h. We need install WinRT C++ library: https://marketplace.visualstudio.com/items?itemName=CppWinRTTeam.cppwinrt101804264
@handyjellyfish I have now managed to get further and am left with just one build error. The problem was that I needed to use a different version of msbuild (noticed the nuget command references this other one) so ran these commands:
mkdir C:\Terminal
cd C:\Terminal
git init
git clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule update --init --recursive
"C:\Terminal\Terminal\dep\nuget\nuget.exe" restore OpenConsole.sln
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\msbuild.exe" OpenConsole.sln
This results in a single error which is:
"C:\Terminal\Terminal\OpenConsole.sln" (default target) (1) ->
"C:\Terminal\Terminal\src\host\exe\Host.EXE.vcxproj.metaproj" (default target) (2) ->
"C:\Terminal\Terminal\src\host\exe\Host.EXE.vcxproj" (default target) (4) ->
"C:\Terminal\Terminal\src\tsf\tsf.vcxproj" (default target) (18) ->
(ClCompile target) ->
c:\terminal\terminal\src\tsf\precomp.h(26): fatal error C1083: Cannot open include file: 'atlbase.h': No such file or
directory [C:\Terminal\Terminal\src\tsf\tsf.vcxproj]
Is there a way to fix this last error then I think I am good to go and maybe the commands above are useful for others as took me a while to figure out.
Thanks @cybercatgurrl now I finally have it working. :) I really wish I could have built it myself but at least now I can try it.
For anyone trying this you need to first install the certificate into the Local Computer Trusted Root Certification Authorities store (by clicking it and picking where you want it to be installed) then the msixbundle should install it.
can't see deploy after building. anyway we can run in cmd?
Do you see the Solution Explorer side menu? If not, then press Ctrl+Alt+L or go to View -> Solution Explorer. At the top of the Solution Explorer, the top most item is: Solution 'OpenConsole' (47 projects). Right click it and choose Deploy Solution from the context menu.
saw it, deployed but got errors.
I have followed the following steps:
- I upgraded to insider build 1903.
- Installed VS2019 Community
- Installed Visual Studio Build Tools 2017 and 2019
- Added:
1. C++ (v142 & v141) Universal Windows Platform tools 2. Windows 10 SDK (10.0.18362.0 & 10.0.17763.0) 3. MSVC v142 & v141 – VS 2019 C++ x64/x86 build tools 4. C++ ATL for v141 & v142 build tools (x86 & x64) 5. C++/WinRT
- Installed WinRT package
- Run:
1. git clone https://github.com/microsoft/Terminal.git 2. git submodule update --init --recursive 3. nuget restore OpenConsole.sln
- Opened Project/Solution from VSCode
- Right-click "Solution 'OpenConsole'" and "Build Solution" => no errors (succeeded)
- Right-click "Terminal -> WindowsTerminal" and Debug -> New Instance
And after all this:
Exception thrown at 0x00007FFB6AF4A839 in WindowsTerminal.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x00000086DA31E808.
I have the same problem as you.
I have followed the following steps:
- I upgraded to insider build 1903.
- Installed VS2019 Community
- Installed Visual Studio Build Tools 2017 and 2019
- Added:
1. C++ (v142 & v141) Universal Windows Platform tools 2. Windows 10 SDK (10.0.18362.0 & 10.0.17763.0) 3. MSVC v142 & v141 – VS 2019 C++ x64/x86 build tools 4. C++ ATL for v141 & v142 build tools (x86 & x64) 5. C++/WinRT
- Installed WinRT package
- Run:
1. git clone https://github.com/microsoft/Terminal.git 2. git submodule update --init --recursive 3. nuget restore OpenConsole.sln
- Opened Project/Solution from VSCode
- Right-click "Solution 'OpenConsole'" and "Build Solution" => no errors (succeeded)
- Right-click "Terminal -> WindowsTerminal" and Debug -> New Instance
And after all this:
Exception thrown at 0x00007FFB6AF4A839 in WindowsTerminal.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x00000086DA31E808.
Edit: I think the team had a reason there's not a binary, it's not ready yet. I think I'll wait till mid June. Have some good sprints!
@Berrysoft still not working, got some errors this time (unfortunately I deleted all repos and tools related with Terminal (40+ gb together with the components installed)
How did you succeed at first time? I even got tons of errors.
I have followed the following steps:
* I upgraded to insider build 1903. * Installed VS2019 Community * Installed Visual Studio Build Tools 2017 and 2019 * Added:
1. C++ (v142 & v141) Universal Windows Platform tools 2. Windows 10 SDK (10.0.18362.0 & 10.0.17763.0) 3. MSVC v142 & v141 – VS 2019 C++ x64/x86 build tools 4. C++ ATL for v141 & v142 build tools (x86 & x64) 5. C++/WinRT
* Installed WinRT package * Run:
1. git clone https://github.com/microsoft/Terminal.git 2. git submodule update --init --recursive 3. nuget restore OpenConsole.sln
* Opened Project/Solution from VSCode * Right-click "Solution 'OpenConsole'" and "Build Solution" => no errors (succeeded) * Right-click "Terminal -> WindowsTerminal" and Debug -> New Instance
And after all this:
Exception thrown at 0x00007FFB6AF4A839 in WindowsTerminal.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x00000086DA31E808.
Edit: I think the team had a reason there's not a binary, it's not ready yet. I think I'll wait till mid June. Have some good sprints!
@Berrysoft still not working, got some errors this time (unfortunately I deleted all repos and tools related with Terminal (40+ gb together with the components installed)
this work, ty
@cybercatgurrl please don't use github threads as a place to redistribute third-party binaries. There's a reason binaries aren't available for download quite yet.
@hereistheusername Try deploying "CascadiaPackage" to run the new terminal. If you're having any build issues arround "Terminal.TerminalSettings", try manually building the TerminalSettings project first. There seems to be some sort of issue with the build order, where it doesn't always build it first.
I'd rather sit and wait for and update rather than download 16 gig worth vstudio
When I used Git bash,I was told
bash:nuget:command not found
How to solve it?
Terminal/dep/nuget. You can find it there, and add the directory to path, or copy it to root directory of the project.
@cybercatgurrl please don't use github threads as a place to redistribute third-party binaries. There's a reason binaries aren't available for download quite yet.
@hereistheusername Try deploying "CascadiaPackage" to run the new terminal. If you're having any build issues arround "Terminal.TerminalSettings", try manually building the TerminalSettings project first. There seems to be some sort of issue with the build order, where it doesn't always build it first.
Ok. I'll try orderly.
Where does one even download Visual Studio 2017? All I can find on Microsoft's site is 2019.
Where does one even download Visual Studio 2017? All I can find on Microsoft's site is 2019.
I've followed the steps, built the solution successfully, but I'm getting this error when I try to deploy: 17>LINK : fatal error C1007: unrecognized flag '-Yu' in 'p2' Anyone else getting the same thing?
Me too.
It absolutely needs to be put into the Readme that you can NOT use Visual Studio 2019, especially since Microsoft is known for making legacy software harder to access (including Visual Studio 2017, which after uninstalling it I still don't know how to re-download).
Using VS2019's update tool doesn't work either.
VS2019 works. We need to retarget the Solution File and Update the Framework to use 4.6 Then Build the Solution. It worked for me
@zadjii-msft I'm really liking the new console and the fact it is open source and we can try out out early in dev and was able to set it up with PowerShell 6, WSL and am SSH'd into my Ubuntu box as I speak. However whilst I am a dev who uses VS 2017/2019 every day I couldn't get this to build whatever I tried so was only able to try it because of the binary that was kindly posted. Could more complete instructions be provided of a single working approach to save everyone running into the same issues if you will not allow binaries to be shared to avoid some of the frustrations?
@zadjii-msft I'm really liking the new console and the fact it is open source and we can try out out early in dev and was able to set it up with PowerShell 6, WSL and am SSH'd into my Ubuntu box as I speak. However whilst I am a dev who uses VS 2017/2019 every day I couldn't get this to build whatever I tried so was only able to try it because of the binary that was kindly posted. Could more complete instructions be provided of a single working approach to save everyone running into the same issues if you will not allow binaries to be shared to avoid some of the frustrations?
@robinwilson16 - after my fun with VS2019 Build Tools I got someone to run it in VS2017 and it was a breeze. These were the steps we took:
As an aside I'd guess that VS2019 would work exactly the same, just need to change the platform toolset to VS2019, but haven't tried it.
I don't think it's quite ready for command line building - you can get it done, but with the self signing of the installer etc etc it's just a bit convoluted.
See #565 for build with VS2019 and from command line.
Quick blogpost about how to build Windows Terminal in Azure Dev-Ops: https://blog.stomsvik.com/posts/2019/terminal-azure-devops/
gotta love github
@robinwilson16
c:\terminal\terminal\src\tsf\precomp.h(26): fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory [C:\Terminal\Terminal\src\tsf\tsf.vcxproj]
you need to install C++ ATL. you can do it via same tool you use to install visual studio
hello. can I download the binary file of you build ? I don`t want to build it . no environment . 😆
@clearcodecn did you manage to get a binary from anybody ?
Does anybody have a link to the binary ? No environment to build on my machines :/
Thank you.
@Remi-Tuy
I got a link from a reddit thread, just installed on an updated Win10 insider VM and it works!
Here's a link (edited: please don’t share binaries) for a build. This is not my build, and you're responsible for any damages that result from installing. From this thread
Any idea why this error:
Any idea why this error:
@vsavic Just had the exact error as you. Retargeted the whole solution to v142, and then manually right clicked TerminalApp
in the Solution Explorer, and then Add->Reference to TerminalSettings
i have added WSL setting in profile.json,but i can't open WLS window.
非常感谢。Windows Terminal我已利用vs2017编译部署成功。
1005268416@qq.com
From: blurredpixel Date: 2019-05-09 23:47 To: microsoft/Terminal CC: l1005268416; Comment Subject: Re: [microsoft/Terminal] Guide for build and installation (#489) @Remi-Tuy I got a link from a reddit thread, just installed on an updated Win10 insider VM and it works! Here's a link for a build. This is not my build, and you're responsible for any damages that result from installing. From this thread ― You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
你如果已经编译成功的话,可以按照以下步骤来安装Windows Terminal: 1.选中CascadiaPackage项目,点击鼠标右键,选择部署,等待其部署成功。
2.部署成功后,开始菜单中就会显示Windows Terminal,启动它就可以了。
3.效果图:ctrl+T 可以打开新标签。
1005268416@qq.com
From: FrancescoPacifico Date: 2019-05-10 03:31 To: microsoft/Terminal CC: l1005268416; Comment Subject: Re: [microsoft/Terminal] Guide for build and installation (#489) Hi, I've succesfully built the solution:
But when I try to deploy it I get this error:
Can you help me getting rid of this? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
I followed the guide and tried to deploy the project, but failed with so many MIDL2003 errors.
My Env: Win 10, SDK 10.0.18362.0 VS2017 Any prerequisites installed I think. I cannot found any issues like mine.
I also tried 10.0.17763.0 in VS2017 but it tells I have to deploy with the 10.0.18362.0. Could anyone can tell me the solution ? I really hope to try this new one.
Even if you need Windows 10 "1903" to run (and possibly other tools installed locally), why not publish the Cascadia package as a build artifact as a last step in the already existing Azure Pipelines CI?
Even if you need Windows 10 "1903" to run (and possibly other tools installed locally), why not publish the Cascadia package as a build artifact as a last step in the already existing Azure Pipelines CI?
Thanks, that may work. I realize that i cannot get os build 1903 , as i am not the insider. just preparing the sdk doesn't solve my problem. (vs only reads the system version 1809 )
Quick blogpost about how to build Windows Terminal in Azure Dev-Ops: https://blog.stomsvik.com/posts/2019/terminal-azure-devops/
Thanks for the tutorial. This seems to be the best way to build since you don't need to install VS2019 or any libs.
Can anybody clarify why the 10.0.18362.0 SDK is needed? will this terminal not run on Windows 10 versions before 1903?
I was excited about the new terminal and tried to build the app in VS but then I learned that you actually need a yet unreleased version of Windows in order to do it...
@sryze Because we depend on features that only shipped in the newest version of Windows, namely certain XAML Islands functionality.
Though this is not an serious issue VS/msbuild shows double slashes in project paths in build output.
If you've managed to deploy once via Visual Studio you can use the devenv.exe to do it smoothly via command-line next time:
devenv .\OpenConsole.sln /Deploy
I'm using posh-vsdev to enter the VS dev environment but you might also just reference that executable directly.
Worked through a few issues but I've got OpenConsole.sln building from the command-line with VS2019 installed. Thanks to @olgaark
You need the following optional Workloads / Components installed:
On the Workloads tab
For x86 / x64 builds (some of the SDKs may not be necessary - I haven't checked)
On the Individual components tab
Then running msbuild.exe OpenConsole.sln
using msbuild.exe from the VS2019 installation should work. This does not require any dev console or use of vcvarsall.bat.
@ZgblKylin You are my hero, thanks! For me, I forgot to change from arm64
to x64
build type. You saved me, thanks again.
Another question, 4.1 & 4.2 are true problems I faced, but why didn't Microsoft fix them? Okay, I see the PRs you mentioned, hope they will be merged or resolved someday!
========== Build: 0 succeeded, 45 failed, 2 up-to-date, 0 skipped ==========
You forgot to change the architecture. Right next the "Debug" dropdown (next to the redo button) you should change the architecture to your own system. I initially thought to myself there's no way I'll get it working :P
I am currently running Windows 1903, Build 18334.19h1 , but i have set the target version to 18362, as i had downloaded 10.0; Build 18362. SO now should i be upgrading my windows or is there a workaround ?
How do I do this in the "Terminal" folder which doesn't exist as a folder in the console?
Run git submodule update --init --recursive in Terminal folder
I can however find the CascadiaPackage folder.
I managed to run this command in the CascadiaPackage folder and yet I still get errors "wil/Common.h: No such file or directory"
This is how it worked for me:
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock /v AllowDevelopmentWithoutDevLicense /d 0 /t REG_DWORD /f
.NET desktop
, UWP
, C++ Desktop
rolesindividual components
, also select all C++ v142
components, C++ ATL support
and the Windows 10 SDK 10.0.18362.0
C++/WinRT
extension from https://marketplace.visualstudio.com/items?itemName=CppWinRTTeam.cppwinrt101804264nuget.exe
and place it in a folder that is part of the PATH env var (i.e. c:\windows\system32
)
https://www.nuget.org/downloadsgit clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule update --init --recursive
nuget restore OpenConsole.sln
OpenConsole.sln
in Visual Studio 2019. Switch the configuration (in the menu bar) to Release
/ x64
.Solution explorer
on the right, right-click on the CascadiaPackage
project and select Deploy
. This builds all required projects and, if successful, installs the UWP app in Windows.Result: There's a new start menu entry Windows Terminal (Preview)
@christian-korneck Thank you for the steps. All worked up until the Deploy step.
========== Build: 21 succeeded, 4 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Severity Code Description Project File Line Suppression State Error C1007 unrecognized flag '-Yu' in 'p2' TerminalControl C:\Terminal\src\cascadia\TerminalControl\LINK 1
Error LNK1257 code generation failed TerminalControl C:\Terminal\src\cascadia\TerminalControl\LINK 1
Error MIDL2011 [msg]unresolved type declaration [context]: Microsoft.Terminal.Settings.KeyChord [ Parameter 'chord' of Procedure 'SetKeyBinding' ( RuntimeClass 'TerminalApp.AppKeyBindings' ) ] TerminalApp C:\Terminal\src\cascadia\TerminalApp\AppKeyBindings.idl 62
Error MIDL2011 [msg]unresolved type declaration [context]: Microsoft.Terminal.Settings.IKeyBindings [ RuntimeClass 'TerminalApp.AppKeyBindings' ] TerminalApp C:\Terminal\src\cascadia\TerminalApp\AppKeyBindings.idl 59
Error C1083 Cannot open include file: 'winrt/TerminalApp.h': No such file or directory WindowsTerminal C:\Terminal\src\cascadia\WindowsTerminal\AppHost.h 7
Error C1083 Cannot open include file: 'winrt/TerminalApp.h': No such file or directory WindowsTerminal C:\Terminal\src\cascadia\WindowsTerminal\AppHost.h 7
Error C1083 Cannot open include file: 'winrt/TerminalApp.h': No such file or directory WindowsTerminal C:\Terminal\src\cascadia\WindowsTerminal\IslandWindow.h 7
Error C1083 Cannot open include file: 'winrt/TerminalApp.h': No such file or directory WindowsTerminal C:\Terminal\src\cascadia\WindowsTerminal\IslandWindow.h 7
Error Specified EntryPointExe 'WindowsTerminal.exe' was not found in the project outputs. CascadiaPackage C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\DesktopBridge\Microsoft.DesktopBridge.targets 413
Here is what I get on building. I've tried everything mentioned above, but couldn't find solution to it. Can anybody check it out and see what should be done?
“wil/Common.h”: No such file or directory how is this error resolved???
Run git submodule update --init --recursive in Terminal folder Run nuget restore OpenConsole.sln (This step can be skipped, then Visual Studio should warn you that there are packages to restore - then restore)
I found that these steps didn't work for me when I downloaded the ZIP file. It's better to just clone it using git clone, then use those steps. Hopefully this helps someone who might have run into the same problem that I did :D
“wil/Common.h”: No such file or directory how is this error resolved???
You should try cloning the repository again via git clone (not downloading the ZIP file). Then you run these two commands within the Terminal directory:
git submodule update --init --recursive
Then, change directory into dep/nuget
Then, run: > nuget restore OpenConsole.sln
TIP: you may also try >nuget restore (path to openconsole sln) if nuget isn't in your PATH (which it probably isn't). Just remember to be in the nuget directory.
Hope this helps!
Tools needed
Desktop Development with C++
. 1.2Universal Windows Platform Development
. 1.3Windows 10 SDK (10.0.18362.0)
. 1.4 If you're running VS2019, you'll also need to install eitherv141 Toolset
orv142 Toolset
.Terminal/dep/nuget
).Build Steps
git clone
this repository, not download .zip file.git submodule update --init --recursive
in Terminal folder.nuget restore OpenConsole.sln
(This step can be skipped, then Visual Studio should warn you that there are packages to restore - then restore).OpenConsole.sln
with Visual Studio.x86
/x64
) andrelease
mode, you may need to fix some build errors: 5.1 C2220 and code page warnings: All errors and warnings are encoding error of unicode characters, a helpful workaround is to modify corresponding file encoding toUTF-8 BOM
(Notepad++ is recommended). 5.2 Errors insrc/tools/vtpipeterm/main.cpp
: In addtion, you should also addu8
prefix before string literals with unicode characters, e.g. line395
,398
,401
and404
.Workaround
Try build with PR 458 or PR 549, both of them can build successfully.
Installation
Unfortunately, the generated .appx doesn't have any certificates, so it cannot be installed via double-click or powershell, the only way to install is to deploy the solution in VS.
Windows Settings
-Upgrade & Security
-For Developers
, switchApp sources
toDeveloper mode
.CascadiaPackage
project (underSolution/Terminal
), selectDeploy Solution
to install, then you'll findWindows Terminal (Preview)
in start menu.Settings
After open the terminal, you can't see any menu buttons.
Just press
Ctrl + T
to open a new tab, and you'll see a drop-down button in the tab bar.Click it and select
Settings
, then you can modify the configuration via openedprofiles.json
.Add WSL
profiles
, with content copied fromprofiles/cmd
.guid
.name
, such asWSL
.commandline
towsl.exe
.Then you'll find
WSL
in the drop-down menu of tab bar.Here're sample codes: