How to i use TFS with Visual studio 2010 to simulate multiple users? - c#

i'm using VS2010 with free version of the TFS provided with codeplex. but i'm only working on one PC. i tried to simulate two users by opening two VS and login to TFS from two user names. then when i add a project from source control by file -> Source control -> Add project from source control and browse till i find the .sln file, the local path was always the same for two users. it didn't even let me change the local path. because of this when i made changes from one user it made changes to the local solution also it updated solution in codeplex but when i tried to get the latest version from the other user it always said the local solution was edited and asked to override it. but i need to update the solution in VS from the server not from the local folder. when i said NO to override then clicked checkout for edit, it never returned the updated version on server. is there away to fix this?
I need to simulate two user using two instances of VS2010. Is there away to do this properly?
thanks

You had it right in you post, login using another user, but when you create the local workspace make sure they point to two (2) separate folders. Don't point the workspaces at the same place on the disk that will not work.
So user A's workspace would be c:\A\source
User B's workspace would be c:\B\source.
All the files will be replicated in both location. Now if you modify a file in A's workspace and checkin, you'll need to do a get latest from B's VS to it's workspace.
If you modify anything in either workspace you'll need to check it in for the other user to be able to get it their workspace.
Hope this helps,
ET

You can:
1) log out and login as another user
2) use hyper-v locally in Win8+ and spin up another machine
3) spin up a VS trial machene for free in Azure

Related

TFS Show Latest on Top Level Folder

I'm working with TFS for a bit now and my question is about a function in the Source Control Explorer.
A sample Folder Structure for my Project might be this:
Project/MyControllers/Controller.cs
I change something in the Controller.cs and I navigate to the folder "Project" inside my Source Control Explorer. There it says at the Column "Latest", yes. Which in my opinion isnt right, because i changed something inside the folder. When i navigate into "MyControllers" it says that my Controller.cs changed.
Is it somehow possible to see the "No" at the "Project" level?
I dont know if its important by my Visual Studio Version is 2017.
Thanks for your help.
This is the correct and excepted behave. The Latest column is used to show the mapping status between your local file in workspace and the correspondingly server file. Which include value such as yes, no ,not download , not mapped. It will not influence either subfolder or parent directory.
Only when the name of "Project" folder has changed such as "ProjectDone" by others and checked in, it will show the Latest status of Project with "No". This is a point to point mapping status.
And you don't have to always paying attention to the file is latest or not. In other words, you don't have to and can't make sure always working on the latest version. When you working on a file and some others make same change during you local working. TFS will record the changes and let you solve conflicts when you perform the check in action.
Usually you just need to do a get latest of the workspace or top folder in the beginning of the day of work on a project.

How to check in (or upload) again a solution that i have on my local drive and manually deleted from TFS?

I'm using VS2017 and i have a solution on my local drive.
I had the same solution on my TFS as well, but i deleted it from the repository page manually.
Now if i want to check in the solution again i get a 'no pending changes' message, even if the TFS folder is empty.
I tried a few things but nothing seems to work.
I just don't know how to put these files on my TFS again and i can't find the help i need anywhere. Sorry if it's a duplicated question, i just can't find the answer to this.
Assuming you are using TFVC;
You need to sync (get latest) your local workplace with the server to see any further changes.
If you want to simply "restore" the solution, you can do an "undelete" through the source control explorer.
If do not want to revert your delete, you can get latest (which will remove any unchanged files) and then copy the "new" files over the same location. You will probably still have to and "Add Files" in the source explorer to re-pend them with TFS and then check them in.
In either case, make a backup of the files you are wanting to retain.
The simplest way is creating a branch from a Workspace Version, then check in the branch.
Please follow below steps to do that: (Backup the original project first)
Right click the project directory in Source Control Explorer >
Branching and Merging > Branch
Select Workspace Version for Branch from version By, then click
OK.
Check in the new created branch
Right click the Team Project name in Source Control Explorer and
Get Latest Version to sync delete the original branch (Backup it first).
Rename the new created branch to original one if needed.
Check in the changes
Check the remote server in page site, the project files/code will come
back.

Automatically Install Module/Extension in DNN (DotNetNuke)

Does anyone know if there is a way of automatically installing an extension on DNN using .net ?
It used to be possible using the infamous Install.aspx page, which has been removed for security reasons.
I've tried refactoring the code within Install.aspx so as to automate this, or even run it for a single module, but no luck. I've just got to the point where the zip has gets unpackaged, but what I really want is to know which and how the tables in the Sql Server database get modified.
I would appreciate any pointers on this.
It is quite hard to find all the tables that get updated, as well as the data that gets put into them.
My solution was is to simply call a copy of the installation page, which can be done from, say, a desktop app. For some reason the original Install.aspx won't run if you add it to the DNN installation. Step by step:
Find the Install.aspx and Install.aspx.cs files. They are deleted after the first installation, but you can get them from the original download.
Make a copy of these two files and rename them, e.g. MyInstall.aspx and MyInstall.aspx.cs
In Visual Studio run the DNN installation as a web site, not as a web project.
Now the page MyInstall will work just as the Install did. You can pass the parameters in the url.
Before you call the page, you need to put your module packages into the corresponding folder e.g. for modules install/module of the DNN Installation. To create the module package use Christoc's VS templates.

