Stop visual studio from trying to "Add support for typescript" for every file add
I have a solution with multiple web projects. And there is a common tsconfig
one that is used to build all typescript in the solution. Build is called via webpack
, so I don't need typescript support from visual studio. More precisely, I want some support - in navigation and refactoring, but I don't want VS to generate this code.
So, I removed all references to the typescript target from csproj
and everything works fine. But every time I add a new typescript file, VS happily says
Your project is configured to support typescript
and returns all typescript targets back to csproj.
Can I prevent VS from executing? Of course I can live with it, but removing garbage from csproj after each addition seems awkward.
UPD: Found a post about using VS https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/13420095-ask-to-configure-projects-for-typescript . But maybe a solution is already available. Or you might like this uservoice if you agree it's an annoying problem :)
source to share
Found a solution on uservoice ( https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/13420095-ask-to-configure-projects-for-typescript ).
Seems a little ugly, but it works.
Steps to fix:
- Add some ts file to your project and let VS add some nonsense to your csproj
- ctrl-shift-s to make sure csproj is up to date
- Open csproj in any text editor and then:
- Find the import
Microsoft.TypeScript.Default.props
and replace itCondition="..."
withCondition="false"
- Delete line with
TypeScriptToolsVersion
- Find the import
Microsoft.TypeScript.targets
and replace itCondition="..."
withCondition="false"
- Find the import
Now after adding the file VS will stop trying to do something with the project. And typescript won't compile to save and build, so you need to use gulp / webpack / grunt / whatever.
source to share