8

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.

Bacon
  • 783
  • 2
  • 11
  • 31

7 Answers7

16

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:

  1. Open your solution file in notepad, and delete the following section: GlobalSection(TeamFoundationVersionControl)
  2. Open the solution containing locked Setup Project in Visual Studio.
  3. Go to Tools > Options > Source Control > Plug-in Selection, and pick 'None' from the dropdown.
  4. Click Yes to the dialog that warns you the project will be closed.
  5. Open the solution again, you will be prompted to permanently remove source control bindings from the projects. Click Yes to that.
  6. You can now go back to Tools > Options > Source Control > Plug-in Selection and pick Git again.
  7. 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'.

Community
  • 1
  • 1
Eternal21
  • 4,190
  • 2
  • 48
  • 63
7

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!

Ori
  • 71
  • 1
  • 2
1

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

Joe Healy
  • 5,769
  • 3
  • 38
  • 56
1

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).

d219
  • 2,707
  • 5
  • 31
  • 36
0

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.

Andy B
  • 101
  • 1
  • 8
  • I already have a repo set up and have been syncing to GitHub. – Bacon Mar 09 '16 at 21:25
  • 1
    There isn't an option in the visual studio UI to checkout when using Git though it seems. – Bacon Mar 09 '16 at 21:26
  • Do you have Git Extensions for Visual Studio: https://visualstudiogallery.msdn.microsoft.com/35c2f314-a6ab-479a-b4a3-cff99103d32f – Andy B Mar 09 '16 at 22:34
0

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.

dotNET
  • 33,414
  • 24
  • 162
  • 251
0

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.