In my project, while cloning existing repository, there is immediately added one new file.
What is that? Am I allowed to push it or should I ignore it in .gitignore?
There already exists .suo file...
Could the reason be that I have installed the newest Visual Studio version?
From official MS Docs:
The solution user options (.suo) file contains per-user solution options. This file should not be checked in to source code control.
The solution user options file is used to store user preference settings, and is created automatically when Visual Studio saves a solution. So need to worry. Even if you delete this, it will be auto generated on the very next build.
Moreover, it should not be checked into source code. So in your .gitignore file, you should its reference as well:
.wsuo
Related
One thing that drives me crazy with TFS is the fact that if you have a file checked out, but you made no changes to it, it still shows as a change, distracting you from real changes that you made. This is especially annoying when you use tools such as T4 to generate code, because most of the time the tool will generate the same code, but will leave the file checked out.
For some reason that I can't understand, Visual Studio insists in showing those as changes, and will even claim that there are conflicts if another person happened to check-in the same "changes".
Fortunately, the TFS Power Tools include a command that compares checked-out files with the server version and undoes the unchanged files. I will explain how to integrate it into Visual Studio using a custom tool.
This is unfortunately not available if you are using Visual Studio 2017!
It used to be very simple to accomplish this with earlier versions of Visual Studio:
tfpt uu /noget /r *
How do we remove files from pending changes if they do not have any changes?
This is different based upon your choice of version control system in TFS, so the above problem only exists for TFS' traditional version control system TFVC and not git which has been supported for a few years now.
For TFVS a partial workaround is to mark all files, right-click and Undo... and click Undo Changes button in the following dialog. This will prompt you for the files that are different (letting you choose No or No to All) but not for the ones that have no changes. Important: I write 'partial' because this approach does not work for file renames as the file is considered unchanged so the rename will be undone.
Yes,there are no Power Tools for Team Foundation Server 2017. You could use below workaround:
Right-click on your project ,select undo checkout, then just click okay, or whatever confirmation is left...
Then, while undoing checkout, for every file that has REAL changes in it, a prompt will ask you to confirm the check out for that file... simply click "No to All". Visual Studio will know if the checked out file has changes or none.
WARNING: This method also removes new files, i.e. files that are not yet checked in to TFS. If you want to keep these files then simply exclude them from the set of files you "undo".
You could also take a look at this question: his question Files listed as pending changes when doing merges that didn't change?
The TFSSourceControlExplorerExtension extension is available for VS 2017 and it has an undo unchanged action that works rather nicely.
Stage the change you actually want. The file that isn't actually changed then disappears.
Currently Visual Studio 2017 seems to ignore the packages folder by default when reviewing pending changes so I have to manually add them which can be time consuming - The trouble is that I actually want to commit nuget packages into source control via TFVS. I understand that this isn't the 'correct' way of doing things (nugets should be pulled via nuget restore). But unfortunately with the solution I am currently working on packages are committed into source control. Is there a global ignore configuration I can amend to allow package changed to be auto detected?
Thanks.
To achieve that globally, you can edit the default ignore configuration file "LocalItemExclusions.config" to let VS 2017 to detect the packages files automatically.
Please follow below steps to do that:
1, Open the LocalItemExclusions.config file which under below path (You need to make sure open the folder that matches your VS version, VS 2017 should be 7.0) :
"C:\Users\{youraccount}\AppData\Local\Microsoft\Team Foundation\x.0\Configuration\VersionControl"
2, Remove the default ignored files' extension then save the file,*.dll for example here:
<Exclusion>*.dll</Exclusion>
3, Thus VS 2017 will detect the new added package files automatically, you can check them in Pending Changes page (Excluded Changes area )
4, Click the Detected link, click Promote, then check in the changes.
You could add a .tfignore file to the solution root (on the same level as your packages folder)
.Add a line !\packages to this file to explicitly re-include it.
The pending changes list in VS will take this file into account. The packages folder should now be listed to be added to source control.
I recently started using Git with Visual Studio 2015 and I'm trying to modify the properties of an installer project. The issue is that it won't let me because the project isn't checked out and I don't see an option to check out the project with Git through Visual Studio. The only place I even see the mention of the words 'Check Out' is under branches and it's grayed out.
I'm having the same problem in VS2015. It seems to be an issue with the Installer Project extension. For some reason Visual Studio doesn't detect when you attempt to change the Setup Project file (with YourProject.vdproj), and doesn't automatically unlock it for you. I had the same problem with TFS, but in that case all you had to do is manually unlock the file, by right clicking on it. I've just migrated to Git, and the problem is still there, but now you can't unlock the file by right-clicking on it (since there is no explicit check-out in git).
I'm still looking into the problem, but the only solution I've come up with now, is making a quick manual edit of YourProject.vdproj in Notepad. Visual Studio WILL recognize that edit, and unlock the file for you. After that you can continue to use IDE to make changes to the Installer project.
Unfortunately, the problem comes back once you check in your changes, and try to modify the file again. You will once more have to manually edit it to force Visual Studio to unlock it for you.
EDIT: After spending a few hours on this, I finally came up with a proper fix, which I verified works on a few in-house projects. Here are the steps:
Open your solution file in notepad, and delete the following section: GlobalSection(TeamFoundationVersionControl)
Open the solution containing locked Setup Project in Visual Studio.
Go to Tools > Options > Source Control > Plug-in Selection, and pick 'None' from the dropdown.
Click Yes to the dialog that warns you the project will be closed.
Open the solution again, you will be prompted to permanently remove
source control bindings from the projects. Click Yes to that.
You can now go back to Tools > Options > Source Control > Plug-in
Selection and pick Git again.
At this point the problem is fixed, and you will be able to modify
your Setup Project without any issues.
I found that removing bindings is clearing the values of the following tags from the project files:
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
Apparently SAK stands for 'Should Already Know'.
Here is a workaround I found,
Mark the project installer in the Solution explorer, And click "Save" (not save all).
For me it did the trick.
If it's still didn't help try to reopen VS and try the method again.
Cheers!
Open a command line, go to where you need to check it out, then issue the git checkout command? http://git-scm.com/docs/git-checkout
Like Eternal21 I encountered this problem when trying to modify an Installer project, this was in a VS2013 (rather than VS2015) project though and I could not see a GlobalSection(TeamFoundationVersionControl) in the solution file. However the following steps worked;
Go to Tools > Options > Source Control > Plug-in Selection, and pick 'None' from the dropdown.
Make the change required to the Installer project
Go back to Tools > Options > Source Control > Plug-in Selection and select Git again.
(and the Solution did not ask to be closed).
You need to create a new empty repo on your Git server first, then clone it to a folder on your local computer.
After that you will be able to add your project and check it in by adding it to the local folder.
I was able to work around this problem by simply editing the vdproj file (setup project file) manually in Notepad++ (you can use any text editor), making some temporary changes into it (type a character and backspace) and saving the file. This effectively checks out the project from GIT. Now you can come back to Visual Studio and make whatever changes you want.
I was able to use dotNETs suggestions and edit the vdproj file. Simply adding a character and removing didn't work, but making an actual edit did. Doing so triggered the check out for GIT. In my case I was attempting to change one of the Detected Dependencies exclude property to false and was able to do so while editing the vdproj file. Once I saved it then reopened Visual Studio the check was displayed on my installer and the change was already applied. I was able to make additional changes while checked out.
Once finished and I checked it in, I could no longer edit and needed to manually edit the file again to check out.
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.
We made the mistake of allowing .csproj.user files to be checked in to TFS so we could set "Start external program" defaults. This worked poorly, especially when branching.
Now we're trying to undo this.
If I delete the .csproj.user file for a project and then try to set new project debug properties, I get:
TF14050: Cannot change item $/xxx.csproj.user
because it already has a pending change that is not compatible.
If I check in the delete and make changes, TFS then tries to re-add my .csproj.user file.
How can we fix this for existing projects in source control?
Update:
I think destroying them is the best option; we ended up just deleting them with the TFS Power Tools, though. The trick was to first Remove the Source Control File Type we had for *.user, even though it was already disabled. Now TFS appears to completely ignore these files.
I also wanted to check in .user files to do what the asker wanted, to provide defaults for the debug/run options. It turns out that the .user file is just another MSBuild Project XML file, and you can just "merge" the property group in there into your project. No need for .user files.
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartProgram>$(VS100COMNTOOLS)..\IDE\devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
I suggest that you use the Destroy command. Be careful since it deletes permanently. MSDN documentation: http://msdn.microsoft.com/en-us/library/bb386005.aspx
Start a Visual Studio 2010 Command, and use tf.exe ...
Make sure no one has the file checked-out then delete the file - checking in as a delete and not an edit.
I use Team Foundation Power Tools and do it from the Windows Shell Context menu
After you delete a file in TFS, it isn't gone yet. You need to Check-in your deletion. Only then will the file be gone.
It's best practice to then also clean your workspace to make sure the user files don't linger as read-only files.
I use TFS Git and I was able to delete the unwanted file on the server via the TFS project site. Then I synced the local project with the server.
When you open the project to sync VS might complain that you can't sync until you commit changes to the unwanted file. This is exactly what I didn't want to do, I wanted the file to go away.
However, in the change screen I right clicked the file and said 'undo changes' and that made it go away.
After, undoing changes I was able to sync and the server removed the unwanted file from my local repository.