Why does my DB project's .dbmdl file change even when I make no changes to the project?

梦想与她 提交于 2019-12-04 02:57:45

问题


I'm running into a small but weird annoyance that seems to be happening to other people, too (for example, check out the revision history of SEDE). I have a SQL Server 2008 database project in Visual Studio 2010 that works properly. When I go to commit/checkin to source control, I'm told that my DB project's .dbmdl file has changed, even when I've made no changes to the project!

I'm not sure if the changes are triggered by building my solution (which also includes an ASP.NET MVC application and a unit test project) or by simply opening the DB project, but this is getting kind of annoying and is creating clutter in source control.

Is it possible to stop these changes from occurring, or get rid of the .dbmdl file whatsoever?


回答1:


I believe Visual Studio serializes the dbmdl file every time the project is opened. The only possible work around would be to keep the project open.




回答2:


If you delete the .dbml file, it is rebuilt without errors or warnings, so I think it's just a cache file for references, intellisense, etc. I'm going to exclude it from source control.




回答3:


See related question here. The .dbmdl file is unique per user (and some kind of cache, as said above) and so the right solution is indeed to exclude it from source control.



来源:https://stackoverflow.com/questions/3489763/why-does-my-db-projects-dbmdl-file-change-even-when-i-make-no-changes-to-the-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!