I have a fairly complex solution in Visual Studio 2015. It's source controlled using Visual Studio Online with TFS as the source control mechanism.
The structure is as follows:
DefaultCollection
Team Project Root
|
----Web Apps Folder
|
----Web Application 1
|
----WebApplication1.csproj
|
----Web Service 1
|
----Web Service 2
|
----Winforms Folder
|
----Winforms App 1
|
----Winforms App 2
|
----Common Files Folder
MySolution.sln
MySolution.sln is in the Team Project Root, and the solution contains all the various applications within it which are a mixture of web apps, web services and Windows applications.
The problem I have is that I am new to branching and I want to branch the entire solution, but I think that the way my SLN file is in the root will make this difficult?
What I need is to have Web Application 1 branched, and I understand I can branch Web Application 1. But in order to run it I would need to create a new solution file to contain it which would mess things up.
Is there a way I can Branch the entire solution from this scenario, or will I have to try to re-structure things somehow?
I would Create a new Folder at Team Project Root called Main (TFS Convention, SVN it's trunk, git it's master).
Then move all the items in the Team Project Root into that Main folder.
So your structure is now:
DefaultCollection
Team Project Root
|--Main
|--Web A pps Folder
|--stuff
|--Winforms Folder
|--stuff
|--Common Files Folder
MySolution.sln
Now you can right click on the Main folder and from the Branching and Merging sub-menu select Convert to Branch.
Now you can right click on Main branch, and from the Branching and Merging sub-menu select Branch...
Your structure should be:
Team Project Collection Root
Team Project A Root
Source folder
Source folder
Team Project B Root
Source folder
Source folder
You cannot branch at the Team Project Collection or Team Project Root level. You will have to move the source to a new folder first and then you can branch.
Related
One of my colleagues has made some changes to a project, named "DB Conversion". There are 2 TFS builds associated with the PharmacyWarehouse project. Here's a picture so you can see what I'm talking about.
A previous TFS Administrator set this configuration up. I inherited it when he left. As you can see PharmacyWarehouse is just a folder. But the 2 builds have a Visual Studio Build step which only looks at the PharmacyWarehouse.sln file in the PharmacyWarehouse folder. I've looked at that .sln file, it only references packages, PharmacyWarehouse and UnitTests folders. I've looked at the .csproj files, they only reference those folders/VS projects.
I've looked at the DBConversion.sln and DBConversion.csproj files in the Projects | "DB Conversion" folder. It only references that folder/VS project. The files my colleague was editing are in the Projects | "DB Conversion" | Models folder.
Why would checking in changes in Projects | "DB Conversion" | Models folder cause the TFS trigger watching the PharmacyWarehouse.sln to fire? Is it because their folders and not TFS Projects?
We're working with TFS 2015
According to the screenshot, you are using TFVC version control.
Open build definition, click the tab Trigger and check the trigger field Path specification and ensure the path is $/Pharmacy Warehouse /DB Conversion
Open build definition, click the tab Get sources and check the field Workspace mappings, ensure the path is $/Pharmacy Warehouse /DB Conversion.
After configuration, if we push the changes to the folder or project DB Conversion, it will trigger this build and only build DB Conversion.
I have a c# solution with external project added. This external project is in another TFS Project, then when I generate the build, TFS show next error
"Error MSB3202: The project file can not be found "...csproj".
In the GetSource step (Before Agent Job), i can't add this project because it's in another TFS Project.
The structure is like this:
TFS Collection
... TFS Project Main
... Branch 1
... Solution 1
... TFS Another Project
... Branch 2
... Solution 2
Solution 2 has Project 2.
Solution 1 has Project 1 and add Existing Project 2.
Is it possible build Solution 1 in TFS Devops?
I work with Visual Studio 2015 and TFS 2018.
Thanks so much.
When you select the sources in the build definition on Project 1 you can select the files from Project 2 (even if it's a different TFS project):
Now in the build agent you have both projects and you can build all.
I am new to Team Services (web based) build process. I have a Solution 1 with Project A and B where B is dependent on A (common code). Project A is under a different Solution 2 but was added to Solution 1 via "Add...Existing Project". Both solutions and projects are under TS source control. When I checked in Project B, Team Services build process could not find Project A and the build failed. How do I link Project A to the build process for Solution 1/Project B? Is there a better way to solve this? Thanks!
You need to keep the folders’ structure, for example:
Open solution file through NotePad and check the path of Project A (e.g. ..\solution1\ProjectA\ProjectA.csproj)
Edit your build definition add Project A in workspace mapping (Get sources), for example:
(Server path=>local path)
[solution 2 server path] => solution2
[solution 1 server path] => solution1
I have a repository in VS Team Services which is setup as :
-root
|
| -Dev (.sln)
|
| -Releases
|
| - Test (.sln)
| - Live (.sln)
Each build is working fine, however its pulling the entire repo and I just want it to pull a specific branch (Dev, Test or Live)
So I'm selecting the Solution.sln file in the dev branch...
On the Repository tab you can specify your workspace mappings, the default mapping grabs your whole repository excluding the $/project/drops folder.
By changing the first mapping to not take $/Project, but $/project/dev you'll limit the scope of the get operation. If you no longer get the root of your team project, you can remove the cloak of the drop folder, that will only raise a warning otherwise:
The next thing you should do, if you're setting this build up to be a CI build, it to specify the folders that will trigger this build on the Tiggers tab, because, again by default, CI builds will trigger on any change in the whole team project.
To allow you to keep your build definition as a template, I suggest to use the $(Build.SourcesDirectory)\MySolution.sln instead of $/project/dev/Mysolution.sln, that way you only need to update the mappings of a build definition after cloning it to another branch root or when saving it as a template.
How do you delete an outstanding TFS team project root directory?
The team project, MyProblemProject, has been deleted from TFS, but my local file system still has the root directory.
If I delete my local directory, C:\Dev\MyProblemProject, Visual Studio flags the delete as a pending excluded change. But if I try and promote the delete change, I get the error ...
TF101069: Unsupported pend change attempted on team project $/MyProblemProject. Use the Project Creation Wizard in Team Explorer to create a project or the Team Project deletion tool to delete one
Tried using tfsdeleteproject but it gives a TF200016 The project does not exist
So how can I delete the local directory and not have Visual Studio see it as a delete change?
... and why does VS still think the directory is in TFS, as I can't see the MyProblemProject?
It's possible you didn't completely delete your project in TFS server.
Then your local directory still have some source control bindings. This is why VS still detected the changes.
However, there is a workaround for this situation -- remove the bindings of your local mapping folder. Change Bindings on TFS project
If it still doesn't work, sometimes, the binding info is cached. Try to delete TFS cache by going into default C:\ {User Profile Folder}\AppData\Local\Microsoft\Team Foundation\5.0\Cache and VS cache in appdata folder.
Moreover, we usually delete team project in TFS through below two ways:
Delete it in TFS Administration Console
Use tfs command
TfsDeleteProject /collection:https://xxx.8080/tfs/DefaultCollection MyProject