问题描述
我从VS 2017(在我的文档文件夹中)使用Angular创建了一个空白的新ASP.Net Core(我位于文档文件夹中),我尝试构建它,但总是收到此错误: VS2017错误
i create a blank new ASP.Net Core with Angular from VS 2017 (in my Document folder) and i try to build it i always get this error:VS2017 Error
如果我创建一个没有Angular的空白新asp.net,它将正常工作.
If i create a blank new asp.net without Angular it works fine.
在某种程度上cmd.exe出现错误,但是我不知道为什么.cmd.exe的路径正确,已以管理员权限启动了VS,已安装notejs,打开.cspoj第33行(输出TaskParameter ...)并执行命令.
It somehow has a error with the cmd.exe but i cant figure out why. The path to the cmd.exe is correct, launched VS with administrator privileges, notejs is installed, opening the .cspoj Line 33 (output TaskParameter...) and executing the command works too.
<Exec Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
推荐答案
在CMD中手动执行以下命令(来自.csproj)后,在构建和重建时不再出现错误.
After executing the following command manually in the CMD (from the .csproj) the error didnt come anymore while building, rebuilding.
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
....
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
<Exec Command="node node_modules/webpack/bin/webpack.js" />
</Target>
这篇关于VS 2017 + ASP.Net Core +无法构建Angular 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!