Visual Studio 2022: Experimental support for decorators is a feature that is subject to change in a future release

huangapple go评论54阅读模式
英文:

Visual Studio 2022: Experimental support for decorators is a feature that is subject to change in a future release

问题

我无法在Visual Studio 2022中构建Angular应用程序。

我收到了下一个错误:

TS1219 Build:对装饰器的实验性支持是一个可能在将来的版本中更改的功能。请在您的'tsconfig'或'jsconfig'中设置'experimentalDecorators'选项以移除此警告。

有人知道如何解决这个问题吗? experimentalDecorators 已设置为false,但没有帮助。

英文:

I am unable to build an angular application in Visual Studio 2022

I receive the next error:

TS1219	Build:Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.

Does anybody know how to fix this issue? experimentalDecorators set to false, but it didn't help.
Visual Studio 2022: Experimental support for decorators is a feature that is subject to change in a future release

答案1

得分: 1

错误已通过将以下行添加到csproj文件中来修复:

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
  <TypeScriptModuleKind>commonjs</TypeScriptModuleKind>
  <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
</PropertyGroup>
英文:

The errors were fixed by adding the next lines into the csproj:

  &lt;PropertyGroup Condition=&quot;&#39;$(Configuration)&#39; == &#39;Debug&#39;&quot;&gt;
    &lt;TypeScriptModuleKind&gt;commonjs&lt;/TypeScriptModuleKind&gt;
   &lt;TypeScriptExperimentalDecorators&gt;true&lt;/TypeScriptExperimentalDecorators&gt;
  &lt;/PropertyGroup&gt;

huangapple
  • 本文由 发表于 2023年7月18日 00:26:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76706423.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定