简体   繁体   English

VSCode 在 Windows 上将 .NET 项目和解决方案的最近使用 (MRU) 列表存储在哪里?

[英]Where does VSCode store its Most Recently Used (MRU) list of .NET projects and solutions on Windows?

Where does VSCode store its Most Recently Used (MRU) list of .NET projects and solutions on Windows? VSCode 在 Windows 上将 .NET 项目和解决方案的最近使用 (MRU) 列表存储在哪里?

And also is there some open source code to fetch VSCode's MRUs?还有一些开源代码可以获取 VSCode 的 MRUs 吗?

I scanned all files in this dir (recursive) C:\Users\pat\AppData\Roaming\Code with no luck我扫描了这个目录中的所有文件(递归) C:\Users\pat\AppData\Roaming\Code没有运气

For you it should be in C:\Users\pat\AppData\Roaming\Code\User\globalStorage\state.vscdb ;对你来说,它应该在C:\Users\pat\AppData\Roaming\Code\User\globalStorage\state.vscdb this file is an SQLite database and you can look around for tools that open this kind of file (because it won't be readable as plain text) to see what's inside and decide whether you can sync it across machines (if that's what you're after).这个文件是一个 SQLite 数据库,你可以四处寻找可以打开这种文件的工具(因为它不能以纯文本形式读取),看看里面有什么,并决定你是否可以跨机器同步它(如果那是你想要的)再之后)。

Also reference this answer , there's very useful stuff over there.也参考这个答案,那里有非常有用的东西。


Edit : Thanks this is indeed the file I was looking for.编辑:谢谢,这确实是我要找的文件。

It can be read with the tool SQLitebrowser .可以使用工具SQLitebrowser阅读。

I didn't easily found a .NET library to read the state.vscdb file + we are very reluctant in embedding a whole library in our product for a small feature.我不容易找到 .NET 库来读取state.vscdb文件 + 我们非常不愿意为了一个小功能在我们的产品中嵌入整个库。

Hopefully state.vscdb contains the MRU file list in clear textual JSON. So what I did is just open this file as text, and locate the JSON and read it.希望state.vscdb包含明文 JSON 中的 MRU 文件列表。所以我所做的只是将此文件作为文本打开,然后找到 JSON 并阅读它。 Clearly it is ugly but JSON shouldn't be crypted anytime soon in such file and if it fails one day, this feature is not critical for us, just a convenient helper for the user.显然它很难看,但 JSON 不应该很快在这样的文件中被加密,如果有一天它失败了,这个功能对我们来说并不重要,只是用户的一个方便的帮手。

The JSON to locate looks like:要定位的 JSON 如下所示:

{"entries":[
{"fileUri":"file:///c%3A/Dir/treeItem.ts"},
{"fileUri":"file:///c%3A/Dir/YourSolution.sln"},
...

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM