简体   繁体   English

Visual Studio 2017 TypeScript无法保存

[英]Visual Studio 2017 TypeScript fails to save

I have never used TypeScript before and so perhaps I am misunderstanding how to use it. 我以前从未使用过TypeScript,所以也许我误会了如何使用它。 I right click and say new create a xxx.ts file, I write some code in it and click save. 我右键单击并说新建一个xxx.ts文件,我在其中编写了一些代码,然后单击保存。 Clicking save tries to make the new file dialog pop up, and it says that there is already a TypeScript file present, I close the dialog and try again and VS 2017 crashes. 单击“保存”会尝试弹出新文件对话框,并说已经存在一个TypeScript文件,我关闭对话框后再试一次,VS 2017崩溃。 I am sorry for the brief amount of information. 抱歉,请您提供简短的信息。 However it is as simple as that, I create a new ts file write some code attempt to save and it thinks I created a new file. 但是就这么简单,我创建了一个新的ts文件,并写了一些代码尝试保存,并认为我创建了一个新文件。

Also I notice that after a fresh boot of VS I can save my typescript files, although after about a few minutes this create a new file behavior starts. 我还注意到,在VS全新启动后,我可以保存我的打字稿文件,尽管大约几分钟后,创建新文件的行为开始了。

Another odd problem is opening a folder with the file explorer that has a .ts file in I cannot right click the .ts file. 另一个奇怪的问题是,使用文件浏览器打开的文件夹中有一个.ts文件,我无法右键单击.ts文件。 Doing so crashes Windows explorer. 这样做会使Windows资源管理器崩溃。

I am a clean install of Windows 10, just did a reset. 我是Windows 10的全新安装,只是进行了重置。 Only installed VS 2017 and SQL Server 2016. 仅安装VS 2017和SQL Server 2016。

Something visual: 视觉的东西: 尝试保存app.module.ts

Update Instead of removing the KB mentioned below, install this one which fixes the bug introduced by KB4013429: http://www.catalog.update.microsoft.com/Search.aspx?q=KB4015438 更新而不是删除下面提到的KB,请安装此更新来解决KB4013429引入的错误: http : //www.catalog.update.microsoft.com/Search.aspx? q = KB4015438


I have the same problem with Intellij Idea. 我对Intellij Idea有同样的问题。 I suspect that https://support.microsoft.com/en-us/help/4013429/windows-10-update-kb4013429 could have something in common. 我怀疑https://support.microsoft.com/en-us/help/4013429/windows-10-update-kb4013429可能有一些共同之处。 There is known issue ' Windows DVD Player (and 3rd party apps that use Microsoft MPEG-2 libraries) crashes when run ' and '*.ts' files are also ' compresses video data using standard MEPG-2 (.MPEG) video compression '. 存在一个已知问题“运行时Windows DVD Player(以及使用Microsoft MPEG-2库的第三方应用程序)崩溃 ”,并且* .ts文件也“ 使用标准MEPG-2(.MPEG)视频压缩来压缩视频数据 ” 。

Removing this update (kb4013429) helps a little. 删除此更新(kb4013429)会有所帮助。

Short answer: make sure those typescript files are not indexed. 简短的答案:确保没有为这些打字稿文件建立索引。

One way (this is how on Windows 10) 一种方式(在Windows 10上是这样)

  1. In File Explorer, 在文件资源管理器中
  2. Right click the folder that contains the TypeScript files. 右键单击包含TypeScript文件的文件夹。
  3. Go to Properties, 转到属性,
  4. On the General tab, 在常规标签上,
  5. Click Advanced, 点击高级,
  6. Deselect "Allow files in this folder to have contents indexed in addition to file properties." 取消选择“除了文件属性之外,还允许该文件夹中的文件具有索引的内容”。

    I found the general idea by 我发现了一般想法

    1. Clicking on VS 2017 Help, and 单击VS 2017帮助,然后
    2. Going to Send Feedback, then 然后要发送反馈
    3. Report a Problem, and then 报告问题,然后
    4. searching for my issue. 寻找我的问题。 (in this case I searched for: typescript (在这种情况下,我搜索了:打字稿

This gets you past this bug until they fix it. 这样您就可以越过该错误,直到他们修复它。

Also I notice that after a fresh boot of VS I can save my typescript files, although after about a few minutes this create a new file behavior starts. 我还注意到,在VS全新启动后,我可以保存我的打字稿文件,尽管大约几分钟后,创建新文件的行为开始了。

Follow the report a problem workflow for Visual Studio: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017 遵循针对Visual Studio的问题工作流程报告: https : //docs.microsoft.com/zh-cn/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017

Your useage of TypeScript is correct. 您对TypeScript的使用是正确的。 Visual studio (at least your installation) seems to have a bug. Visual Studio(至少是您的安装)似乎存在错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Typescript无法在Visual Studio 2017中保存或发布时进行编译 - Typescript not compiling on save or publish in Visual Studio 2017 打字稿在保存时编译会中断Visual Studio 2017中的AngularJS - typescript compile on save breaks AngularJS in Visual Studio 2017 Visual Studio 2017不编译打字稿 - Visual Studio 2017 not compiling typescript Visual Studio 2017:js 文件导致许多打字稿错误 - Visual Studio 2017: js file causes many typescript errors 使用Visual Studio 2017将Typescript转换为ES5-导出未定义 - Transpiling Typescript to ES5 with Visual Studio 2017 - Exports is Not Defined 如何在Visual Studio中编译带有错误的TypeScript(保存时) - How to Compile TypeScript (on save) With Errors in Visual Studio Visual Studio 2017 中用于 JavaScript 和 TypeScript 文件的 Visual Studio Code 颜色主题 - Visual Studio Code color theme in Visual Studio 2017 for JavaScript and TypeScript files Visual Studio 2017上的JSLint - JSLint on Visual Studio 2017 TypeScript“保存时编译”功能在 Visual Studio 2015 中不起作用 - TypeScript "Compile on save" feature not working in Visual Studio 2015 Visual Studio 2017 调试器在 Office Excel 加载项 Typescript 转换后不起作用 - Visual studio 2017 debugger not working after Office Excel Add-in Typescript conversion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM