在密度纤维板/ .LDF不再检查程序App_Data到TFS [英] Can't check in .mdf/.ldf in App_Data into TFS

查看:266
本文介绍了在密度纤维板/ .LDF不再检查程序App_Data到TFS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与ASP.NET C#MVC 5个。

I am working with ASP.NET C# MVC 5.

密度纤维板/ .ldf文件不会出现在挂起的更改在团队资源管理。因此,我不能检查他们到TFS(视觉工作室在线)。我试着重新创建项目了几次,没有工作。什么可能是这个原因吗?

.mdf/.ldf files in App_Data do not appear on Pending Changes in team explorer. Therefore I can't check them into TFS(visual studio online). I've tried recreating the project a few times and none worked. What might be the cause for this?

推荐答案

转到团队资源管理器,并找到排除的变化,你应该找到它排除在外。右击App_Data文件夹,包括它。

Go to Team Explorer and locate Excluded Changes and you should find it excluded. Right click the App_Data folder and include it.

但你可能要重新考虑包括数据库文件。当你正在开发和测试,每一个小数据库交互将触发的变化和其中大部分是微不足道的。另外,当其他人在做这个项目,他们可能不希望你的数据库文件覆盖他们,当他们获取最新版本。

But you might want to reconsider including the database files. As you're developing and testing, every little database interaction will trigger a change and most of those are trivial. Also, if someone else is working on this project, they may not want your database file to overwrite theirs when they Get Latest Version.

如果您正在使用实体框架code-首先,当你构建项目,我相信数据库自动生成的,否则你只是运行Update-Database命令去做。这让每个人合作有其自己的本地数据库文件一起工作。您还可以利用迁移进行更新到数据库结构。如果你想用pre-填充数据生成的数据库,你应该利用种子的方法。

If you're using Entity Framework Code-First, the database is automatically generated when you build the project I believe, otherwise you just run the Update-Database command to do it. This lets everyone collaborating have their own local database file to work with. You can also utilize migrations to make updates to the database structure. If you want the database to be generated with pre-populated data, you should utilize the Seed method.

这篇关于在密度纤维板/ .LDF不再检查程序App_Data到TFS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