使用TypeScript装饰器会导致错误
发布时间:2020-05-27 15:36:20 所属栏目:asp.Net 来源:互联网
导读:我在新的ASP.NET核心项目类型中使用TypeScript. 我们积极使用decorators. 不幸的是,这会导致VS2015输出中的大量错误: Error TS1219 Experimental support for decorators is a feature that is subject to change in a future release.Specify --ex
|
我在新的ASP.NET核心项目类型中使用TypeScript. 我们积极使用decorators. 不幸的是,这会导致VS2015输出中的大量错误: 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:documentsvisual studio 2015ProjectsWebApplication2srcWebApplication2wwwrootsourcesapp.ts 9 Active 这很容易摆脱这些错误消息in regular ASP.NET projects修改* .csproj文件. 但ASP.NET Core项目不使用.csproj,而是使用.xproj. 那么,如何在ASP.NET Core项目中允许VS2015中的实验性TypeScript装饰器支持? 你可能会找到最简单的项目来重现问题in sample github rep 解决方法>右键单击您的项目>添加>新物品.>从中挑选客户端 左手菜单. >添加新的TypeScript JSON配置文件.将其保留为tsconfig.json的默认名称. >打开tsconfig.json.在complierOptions部分中,添加“experimentalDecorators”:true. >从“排除”部分删除“wwwroot”. >建立和享受. 这是我的tsconfig.json文件的完整性: {
"compilerOptions": {
"noImplicitAny": false,"noEmitOnError": true,"removeComments": false,"sourceMap": true,"target": "es5","experimentalDecorators": true
},"exclude": [
"node_modules"
]
} (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.NET MVC – 在何处放置数据库查询
- asp.net-membership – 成员资格超时和会话超时
- asp.net – DropDownList的EditorTemplate
- asp.net – IIS7:禁用子应用程序中的HttpModule – 站点,应
- asp.net-mvc-4 – 在IIS 7.5中注册.NET Framework 4.5
- 具有匹配客户端和服务器端标记的ASP.NET页面的选项?
- asp.net-web-api – owin cors或web api cors
- asp.net – Response.End()和Response.Flush()之间的差异
- asp.net-mvc – 使用Visual Studio进行调试,ASP.NET MVC上的
- ASP.NET MVC中是否有嵌套主页?
