PhpStorm Project Settings per User? - settings

In my company 3 developers use PhpStorm for developing WebApps.
Everyone needs to open (not simultaneously) a project an other user created from time to time.
Let's say user A uses a deployment server named server A and user B uses server b.
User A created the project in the deployment.xml server A is saved.
Now user B needs to open the project and creates server B. Now server B is saved in deployment.xml
If user A want to reopen the project again, he has to set the server back to server A.
Same goes for the workspace.xml.
My question is if it possible to use different project settings for user A and user B?
If it is possible what do I need to change in my settings?
If not how can 3 users work together (no VCS)?
Thanks in advance

In the case where no settings are to be shared between developers, only the project files, PhpStorm accepts reading project files from a directory outside of the classical 'project directory'. Here is one approach to that; each developer is to:
Create and open a new empty project from PhpStorm, in a folder on the local hard drive. Only project settings will be stored here.
Open the Settings dialog, choose 'Directories' from the left pane, then click 'Add Content Root' (at the top of the rightmost pane).
Choose the folder on the network share that contains the project files.
Remove the original 'content root' corresponding to the project settings folder on the local hard drive.
Each developer can now open their locally created directory in PhpStorm, and any files opened/created will exist on the shared folder.
A related question: PhpStorm - How can I avoid creating the .idea folder?
Please note that working with files that are not on a local filesystem, especially when they are editable by multiple developers, is not recommended. Even for small projects, storing a Git repository on the network share, with each developer git pulling when beginning work and git pushing when done, is a small investment that will pay large dividends. Here is a good introduction: http://www.gitguys.com/topics/creating-a-shared-repository-users-sharing-the-repository/, but the key command is git init --bare reponame in the setup phase.

Related

TFS mapping to already existing code by multiple windows users

I have a solution containing a bunch of projects all under source control that is mapped to a local folder on a PC, but only for a specific windows user, say UserA.
Now if I log into Windows under a different user UserB I want to be able to use the same code with the same source control, without overwriting any local files (e.g. with the server version. There have been many local changes that haven't been checked in by UserA).
However when I open the solution file as UserB, I get an error saying:
The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control
(this applies to all projects)
The next message box gives me a choice between Temporarily working out of source control or Permanently removing the bindings.
Any attempt to Map the Server folder to the local folder will result in an error stating it's already mapped. Also I said I want to use the existing local code while keeping it under source control (e.g. so UserB can check in the changes and any more changes he makes)
What is the correct way to do this?
If I have understood you correctly, you want to use two users coding in same machine with source control.
You just need to create a local mapping of the source files to a different workspace folder. More detail step for your reference:In TFS, how can I share source files in different location, in same machine, without sharing the full project
Now you have two copies of your soucre files but with different workspace in your dev machine . When "User B" want to use these files on your machine, he just need to select the new workspace to work on it.
However, if you want userB to use the local file mappinged by userA(e.g. with the server version. There have been many local changes that haven't been checked in by UserA) It's impossible and also run counter to the rules of TFS. You must check in the local changes made by userA first, then get the lastest version from server for userB.
To share a workspace on one computer between different users, you need to change the advanced permissions of the workspace from Private Workspace to Public Workspace.
This can only be done by the owner of the workspace, which is UserA in your scenario. See the question How do I choose advanced workspace options? for more information.

TFS: Statuses for solution & projects invalid after moving folder

OK, so one or more of the references required that the solution be in C drive. I cut-pasted the solution from one folder in D drive to another in C, and bam, all TFS bindings went down the drain.
I've changed my workspace local folder to point to my new folder, so I'm not sure why TFS doesn't recognize it. OK, I admit I was working without TFS connection for a period of time, but now I would like to get some changes checked in. But when I go to File -> Source Control -> Advanced -> Change Source Control, it tells me that the Status for my .sln and .proj files are all Invalid.
I've tried unbinding and rebinding projects but this doesn't seem to work.
This is frustrating. Is there any other way than to delete and re-download the entire solution? Or is this a caveat of TFS, is there any file on my hard drive that defines my solution location? It's 10GB worth, I don't want to need to do this every time I move my solution, especially when I actually have all the files on my hard drive.
If I understand you right, you had your sources connected to TFS on your D: drive. For some strange reason you needed to move them to C: drive and you did this by using Windows Explorer (or any other not TFS related tool)? After that you changed your code and now want to check it in to TFS, but it denies it. Right?
The problem is that TFS didn't got any information about your moving and changes you made in the new location. This only works if you used "local workspace" setting when creating the workspace or if you changed your workspace to the new location and checked out the files there.
How I would "fix" this:
Copy/save your current code changes in a temp folder
Open VS/TeamExplorer and create/change your workspace to the location where you want your sources on C:
Do a "Get Latest Version" on your workspace, to download the sources from TFS and to update the workspace in TFS
Checkout all files in your workspace (checkout root folder with recursive option)
Copy your saved code from step 1 into your workspace
check in your changes (check in on root folder of workspace again with recursive option)
your sources are now linked to and stored in TFS
Under "Tools-> Options-> Source Control -> Environment -> Saving/Editing" set the value to check out automatically, so that VS will to the checkout for you automatically when changing a file in VS.

Visual Studio: Pre-Build add contents of directory to project

I have the following setup:
Main Website - MVC 3 project, to be hosted on www.domain.com
Intranet Web App - MVC 3 project, windows authentication, hosted on admin.domain.com, which is only accessible from within the local subnet.
CDN Website - A simple web app that merely serves images to both of the above. It will be hosted (publically) on cdn.domain.com, when we go live. I have set up a local project to mock the CDN during development.
I've written a business layer that allows users in the admin panel to upload images, which are then physically saved to the CDN path that's configured (currently on the local machine i.e. C:\Code\SolutionName\CDNProject\images). The main website then uses the same business layer to find and distribute the images via http://cdn.domain.com/images/. http://cdn.domain.com is currently set to http://localhost:55555, while we develop.
Whenever an image is created via the admin panel, it is physically created on disk. Each developer works on his own machine, we we want to be able to check these files in to TFS, for the time being. As you might have guessed, adding files to the file system does not automatically reference them in the project:
I thought there may be some way to reference these images as resources, or set a directory to a "content" directory of sorts... but I can't find anything.
Some developers work remotely via VPN, and do not have access to the local network (only TFS), so a network path is not an acceptable solution.
I thought I might be able to set a pre-build event up, to add all files in a directory to the project?
There is no very easy way to do that. There are a few ways to think about:
1) Write VS adding which adds new files to project (via DTE - starting point). Find out how to automatically run this VS addin on Pre-Build step. Install this addin to your developers machines.
2) Extend your admin logic to automatically check-in the uploaded files to TFS via TFS API
3) try to apply more sofisticated techonologies like this one: T4 Tutorial: Integrating Generated Files in Visual Studio Projects
Hope that helps,
Visual Studio project files have an XML syntax. Project file properties can be modified in a simple text editor (files added/removed, etc.).
You can create a script to open your solution, and before actually opening the solution, you can scan that directory and "inject" the files (with the appropriate XML tags) in the project files.
I don't think you can add this as a pre-build event because the project files are already loaded at that point, and you cannot modify them while they're used.

