TFS get project name - tfs-sdk

I have a team project Named "MyTestTeamProject" under which I have one solution folder. The solution folder contains many class library projects and one windowws application. Under the web application i have a folder named "Database" which contains the sql script file. I need to download script file and execute it in a remote machine.
My snippet for getting all files from a tfs folder is as follows:
TfsTeamProjectCollection tfsTeamProjectCollection = new TfsTeamProjectCollection(new Uri(_serveruri), creds);
tfsTeamProjectCollection.Authenticate();
var versionControl = tfsTeamProjectCollection.GetService<VersionControlServer>
var workspace = versionControl.CreateWorkspace(AppDomain.CurrentDomain.FriendlyName + "-installer", versionControl.AuthorizedUser);
WorkingFolder folder = new WorkingFolder(#"$"+_projectpath+#"\WebApplication1\Database", "c:\\temp");
workspace.CreateMapping(folder);
workspace.Get();
Here WebApplication1 is my web app under which the database folder exists and '_projectPath' is the team project. How can I get that web proj/ windows project name (WebApplication1) Or the name of the project under which the Database folder exists ?
Thanks in advance.

Don't create a Workspace for that, use the VersionControlServer.DownloadFile method instead.
To locate the item you're looking for use one of the GetItems methods.

Related

PhpStorm : Use files from one project in other projects without copying them?

I have one project which contains some PHP services that I use as a template in all my other projects.
Is it possible to add these files to a new project without actually copying them to the new project's directory? Or, they could be copied but I want changes to one of the copies to affect the template.
For example. Template project contains
folder service with files "1.php", "2.php", "3.php"
and folder util with "u1.php" and "u2.php".
I want to use these files in one or more new projects but without copying them.
They should merge with the files of the new project and be treated as if they are in the new project's directory.
If the new project also has a folder "service" with files "4.php" and "5.php" the files 1 2 and 3 from the template should show there too.
And if I were to edit service/1.php in the new project, the original file in the template project would get changed as well.
Is something like this possible?

What's the best way to place a local SQLite database file in a WinForms application to publish the project on GitHub and distribute the executable?

I'm trying to push to GitHub a Windows Forms VB.Net application which does CRUD operations on a local SQLite database file, but I realized the db3 file and System.Data.SQLite.dll are excluded from the push because the contents of bin/Debug folder where they're located are a part of the .gitignore policy template on Visual Studio, which absolutely makes sense.
I have tested the .exe file out of this Debug development folder and couldn't run the application either, throwing the exception: "Could not load file or assembly 'System.Data.SQLite, Version=1.0.116.0, Culture=neutral, PublicKeyToken=...' or one of its dependencies"
My Problem is all the guides I've checked to use a SQLite in a Windows Forms project place the database file in bin/Debug, I guess for the simplicity of the tutorial. So this way of referencing the SQLite db3 in bin/Debug works fine in my application:
Public dbFullPath As String = Application.StartupPath & "\\myDatabase.db3"
Public conStr As String = String.Format("Data Source = {0}; version = 3;", dbFullPath)
However, I don't know how to place the database at the same level of other project files like .vb Forms and the Resources folder and reference it so the app works and all the necessary files are pushed to my public repository.
I created an App_Data folder at project level and placed the database file inside and then tried to replace the path String from:
Public dbFullPath As String = Application.StartupPath & "\\myDatabase.db3"
to this:
Public dbFullPath As String = "App_Data\\myDatabase.db3"
But I'm unable to open the database in a different place other than bin/Debug.
Thank you very much for your help.
In order to run the application outside of the visual studio environment you will need to copy both the x64 and x86 folders which are generated at build time
In Chem4Word we use the NuGet package SQLite 1.0.117 to read and write to a SQLite database which is deployed to C:\ProgramData\Chem4Word, but it could be anywhere in the file system to suit your purpose.
Our installer also deploys the contents of the above folders (x64 and x86) beneath the application folder in C:\Program Files (x86)\Chem4Word as shown below
The "seed" database is stored as an embedded resource, hence gets checked in to the repository.

How to use created sub folder in public folder on Play Framework 2.2.x

I created "xlsfiles" subfolder in public folder, and I used it folder for create xls file by request.
And when user send request to server to get this xls file I serve this file to client.
When I run project on Dev Mode all working perfectly, but when I run project on Production Mode not exist "xlsfiles" subfolder and I get "FileNotFoundException" exception.
Have any solution? How to make create sub folder in the project and create file in it?
Use Files class from standard Play framework API:
http://www.playframework.com/documentation/2.2.x/api/scala/index.html#play.api.libs.Files$

How can we access the files in the Data Folder when we publish the Vb.net application

I have added some files that I need to be downloaded to the Application start up path. So I set Build Action as content now the files have been copied some where
C:\Documents and Settings\TestUser.ANNAM\Local Settings\Apps\2.0\Data\HVDRBMY5.8AA\858AT9VM.TNP\test..tion_2d7cfc137d9c2c74_0001.0013_432bd4561850d290\Data
How can access file from the application. My problem since it is a dynamic path will it be same folder count so that we can use like ....\Data\ Some think like this
You can use My.Application.Info.DirectoryPath this will return the directory where the application is stored.

Move files to a specific folder when run the setup file for VB.Net Application

I have created deployment package for VB.Net appolication and it runs fine. When setup is rnning, I want deployment package to move a file from bin folder to other specific folder.
Please suggest, how can I move this file to specific folder.
Any help would be appreciated.
Thanks, Yogi
In Visual Studio 2008 setup project,
Select File System on Target Machine and then from Action menu select Add Special folder and then Custom folder. A new folder will apear on left hand side under the "File System on Traget Machine". Add files, into this custom folder, which you want to copy into into specified location,
Now go into the property of this custom folder and set the DefaultLocation where you want to copy files under this custom folder.
Now when you run the setup this file under the custom folder will copy into the specified location which you set in DefaultLocation.
Yogi..