7

I am getting a Warning in the Error List of Visual Studio when building my TypeScript project.

The TypeScript Compiler was given an empty configurations string, which is unusual and suspicious.

2 Answers 2

9

This is caused when this line ...

<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />

... precedes these PropertyGroup sections in the .csproj file.

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
  <TypeScriptTarget>ES5</TypeScriptTarget>
  <TypeScriptRemoveComments>false</TypeScriptRemoveComments>
  <TypeScriptSourceMap>true</TypeScriptSourceMap>
  <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
  <TypeScriptTarget>ES5</TypeScriptTarget>
  <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
  <TypeScriptSourceMap>false</TypeScriptSourceMap>
  <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
</PropertyGroup>
Sign up to request clarification or add additional context in comments.

1 Comment

Keep in mind that if you have extra build configurations in your project, these settings could be missing from those build configurations. It took me a few minutes to realize this.
1

For some reason, the typescript properties mentioned in NYCDotNet's answer were entirely missing for my property group sections.

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
blah
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
blah
</PropertyGroup>

Adding them as per NYCDotNet fixed it.

Note

  • I didn't have this problem in VStudio but when executing MSBuild from the command line.
  • Typescript V0.9

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.