问题描述
请帮助,这个项目在Win7中使用VS 2017成功构建。但它在Win10中使用VS2017构建失败。
Please help , This project build successfully in Win7 with VS 2017. But it build fail in Win10 with VS2017.
这是输出,
1> ------构建开始:项目:CLI,配置:调试x64 ------
$
1>从git创建版本头--version dirty
1>文件C:\Users\PaulTsai \Desktop \ sedutil-master \windows \\ .GitVersion.ps1无法加载,因为正在运行的脚本是$
1>在此系统上禁用。有关详细信息,请参阅左
1> https:/go.microsoft.com/fwlink/上的about_Execution_Policies?LinkID = 135170。
1> + CategoryInfo :SecurityError:(:) [],ParentContainsErrorRecordException
1> + FullyQualifiedErrorId:UnauthorizedAccess
1> C:\Program Files(x86)\ Microsoft Visual Studio \\\ 2017 \ Communmunity \Common7 \IDE \VC \ VCTargets\Microsoft。 CppCommon.targets(123,5):错误MSB3073:命令"powershell -NonInteractive -NoProfile -File .. \ GitVersion.ps1 .. \ Version.h·
1> C:\\ \\ Program Program(x86)\ Microsoft Visual Studio \\\ 2017 \ Communmunity \ Common7 \IDE \VC \ VCTargets\Microsoft.CppCommon.targets(123,5):错误MSB3073 :: VCEnd"退出代码1.
$
1>完成构建项目"CLI.vcxproj" - 失败。
==========构建:0成功,1失败,0最新,0跳过==========
1>------ Build started: Project: CLI, Configuration: Debug x64 ------
1>Create version header from git --version dirty
1>File C:\Users\PaulTsai\Desktop\sedutil-master\windows\GitVersion.ps1 cannot be loaded because running scripts is
1>disabled on this system. For more information, see about_Execution_Policies at
1>https:/go.microsoft.com/fwlink/?LinkID=135170.
1> + CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
1> + FullyQualifiedErrorId : UnauthorizedAccess
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(123,5): error MSB3073: The command "powershell -NonInteractive -NoProfile -File ..\GitVersion.ps1 ..\Version.h
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(123,5): error MSB3073: :VCEnd" exited with code 1.
1>Done building project "CLI.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
推荐答案
感谢您在此发帖。
>>> MSB3073 VCEnd退出代码1
>>>MSB3073 VCEnd exited with code 1
当您收到MSB3073错误时,表示您的自定义命令行或构建事件无法正确执行。
When you get the MSB3073 error, it means your custom command line or build event could not be executed correct.
根据错误信息,您的 命令似乎有问题
" powershell -NonInteractive -NoProfile -File .. \\ \\ GitVersion.ps1 .. \ Version.h "。
According to the error info, it seems there is something wrong in your command"powershell -NonInteractive -NoProfile -File ..\GitVersion.ps1 ..\Version.h".
由于您在Windows 10上构建此命令,您应该检查您的.ps1文件,确保它可以在Windows 10上成功执行,例如,某些环境
变量/ 路径与Windows 7不同。
如果您可以直接成功执行此ps.1,那么您应该检查Windows 10上的命令是否正确,为了检查这一点,您可以创建一个测试.ps1文件,然后执行命令"powershell -NonInteractive -NoProfile -File ..\Test.ps1"
If you can executed this ps.1 successfully directly, then you should check if the command is correct on Windows 10, to check this, you can create a test .ps1 file, then executed the command "powershell -NonInteractive -NoProfile -File ..\Test.ps1"
如果可能,请查看以下文档了解一些细节:
如果仍然无法解决此错误,则可以共享您在此处尝试的结果和命令行。希望这会有所帮助。
If you still not resolve this error, you can share the result what you have try and the command line here.Hope this helps.
这篇关于MSB3073 VCEnd退出代码1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!