Skip to content

Is there a reference implementation of tsconfig.json being used in Visual Studio? #6504

Closed

Description

This is probably related to #6317 but not exactly the same.

Having not used Visual Studio for a while I've just come back to it and been trying to use tsconfig.json in a standard ASP.Net MVC 5 project. For reasons that aren't clear to me the tsconfig.json doesn't appear to be being detected by Visual Studio in the way I would hope. There doesn't appear to be a reference implementation that I can refer to of how tsconfig.json should look in a Visual Studio project. Here's my assumptions / experiences:

  • tsconfig.json is included with a Build Action of "Content" and a Copy to Output Directory of "Do not copy"
  • tsconfig.json can sit in the root of the Visual Studio project (alongside package.json etc)
  • you can't stop Visual Studio forcing these options upon your csproj:
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptJSXEmit>None</TypeScriptJSXEmit>
    <TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>
    <TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
    <TypeScriptModuleKind>None</TypeScriptModuleKind>
    <TypeScriptRemoveComments>False</TypeScriptRemoveComments>
    <TypeScriptOutFile />
    <TypeScriptOutDir />
    <TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
    <TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
    <TypeScriptSourceMap>False</TypeScriptSourceMap>
    <TypeScriptMapRoot />
    <TypeScriptSourceRoot />
  </PropertyGroup>

It's non-negotiable; you take them out it'll put them right back in next time you edit your project properties in VS.

I've kind of given up on tsconfig.json in Visual Studio now as I think I'm somehow missing the point. It would be great if there was an example implementation to refer back to. I notice that there doesn't seem to be a File -> New Project experience for tsconfig.json which is a shame.

Activity

  1. changed the title [-]Reference implementation of tsconfig.json being used in Visual Studio[/-] [+]Is there a reference implementation of tsconfig.json being used in Visual Studio?[/+] on Jan 15, 2016
  2. paulvanbrenk commented on Jan 15, 2016

    @paulvanbrenk
    Contributor

    Your second assumption is incorrect, tsconfig.json has to be in a scripts folder, and can't be in the root at this time.

    More info see the Using TypeScript With ASP.NET 5.

  3. johnnyreilly commented on Jan 15, 2016

    @johnnyreilly
    Author

    Thanks Paul van Brenk (@paulvanbrenk) - I'll give it a try. This guide is for ASP.Net 5 project types - I assume that old school projects (pre-ASP.Net 5) will work as well?

  4. paulvanbrenk commented on Jan 19, 2016

    @paulvanbrenk
    Contributor

    No, this only works in ASP.NET 5 for now.. we're planning on making changes in the next public release of TypeScript to support more project types.

  5. johnnyreilly commented on Jan 19, 2016

    @johnnyreilly
    Author

    Thanks Paul van Brenk (@paulvanbrenk) - so part of TypeScript 1.8?

  6. paulvanbrenk commented on Jan 19, 2016

    @paulvanbrenk
    Contributor

    John Reilly (@johnnyreilly) Yes, that's the plan.

  7. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions