个人资料

跳过导航链接首页 > 博客列表 > 博客正文

Unity生成UWP出现错误找不到环境变量VS140COMNTOOLS...等解决办法

:

Exception: Failed to locate env variables VS140COMNTOOLS or VS120COMNTOOLS


找到批处理vcvars.bat文件后运行,即可解决。vcvars.bat文件位置:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd\ext
(根据安装路径不同而略有不同)

错误原因:

VS2017 has reworked its directory structure and filenames. The file is no longer titled "VsVars32.bat", you should look for the file 'vcvars.bat', which can be located in ..\Program Files (x86)\Microsoft Visual Studio\2017\EDITION\Common7\Tools\vsdevcmd\ext\vcvars.bat (using Adam's syntax, replace EDITION with the version of Visual Studio you use).


For simplicity, you can use %VSAPPIDDIR% in your call to point to the IDE folder where devenv.exe is located, and go back one folder to define your path to the batch file. For example:


call "%VSAPPIDDIR%..\Tools\vsdevcmd\ext\vcvars.bat"




songshizhao
最初发表2017/12/21 19:29:01 最近更新2017/12/21 19:29:01 9647
为此篇作品打分
10