I'm using TypeScript in new ASP.NET core project type.
We actively use decorators.
Unfortunately, that causes lot of errors in VS2015 output:
Error TS1219 Experimental support for decorators is a feature that is subject to change in a future release.
Specify '--experimentalDecorators' to remove this warning.
WebApplication2 d:\documents\visual studio 2015\Projects\WebApplication2\src\WebApplication2\wwwroot\sources\app.ts 9 Active
That is quite simple to get rid of these error messages in regular ASP.NET projects modifying *.csproj
file.
But ASP.NET Core project does not use .csproj
, it uses .xproj
instead.
So, how to allow experimental TypeScript decorators support in VS2015 in ASP.NET Core project?
You may find simplest project which reproduces the problem in sample github rep
Add
> New Item
. Client-side
from
the left hand menu. TypeScript JSON Configuration File
. Leave it as the default name of tsconfig.json
.tsconfig.json
. In the complierOptions
section, add "experimentalDecorators": true
. "wwwroot"
from the "exclude"
section.Here is my tsconfig.json
file for completeness:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"experimentalDecorators": true
},
"exclude": [
"node_modules"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With