How can I get labels of a sub folder under a team project using command line tool TF.exe? - command-line

We have TFS version control in which the following folder structure is adopted.
The following is the folder structure that we use:
In the above image, delta is the TFS server name, TempProjects is the project collection and DetBarShapeEngine is one of the team project. Main is the branch name and ProjectSource is a special folder under which all files managed by development team are stored. We label at the ProjectSource level and hence it is a kind of root folder for every project source.
When I ran tf labels /collection:"https://delta:443/tfs/TempProjects" /owner:*, I saw a huge list of labels from all the project collections including DetBarShapeEngine.
I modified the above command line to include the team project in the project collection URL tf labels /collection:"https://delta:443/tfs/TempProjects/DetBarShapeEngine" /owner:*, I receive:
TF31002: Unable to connect to this Team Foundation Server .... ....
Technical information (for administrator): The remote server returned
an error: (404) Not Found.
I tried increasing the depth of the path of the project collection URL till ProjectSource, but I still get the same 404 error.
Question:
How do I get labels of a sub folder under a team project?
Note:
I cannot change this folder structure for any reason what so ever.
We use TFS 2013.

After struggling a lot, I stumbled on a blog showing sample about using scope in some other command. I tried to use that scope string to TF labels command and it was a success!
Here is the command line that I used:
tf labels /collection:"https://delta:443/tfs/CadsProjects" *#$/DetBarShapeEngine/Main/ProjectSource /owner:*

Related

Unable to watch for file changes in this large workspace which has only two cpp files

I am trying to run the first example of zguide (zeromq). The project has two files, client and server, and I am doing this using vscode ssh remote on a RHEL7 machine.
Here is the structure of the folder and how it looks like in VSCode explorer:
ZEROMQ[SSH:remote_machine]
|_.vscode
|_tasks.json
|_c_cpp_properties.json
|_client.cpp
|_server.cpp
Once in a while I receive this warning:
Unable to watch for file changes in this large workspace folder. Please follow the instructions link to resolve this issue.
The instructions are of course telling me to increase the limit size which I don't think is the issue here with such a small project.
So, any ideas what's happening and how to resolve this?

NuGet Server cannot find .nupkg package files

Okay this is a derivative of Could not load file or assembly 'NuGet.Server, Version=2.11.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies seeing as though I couldn't find a solution to that.
I am publishing my Nuget Server project to my Windows 2012 R2 server and pointing to the applicable directory where the files live. The package files exist, as shown below in the screenshot however I keep on getting the below error:
Severity Code Description Project File Line Suppression State
Error Copying file Packages\PackageName.1.0.0.nupkg to obj\Release\Package\PackageTmp\Packages\PackageNameJson.1.0.0.nupkg failed. Could not find file 'Packages\PackageName.1.0.0.nupkg'. nuget_server_02 0
I have NuGet Server v2.11.3 installed and my project targets .NET Framework 4.6. One thing to note is that the packages themselves are from an earlier version of .NET - most likely 3.5.
This is my web.config file:
<add key="packagesPath" value="D:\RootFolder\SubFolder\SolutionNameFolder\ProjectNameFolder\Packages"/>
Even after several Restore NuGet Packages attempts I am still faced with this dilemma. The one thing I am really struggling to understand is if I point the packagesPath to a local directory, it works and does retrieve the packages however, when I point to the very same project on my server I get this headache.
Previously, in the included link to the related SO question, I could publish but now I can't even get through that stage even though I never made any changes to the project since last working on it. I decided to revisit it today.
UPDATE:
I have deleted the bin folder and rebuilt my solution as per Could not load file or assembly 'someProject' or one of its dependencies. Access is denied But it still can't find the file.
You can run your nuget server and it will show an html file as output (Default.aspx). You can, of course, modify this file to make it look like anything you want and otherwise change it. You can't change the way the nuget server service behaves because that is run from a dll. You should be able to show your repository files using the output page of your nuget server.
I encountered a similar set of errors, and monitored the Event Viewer while I was trying to show the contents of my repository.
The Event Viewer showed that an error was being thrown every time my Nuget Server attempted to list the contents of the packages folder.
Keeping in mind that nuget packages are zip files, and to display the details on the information contained in the nuget packages, the nuget server must unzip them. If the file is corrupted, the server will throw an error and stop attempting to list the contents of any further files. This error results in a w3wp.exe crash. It will be recorded as an ASP.NET error in the Windows->Applications section of the event log.
The cure for me was to delete the contents of the packages folder on my nuget server, and re-up them.
This may be impractical if you have a lot of files in your repository, so any files that were uploaded near the first error shown in the event viewer should be chosen for upload first.
One of the files is likely corrupted.
I would recommend checking out the event viewer on your server, and making sure you have no corrupted files in your repository.
You can view (and edit, to a point) your repository contents with Nuget Package Explorer. If the file you want to view is corrupted, then it should show an error for that file. You can then re-up that file, and if the problem is a file problem, this will cure it.
You can also reinstall your nuget server if that fails. It is somewhat unlikely that the code has been corrupted, but worth a shot.
Good luck.

TDS File Replacement

