NYCdotNet
NYCdotNet

Reputation: 4647

TypeScript Compiler was given an empty configurations string

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.

Upvotes: 7

Views: 1990

Answers (2)

fiat
fiat

Reputation: 15981

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

Upvotes: 1

NYCdotNet
NYCdotNet

Reputation: 4647

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>

Upvotes: 9

Related Questions