85227

Make VS2015 use angular-cli ng at build time in a .NET project

I open a clearer question.

How is it possible on precompile script in a .NET project, to make VS2015 build the Angular2-cli project with angular-cli tools (ng) installed globally via npm.

Steps: - npm install -g angular-cli - In our .NET project under VS2015, on F5 (build) we need ng build to be called.

We tried:

"precompile": [ "npm install -g angular-cli", "npm install", "ng build --prod" ],

But I encounter errors on VS2015 console. Full logs: http://pastebin.com/RMiU6eMe

VS2015 doesn't seem to manage to use globally installed ng command.

I tried in our script to call directly the ng tool installed locally as declared in our package.json via npm install:

"precompile": [ "npm install", "node_modules/angular-cli/bin/ng build --prod" ],

But VS2015 answers as below:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : The specified executable is not a valid application for this OS platform.

I don't want to have to run separately from command line ng build (which works by the way...) BEFORE being able to build on VS2015.

Answer1:

Add a command "build": "ng build", in your package.json, then, instead of trying to run the ng build, just run the npm build.

You can also add this to your package.json to bundling it each time you build your solution.

"-vs-binding": { "BeforeBuild": [ "build" ] }

Recommend

  • CXF JAVA message Truncated
  • Visual Studio 2012 doesn't build project on run when its dependencies change
  • Special tensor contraction in Python
  • Aggregating based on “near” row values
  • reactive updates in shiny app selectInput and radioButtons - ggvis
  • android: disable opengl ES context switch upon device rotation
  • Cannot debug project after upgrading to Service Fabric SDK v2.3.301
  • How to prepare a C++ string for sql query
  • mail server requires authentication when attempting to send to a non-local e-mail address when using
  • android-support-v7-appcompat has same attrs as actionbarsherlock library
  • Run script file on remote server
  • Checking a play current mode makes an error occur
  • ASPNetCore MVC Routing Let Server Handle Specific Route
  • How do I import an existing Grails 3 (3.0.12) project in IntelliJ 15
  • OSX - always hide certain files
  • Compiling dlib on OS X
  • Low TTL with Leveled Compaction, should I reduce gc_grace_seconds to improve read performance withou
  • Web.config system.webserver errors
  • How to generate and display a QR Code in ionic 2
  • Sequential (transactional) API calls in angular 4 with state management
  • How to revert to previous XCode version?
  • Access Android Market through SSH tunnel
  • print() is showing quotation marks in results
  • Android fill_parent issue
  • Debugging ASP.NET on a built-in web server suddenly stops
  • Jenkins: How To Build multiple projects from a TFS repository?
  • How do I fake an specific browser client when using Java's Net library?
  • Get object from AWS S3 as a stream
  • Where to put my custom functions in Wordpress?
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • Upload files with Ajax and Jquery
  • Why winpcap requires both .lib and .dll to run?
  • Apache 2.4 - remove | delete | uninstall
  • How to pass list parameters for each object using Spring MVC?
  • Numpy divide by zero. Why?
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Proper way to use connect-multiparty with express.js?
  • How to set the response of a form post action to a iframe source?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • unknown Exception android