c# - 任务列表未被识别为内部或外部命令

标签 c# asp.net-mvc visual-studio iis

我已经构建了一个 asp.net MVC 应用程序,该应用程序在源项目所在的同一台计算机上的 IIS 上运行良好。但是,我必须更改源项目中的一些代码,但是当我在 Visual Studio 2013 中启动我的项目时,构建过程运行并失败。它显示以下错误。

1> 'tasklist' is not recognized as an internal or external command,

1> operable program or batch file.

1> C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5): error MSB3073: The command "tasklist /fi "imagename eq iisexpress.exe" |find ":" > nul

1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5): error MSB3073: if errorlevel 1 taskkill /f /im "iisexpress.exe"" exited with code 255.

当我运行此命令 taskkill/f/im iisexpress.exe 时,会出现 no process is found 消息。

你知道是什么原因造成的吗?

最佳答案

根据您当前运行的Windows版本,taskkill确实不包括在内。 如果您认为包含了taskkill,则可能是您的路径设置不正确。 我在 Jenkins 上遇到了同样的问题,但我自己无法管理。

我的解决方案是调整本地 shell 中的路径

set PATH=%PATH%;C:\Windows\System32;

但是,这是针对 .bat 文件的。

对于 C#,我没有方便的解决方案,但这也许可以为您指明正确的方向。

关于c# - 任务列表未被识别为内部或外部命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57157923/

相关文章:

c# - 使用子文件夹的 Asp.net MVC 路由

asp.net-mvc - 为什么visual studio 2012会在mvc项目中自动使用nuget包?

c# - 无法在 Visual Studio 中将 Visual C++ 运行时包引用添加到 Windows Phone 项目

asp.net-mvc - MVC T4 MvcTextTemplateHost和自定义的“ Controller ” T4模板

c# - 动态修改时未更新 Datagridview 单元格值

c# - System.Threading.Timer 回调永远不会被调用

asp.net-mvc - 如何使@Html.EditorFor 不可见?

visual-studio - 对话框中的 Tab 键顺序

c# - 风格警察 SA1638

c# - FormUrlEncodedContent 和查询字符串有什么区别?