gpt4 book ai didi

powershell - 无法从Powershell执行测试

转载 作者:行者123 更新时间:2023-12-02 23:54:28 26 4
gpt4 key购买 nike

我正在与Powershell一起玩耍,并了解如何通过命令行控制Visual Studio,以试图了解开发人员世界的基础。

如果我在命令行中运行

vstest.console "C:\Users\me\source\repos\Test03\UnitTestProject1\bin\Release\UnitTestProject1.dll"

它根据需要执行。

如果我从Powershell运行相同的脚本,我会得到
Starting test execution, please wait...
vstest.console : An exception occurred while invoking executor 'executor://mstestadapter/v2': Access to the path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\TestResults\Deploy_Me
2018-02-08 14_53_12' is denied.
At C:\Users\me\source\repos\Test03\autostageplan.ps1:12 char:1
+ vstest.console "C:\Users\me\source\repos\Test03\UnitTestProjec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (An exception oc..._12' is denied.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

vstest.console已设置为环境变量(如果有影响)。

我读过 An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object

有谁知道为什么会这样吗?

最佳答案

发生错误是因为您没有使用管理员权限运行PowerShell控制台(右键单击PowerShell>以管理员身份运行)。

关于powershell - 无法从Powershell执行测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48688353/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com