2

I am using Angular 2 in Visual Studio 2015, inside of an asp .net 4.5 project. When I build and run the project, JavaScript files are created correctly. However, if I make any changes to the TypeScript and recompile, the JavaScript isn't being overwritten. The only way I can get the TypeScript to recompile is by deleting the previous JS file.

2 Answers 2

0

I would first suggest opening Visual Studio as Administrator to see if it is a permissions issue, whereby VS2015 cannot overwrite your JS files.

Otherwise, right click on the project in your solution (not the solution itself) and select Properties.

You should have a tab called TypeScript Build as shown in the screenshot below. Ensure that you have Compile on Save checked.

VS2015 Project Properties - TypeScript Build

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your help. What we had to do to get this working is add "compileOnSave": true to tsconfig.json.
0
"compileOnSave": true 

must be added to tsconfig.json.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.