You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何Visual Studio不将我的WebTest项目识别为测试项目?

Visual Studio无法识别负载测试项目问题排查

我尝试打开一个负载测试时,弹出如下提示(截图):
负载测试项目识别错误提示

但这确实是测试项目,为何Visual Studio不将其识别为测试项目?


更新1:修正csproj文件导入路径错误

发现csproj文件中有两条导入语句路径不正确,已完成修正,相关代码片段如下:

…
  <Import Condition="Exists('..\packages\MSTest.TestAdapter.2.2.4\build\net45\MSTest.TestAdapter.props')" Project="..\packages\MSTest.TestAdapter.2.2.4\build\net45\MSTest.TestAdapter.props">
  </Import>
…
  <Import Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets">
  </Import>
…
  <Import Condition="Exists('..\packages\MSTest.TestAdapter.2.2.4\build\net45\MSTest.TestAdapter.targets')" Project="..\packages\MSTest.TestAdapter.2.2.4\build\net45\MSTest.TestAdapter.targets">
  </Import>
…

更新2:确认测试项目类型配置

测试项目类型已设置为WebTest,配置看起来正确,代码片段如下:

…
    <TestProjectType>WebTest</TestProjectType>
…

内容的提问来源于stack exchange,提问作者Martin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 05:24:10