Edmx file is not under TFS source control VS2012 - c#

I was having some issue with a relationship not showing up in an the Model Browser for a table. So I deleted it in the EDMX diagram and added it back.
Now I noticed when Checking In Pending Changes, that this same file was marked for deletion and that it is missing the source control padlock icon next to it.
1. I tried File > Source Control > Advanced > Refresh Status to no
avail.
2. The rest of the project is fine...just this one file, so the
source control Bindings check is all ok.
3. I went up to the EDMX file and r-click > Add files to source control..again no luck.
Is there anyway to add this to source control again?

I think you can follow this link on MSDN:
This let you go to Team Explorer => Source Control Explorer => Add Items To Folder => Then Select you .edmx file.
Then that file is included in source control afterwards.
Alternatively, in Check-In Process, check if the file is in the Excluded List at the bottom of that pane.

Related

how do add a project to source control within an existing solution

I've recently noticed that my ..LibraryTests project is not under source control:
When I try to do a checkin (by right clicking on the solution and pressing check in) it says that there are No Pending Changes. It's not seeing changes to the LibraryTests project because it is not under source control.
From my perspective:
The first project is under source control
The second project is not under source control
The solution itself does not seem to be under source control.
How do I get the entire solution including the Tests project checked in?
If you go into Source Control Explorer and navigate to your project you should see that LibraryTests isn't included. Right click on the folder, click on "Add items to folder..." then click on your project folder thats missing. Click next and this should add it to source control.

TFS auto check out licensex.licx when new item create

I was working on a .Net project with TFS2010. After create a new item , TFS would auto check out licensex.licx file. Try to check in it, but got unchanged warnning. Nothing serious but annoying.
Any help would be appreciated.
Checking out the file is what makes it writable [non-checked out files are read only]. This allows you to save changes if necessary.
For your situation, try following methods:
Go to File--> Source Control --> Change Source Control. Check that
the Source Control binding are correct. You can try to unbind and
rebind the solution file again.
This can also be due to the extensions you may have installed, try
to open the Solution file after disabling the extension (Tools-->
Add-in Manager).
Try to delete TFS cache by going into default
C:\ {User Profile Folder}\AppData\Local\Microsoft\Team Foundation\2.0\Cache and VS cache in appdata folder.

Can't add file to TFS because "cannot lock item" of parent folder

I'm trying to add a file to TFS. When I right click on the file and choose "TFS > Add", I receive this message (which has my name in it):
TF10151: Cannot lock item $/Blah/API Code/packages/folder/file.dll for check-out. The item $/Blah/API Code/packages is checked out by Hoppe, Joseph in Workspace XYZ.
If I look in Source Control Explorer, it reports that the packages folder has a pending change of add, although there are other files checked in underneath of it.
If I right click and do TFS undo, it reports "There are no changes to undo in the selection or any children of the selection".
If I try TF undo, I get the following error:
tf undo /workspace:XYZ;Domain\MyDomainAccount $/Blah/API Code/packages/folder/file.dll /server:http://domain:8080/tfs
No pending changes to undo.
If I try tf undo * /recursive, I also receive the same message.
I deleted the folder. I then re-got it from TFS. Same issue.
How can I add these files to TFS? I looked in Source Control Explorer in VS2013 and VS2015.
Can these be locked from before my computer was formatted? If so, how do I unlock it?

One file of the project does not seem to be under source control

VS2012 Pro and TFS: This is a file that used to be under source control and even the icons next to it I think is showing that it is but when I make a change and right click the option for "Undo Pending Changes" is disabled. However other files in the same project are working fine.
Here is also a screen shot: The file with this issue is Service.asmx.cs
The red check mark next to the file indicates that it is under source control and is checked out. This file is generated from the Service.asmx file and to perform source control changes like "Undo pending changes" you will have to make this operation on the Service.asmx file. Whatever change you make will cascade to the generated file.
If you are in doubt about the source control status of a file you can locate it in Source Control Explorer where you can perform operations on individual files even though the files are linked in Visual Studio. However, unless you know what you are doing I highly recommend that you stay in Visual Studio when working with files that are linked like this.

"Add existing item" in Visual Studio: is it possible to make "Add as link" default?

As pointed out in this SO answer, the Add > Existing item dialog in Visual Studio by default displays the Add button (meaning that the selected items will be physically copied to the new location), whereas the desirable action is often (always?) to Add as Link.
Is it possible to configure Visual Studio so that Add as link is selected by default when opening the Add > Existing item dialog?
I have thoroughly searched the Options dialog in Visual Studio and examined the MSDN documentation for an answer to this, but so far to no avail.
Project Linker would be a good option for automated linking when two new projects are to share the same code base. However, when linking a large number of files from an existing to a new project, one seems to be confined to the Add > Existing item approach, and this work could be much more convenient and less prone to error if Add as link would be the default action.
Unfortunately, there is no option for that. But there is silver lining. You can drag files to a project and drop them to desired folder. Files are copied to your project. If you press Alt key doing drag and drop operation, files are not copied but linked instead.
You can also use VSCommands extension which adds 'Copy as Link' on folders and files in Solution Explorer. After that you can do 'Paste Link' in desired location. It also allows you to navigate to source item from linked item via 'Locate Source File' from cotnext menu. Works with vs2010 and vs2012.
It appears that when you "Add Existing" to a SOLUTION FOLDER(as opposed to an actual folder), then you are always adding these items as a link.
If you add existing items to an actual folder, then you get the button that gives the option for "Add as Link".
Simply Edit project file and change the path of the file.
You can relatively move folder up using ../
It starts in the project folder.
I found an nice tip here:
If you want to add an existing item as link in VS C# Express 2010 in the "Add existing item" dialog you have to explicitly choose Add As Link from the dropdown on the Add button.

Categories

Resources