Can multiple Team projects point to the same source control in TFS?

I'm new to TFS so I'm trying to figure a couple of things out.
1) Are you allowed to reference the same code from multiple Team Projects?
2) How do you change the source control location for an existing team project?
The Server-Paths for each checked-in module has a format like $/TeamProject1/foo.cs.On the client-side, those files shall reside somewhere on the local HDD. The mapping between a $/TeamProject1/foo.cs & a local path C:/MyFiles/foo.cs is crafted by a TFS Workspace. Check here for an intro.To your questions:
1) Are you allowed to reference the same code from multiple Team Projects?On the server side: You can have branched, or simply commonly named source files, as in $/TeamProject1/foo.cs & $/TeamProject2/foo.cs, but those are surely different files.On the client side:Each locally mapped source control folder can only be correlated with one local path. In case you try to map both $/TeamProject1/foo.cs & $/TeamProject2/foo.cs into C:/MyFiles/foo.cs you 'll be denied the second time with something like that:In all, I think the answer to this question is a 'No'.2) How do you change the source control location for an existing team project?I suppose that you are trying to change the local mapping, for example from
$/TeamProject1 & C:\Folder\teamProject1 into
$/TeamProject1 & C:\AnotherFolder\TeamProject1
In order to do that navigate in VStudio to "File">"Source Control">"Workspaces.." then select your workspace & hit "Edit". There you can see the existing mappings and edit them.
Can you give an example of what you're trying to accomplish in question 1?
For question two, I'm assuming you're talking about where the code lives on a development desktop. For this, open visual studio and go to: File -> Source Control -> Workspaces. Then click Edit for your workspace. You can change the location here for each project you have mapped.
You can create a workspace that contains code from multiple team projects.
So, if I understand your first question correctly then yes you can do that. Technically the code will be in one Team Project but you can mix it into other Team Projects on your machine or build server using workspaces.
Are you familiar with workspaces yet?

TFS - dll is locked for check-out by user

2 projects under TFS Source Control.
DependancyProject.sln
AppProject.sln
With AppProject referencing DependancyProject.
-
The issue I have is with an Installer project in the AppProject.
It has DependancyProject.dll as a 'reference'(?) where it tries to include it in the GAC.
When I try to build this project, to create an MSI to install the App, I get the error
The item $/Assemblues/DependancyProject/bin/debug/DependancyProject.dll is locked for check-out by USER in workspace HIS-PC-NAME.
(The PC in question is not dead and not used)
The dll is not (as far as I can see) checked into Source Control.
The path it references anyway does not exist when I browse through it (no bin folder).
The DependancyProject is refernced by pretty much every project in Source Control, and i've never had any issues with it.
It builds, all the other projects build.
It's just this one Installer Project which doesn't.
And I can't see why it would need to try and modify it anyway.
All it needs to do (I'm assuming) is make a copy of it.
Any ideas here?
Some files are configured as "non-mergeable" in TFS, which means that they'll be locked when changes are pended on them. The default list includes a variety of binary files, including .dll files. Note that this lock applies to all pending changes - including adds.
It's likely that the other developer in question accidentally pended adds for his bin directory - and any binary files in that directory (ie, most of them) would have been locked as well due to being in that unmergeable list.
You will not be able to pend other changes (including an add in a different workspace) while these items are locked. To break this lock, the other developer can do this by undoing the pending changes, or a server administrator can do it using the Find in Source Control functionality in the Team Foundation Server Power Tools.
That said, I don't know why your build process is trying to pend an add on that file.
I had the same problem, and this guide solved all my problems.
The file was actually locked by me, but in a different work space (old computer).
Had to use the tf undo command to unlock the files.
If you are not going to use that workspace again, you can delete it by going to workspace pull down, selecting workspaces, and enabling the check box "Show remote workspaces". you can then select it and remove it.

Resources