I want to deploy some front end assets to the local web root of a site using file replacement. I can't seem to get it to work with a relative path in the target location field though. Is it possible to do this though tds or should I use a post build event instead?
The reason these assets aren't included in a project is that they are part of a third party solution but we still want this tracked in source control to try to make the project setup easier.
Most developer machines will be set up the same way for this project with the same file structure but I think it's a little more flexible if I can make the target a relative path so I don't need to worry about differences like drive letters and such.
The folder structure is as follows:
repo
folderToCopy
sitecore
webroot
I have tried the following using ..'s based on what tds changed my source location to be while using the "Make selected Source Location relative" option (changed it from an absolute path to ..\folderToCopy\):
../../Sitecore/Website
/../../Sitecore/Website
..\..\Sitecore\Website
\..\..\Sitecore\Website
From my understanding, TDS does the file replacement based on the files published from the associated Website project.
You can then have relative replacements such as the following:
<Replacement Include=".\assets\folderToCopy\myFile.txt">
<TargetPath>.\assets\targetFolder\myFile.txt</TargetPath>
<IsFolder>False</IsFolder>
<IsRelative>True</IsRelative>
</Replacement>
I have not been able to successfully get TDS to use the file replacement with files that are in source control but not in the project.
My suggestion would be to set up a build event that will copy these files to the correct location, or to create a nuget feed for them and pull them in as nuget references.

How to upload Parent child SSIS package to server

Hi all I am very new to SSIS. I have got SSIS package developed by some other guy this package reads data from flat files and stores to database after mapping.
Flow:
1) First package extract records from flat file and stores in table.
2) Then it calls child package using Execute package tasks.
3) Then child package do some calculations and update the database table.
SSIS is using Environment variable to get database information.
Every thing is working fine but now I want to deploy this package to my client's server.
Ques: Do I need to copy and paste files from bin folder and paste on clients machine?
What I Tried: I copy files from bin folder and placed on my local computer. Then I create a job in MSSQL and run the job. Package runs perfectly. But Later I changed location of my project and problem starts job stops working.
Issue: Error says location of child package is not available(As I changed position of my project files)
Kindly suggest what to do.
I am going to make several assumtions here so please correct me if I get any wrong.
The problem I am guessing is that on your Package.dtsx within the connection manager this is currently linked to the package location within the project folder. In this case you are wanting to change it to another location, however the package in the connection manager is still pointing to the project location.
If I were you I would do the following:
Create a string variable
PackageFolderPath - C:\CurrentPackagePath\DBPackage.dtsx
Now what you want to do is go to the package within the connection manager and under the properties add an expression for ConnectionString with the following: “#[User::PackageFolderPath] If you evaluate the expression it should give you the location you setup in your variables.
Please note however that if you want this to work on the development system then setup the package to the project location.
Now once you have those setup, copy the files across the new server and under the SQL agent job to go the Set Values tab and within here you want to add the following:
\Package.Variables[User::PackageFolderPath].Properties[Value]
Under the value you want to put wherever the package is now located
This now should pickup the new location of the package when it is run.
A better way to do this would be to make use of the deployment utility and using an XML configuration variable on the package. However this way should work.

How do I create a new project in TFS from an existing project (breaking history)?

My team is taking over a project from a previous team. We use a different TFS server than the original team, and we are also not interested in keeping the history of the project because we are accepting the latest version of the code as the beginning of our history with the project. Branching is not an option since we want to start our history from the current version of the code. We just want a fresh project with the existing code.
I have not been able to create the new project from the old code successfully. I keep getting an error: "Source control cannot add the solution: Solution would span multiple workspaces"
My process for attempting the new project creation:
Create a workspace for the previous team's version of the code.
Get latest version of that code into local mapped workspace directory
Open the solution.
Unbind all projects and solution.
Close solution.
Create a workspace for the new version of the code on our TFS server.
Copy the unbound code on my local box to the new local workspace mapped folder.
Open the solution from the new directory.
"Add to source control" from the new solution.
Then I get the error. I have tried removing the TFS security files out of the code directories in the unbound version and tried changing source control instead of adding to source control (but it just binds back to the original instead of letting me bind to the new).
Is there any other way to do this besides recreating the solution/projects and adding back all the files and references? It doesn't seem like it should be this difficult...
Any advice much appreciated!
Your way should work...there's probably some minor discrepancy in your steps or your initial state that I'm misinterpreting. Rather than debug to death, let's abandon what you've got so far and do this instead:
Fetch the previous team's code onto your machine somehow. Preferably just a straight robocopy from a colleague or the old build server; no TFS connections. If you do have any workspaces associated with the old TFS, delete them now.
Unplug from the network, or otherwise ensure the old TFS is not reachable.
Open the solution.
You'll be prompted: "work offline" or "permanently remove bindings"? Choose the latter.
File -> Save All.
Reconnect to the network.
Create a workspace that maps a superset of the code dirs to some path on the new TFS.
Solution Explorer -> rightclick root node -> "Add to source control."
Per the rules I describe on my blog, step 8 should succeed w/o user intervention (no "browse for folder" dialog, no error popups).
Note: steps 2-4 assume you have VS 2008. If you have 2005 you'll have to manually poke around in the Bind dialog.