Excluding Files from TFS Server Workspace

We just implemented TFS in our company and I accidentaly included the bin and obj folders. I would like to exclude them. I searched on Google and found basically 2 ways to accomplish this:
1) https://msdn.microsoft.com/en-us/library/66tw9ezk(v=vs.90).aspx
In Visual Studio, open Solution Explorer and select the file to exclude.
On the File menu, click Source Control, then click Exclude from Source Control.
When you are ready to place the file under source control, you can access the File menu and click Source Control, then uncheck Exclude from Source Control.
In my File>Source Control, I don't see exclude from source control there or under advanced.
2) How do I permanently exclude the bin and obj folders from TFS 2012 checkin?
I tried adding a .tfignore and I couldn't find the 'ignore by extension', 'ignore file', etc. in teh Promote Candidate Changes dialog box. As far as I understand this is only applies to a local workspace and not a server workspace.
We set up the solution to checkout a file whenever it's altered, so when someone builds the project he acquires an exclusive lock on the dlls and then nobody else is able to compile.
After the steps Mike describes, you can go further and define an ignore rule. Undo the pending changes to the file you want to exclude and then click the "detected: 123" link that shows under "Excluded changes".
This open up a new window in which you can ignore these changes indefinitely. It does this by creating a .tfignore file and adding that to source control. The alternative to the UI is t create this file manually and checking it in. This should prevent Team Explorer from showing files that match the patterns in the ignore file.
Make sure that these files are deleted from source control, if they were checked in accidentally, you can destroy them to make sure they are truly gone. You'll need to do this from the commandline using tf destroy
The call to Destroy won't delete your local files when you use the remote itemspec to destroy them:
C:\>tf destroy /collection:http:
//jessehouwing:8080/tfs/DefaultCollection $/Scrum/test.txt.txt /noprompt
Destroyed: $/Scrum/test.txt.txt
C:\Program Files (x86)\Microsoft Visual Studio 14.0>dir "c:\Workspaces\Local\Scrum"
Volume in drive C has no label.
Volume Serial Number is 008A-AC5B
Directory of c:\users\jhouw\Source\Workspaces\Local\Scrum
12-08-2015 20:12 <DIR> .
12-08-2015 20:12 <DIR> ..
12-08-2015 20:12 0 test.txt.txt
1 File(s) 0 bytes
2 Dir(s) 297.229.512.704 bytes free
After performing a tf get /collection:http:
//jessehouwing:8080/tfs/DefaultCollection $/Scrum /recursive it will indeed be deleted. This should not be an issue if the files in question are regenerated during the next build.
See also:
https://stackoverflow.com/a/21260759/736079
If you're using a server workspace, the only way I can think of is to set a Forbidden Path checkin policy for your source control repo. It's a part of the Team Foundation Server Power Tools; you'd need to install the version of the power tools that matches your Visual Studio version on all developers' machines.
Note: these use Regular Expressions, so you'll need to adjust your pattern to match ;).
From my personal experience, the easiest way to achieve this is the following:
View -> Team Explorer (Ctrl+\, Ctrl+M)
Click on Pending Changes
In your Included Changes list, right click on the desired folder.
Click Exclude.
The excluded change should now appear in the Excluded Changes list below.

Setup Project Does Not Create File System Folders During Installation

I want to create personal folders during installation. I did the following steps:
Right click on your setup project ->
View -> File System
Right click on node “File system on
target machine” -> Add special folder
-> User’s personal data folder
Right click on node “User’s personal
data folder” -> Add -> Folder -> type
“My Personal Folder 1”
After deployment they it should in
users “My documents”.
I know the above steps are correct and should work because i did it in the other application (solution) and worked fine. When i did same exact steps (of course i changed the folder name to be created), the application gets deployed but when i install, i don't get the Personal Folder under Documents? I wonder why did it work with my first solution and didn't work with the current one!
Please help, i have no other options except asking. I cleaned solution, i rebuilt, i tried different things but no hope.
Use "always create" in the folder´s properties, otherwise it wont create empty folders during the installation
There must be some difference but there is no way we can find that.
Did you make sure there is no previous version installed? Upped the versionnumber(s) ?

Categories

Resources