且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio 2015 数据库项目目录包含一个扩展名为 jfm 的文件

更新时间:2022-11-28 16:19:39

这是由 ESENT 引起的问题引擎依赖于 SQL 项目添加新文件.这是 Windows 10 周年纪念版中的一项新功能,可以避免数据丢失,但 SQL 项目将 .dbmdl 缓存文件存储在项目根目录下的事实意味着此锁定文件已添加到 Git 源代码控制中.

注意事项:

  • 已接受用于在 GitIgnore 中修复此问题的 拉取请求,并且 Visual Studio 团队正在努力将其包含在未来的更新中.这将确保对于新项目,.gitignore 文件包含 .jfm 并且不会出现问题
  • 核心 SSDT 团队正在努力在未来的更新中为此提供解决方案,但目前***的解决方案是手动添加,如评论中所述.

披露:我在 Microsoft 的 SSDT 团队工作.

Assuming we have a database project called MyDatabase then a file called MyDatabase.jfm appears in the root of the project directory.

  • It is exclusively locked while the project is open in Visual Studio
  • It is a binary file
  • It has only started appearing recently (past couple of days)

I have done a Google search, which has not offered any insight. There are some references to some old software, but most of the results are spam/***ware. I have also looked in SO, but that has not produced any results either.

Does anyone know what it is and why it's there?

The plan is to add it to the gitignore file for Visual Studio, but I need to know what it is first to submit the PR...

UPDATE

This is now breaking the Team Explorer Changes view. There are no changes being shown with the following from the Output window:

As such I will be adding the file to the .gitignore file and submitting the PR. It would be good to eventually learn what this file is and where it came from...

This is an issue caused by the ESENT engine relied on by SQL Projects adding in a new file. This is a new feature in Windows 10 Anniversary Edition to avoid data loss, but the fact SQL Projects store the .dbmdl cache file under the project root means this locked file is added to the Git source control.

Notes:

  • A pull request to fix this in GitIgnore has been accepted and the Visual Studio team is working to include this in future updates. This will ensure that for new projects the .gitignore file includes .jfm and the problem will not occur
  • The core SSDT team is working to provide a solution to this in a future update, but for now the best solution is to manually add as discussed in the comments.

Disclosure: I work on the SSDT team for Microsoft.