We are building an ASP.NET Core solution and we recently added a NodeJS project to that solution. Now when we run CI it gives this error:
error MSB4019: The imported project "/usr/share/dotnet/sdk/3.1.201/Microsoft/VisualStudio/v16.0/Node.js Tools/Microsoft.NodejsToolsV2.targets" was not found. Confirm that the expression in the Import declaration "/usr/share/dotnet/sdk/3.1.201/Microsoft/VisualStudio/v16.0/Node.js Tools/Microsoft.NodejsToolsV2.targets" is correct, and that the file exists on disk.
Which makes sense since we are not installing the 'NodeJS Tools' at any point, but we cant find how to install those tools. How do you install the NodeJS Tools with the dotnet cli?
The dotnet CLI cannot build these projects as the tools required for these are part of Visual Studio and not the .NET Core distribution or a workload supported by the .NET Sdk.
While you can still use the dotnet CLI on .NET Core/Standard csproj files, you cannot use it on solution files containing projects not supported by the CLI.
You can, however, use the msbuild.exe from your Visual Studio installation on all projects (suggest using the VS Developer Command Prompt), e.g:
dotnet build foo.sln => msbuild -restore foo.sln
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With