使用TypeScript装饰器会导致错误
发布时间:2020-12-15 19:51:14 所属栏目: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 '--experimen
我在新的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 3 JSON模型绑定无法正常工作
- asp.net – 为什么我要将UnitOfWork与Repository Pattern一
- asp.net – 过程或函数’xyz’指定了太多参数
- ASP.NET MVC3 Controller或Model中虚拟路径的根相对路径
- asp.net-mvc – 视图模型和数据传输对象之间的区别是什么?
- 从ASP.NET网站将查询结果发送到Excel
- asp.net – 无法将参数值从字符串转换为guid
- asp.net-mvc – jqGrid中的日期选择器,简单的例子?
- asp.net – Webservice方法返回XmlDocument,Reference看到一
- asp.net – 移动浏览器设备检测在.NET
推荐文章
站长推荐
- asp.net – 如何正确使用RegisterForEventValida
- asp.net-core-mvc – 创建多个dbcontexts的MVC 6
- asp.net-mvc – 将依赖项注入自定义模型绑定器并
- asp.net – 内联JavaScript的外部JavaScript文件
- asp.net-mvc – Full-Stack Web应用程序框架的定
- .net – 如何组织资源文件?
- .net – SqlMembershipProvider与自定义解决方案
- asp.net – 使用CompareValidator控件将用户输入
- asp.net-mvc-3 – 提交后的mvc3复选框值
- asp.net c#中的最佳Audit Trail流程?
热点阅读