ASP.NET Core系统找不到指定的文件 [英] ASP.NET Core The system cannot find the file specified
问题描述
我已遵循此有关如何使angular和ASP.NET Core一起运行的教程.初始构建工作正常,但是在更新角度包之后,我在启动应用程序时收到以下错误(我还必须在此过程中重新安装nodejs,不确定是否与此相关):
I have followed this tutorial on getting angular and ASP.NET Core running together. The initial build worked fine but after updating angular packages I am receiving the following error on startup of the application(I also had to reinstall nodejs in the process, not sure if this is related):
错误在以下行:
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
HotModuleReplacement = true
});
该错误本身并未为我提供任何有用的信息来查找问题.
The error itself does not provide me with any usefull information to track down the issue.
我得到一个:
System.AggregateException =>计数=错误CS0103:名称 当前上下文中不存在"InnerExceptionCount"
System.AggregateException => Count = error CS0103: The name 'InnerExceptionCount' does not exist in the current context
在InnerExceptions下,它列出了以下错误:
Under InnerExceptions it lists the following error:
System.ComponentModel.Win32Exception:系统找不到文件 在System.Diagnostics.Process.StartCore(ProcessStartInfo)中指定 startInfo)位于System.Diagnostics.Process.Start()处 System.Diagnostics.Process.Start(ProcessStartInfo startInfo)位于 Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo) Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(字符串 entryPointScript,字符串projectPath,字符串[] watchFileExtensions, 字符串commandLineArguments,ILogger nodeOutputLogger,IDictionary2 environmentVars,Int32调用超时毫秒,布尔值 launchWithDebugging,Int32 debuggingPort),位于 Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(字符串 projectPath,字符串[] watchFileExtensions,ILogger nodeInstanceOutputLogger,IDictionary2环境变量,Int32 invocationTimeoutMilliseconds,布尔值launchWithDebugging,Int32 debuggingPort,Int32端口) Microsoft.AspNetCore.NodeServices.NodeServicesFactory.CreateNodeInstance(NodeServicesOptions 选项) Microsoft.AspNetCore.NodeServices.NodeServicesFactory.<> c__DisplayClass0_0.b__0() 在 Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance() 在 Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance() 在 Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__10`1.MoveNext()}
System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(String entryPointScript, String projectPath, String[] watchFileExtensions, String commandLineArguments, ILogger nodeOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort) at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(String projectPath, String[] watchFileExtensions, ILogger nodeInstanceOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort, Int32 port) at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.CreateNodeInstance(NodeServicesOptions options) at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.<>c__DisplayClass0_0.b__0() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__10`1.MoveNext()}
如果有人可以向我指出从错误中获取更多信息的方向,将会很有帮助.
If someone can point me in the direction to get more information from the Error would be helpful.
推荐答案
似乎无法找到node.exe.第一次安装Node之后,我看到了相同的错误.这是因为安装Node会修改系统路径,而IIS不会获取新路径.我必须重新启动服务器,然后它才能找到节点exe.
It looks like it is unable to find node.exe. I saw the same error after installing Node for the first time. It was because installing Node modified the system Path and the new Path wasn't getting picked up by IIS. I had to reboot my server and it was then able to find the node exe.
这篇关于ASP.NET Core系统找不到指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!