I've recently moved to using TFS 2012 and have edited a couple of files and checked in without any problems. However, I've just started work on the EF data model and despite being able to open the file the "Update Model From Database" option on the Entity designer right-click menu is greyed out / disabled.

I'm a bit baffled by this. I've tried checking out the file with the "Allow other users to check out but prevent them from checking in" but that doesn't make any difference. Nor does checking out the whole folder the project is in.

Does anyone know what I'm doing wrong?

EDIT:

I've discovered that if I create a project in TFS and add an entity model to it then I can update it. However, if I import an existing project into TFS and then try to edit the .edmx file then that's when the problem happens.

解决方案

I managed to work out the problem, I'll post it here just in case anyone else suffers with this:

The project wasn't set up properly. I was editing the files in the "local path" having not opened the project first (seems kind of stupid now, but this is my first time with TFS and I'd assumed opening the project in TFS opened it as a project in VS).

When I double-clicked on the .csproj file within the Source Control Explorer I was prompted with: "The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?"

Clicking "Yes" opened the project correctly and I could run the update the model from the database.

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