Auto Merge Code from Shelfset in TFS - c#

Was working on new functionality in a code file... ManageTime.cs.
Had a bug fix request come in for a bug in the same file.
Used Visual Studio TFS to Suspend My Work.
Fixed bug in ManageTime.cs.
Now What?
Do I Check in ManageTime.cs, then can I resume my shelf set and will it handle merging the shelfset with the new feature code?
Afraid to try without some direction for fear of losing code.

Yes, if your team's policies say that you check in the code after your bug fix, go ahead and do that. If you aren't ready to check in or don't want to check in at this time, but are worried about losing work, you can always create another shelveset just in case (keep the Preserve Pending Changes box checked so you keep your bug fix changes).
Once you are ready, find and unshelve the shelveset. Just like getting the latest version from source control, VS will try to automerge the changes. If there's a conflict that it can't resolve, you'll get the same Resolve Conflicts window that we're used to seeing from time to time to manually resolve the conflicts.

Your assumption appears to be correct. Suspending your code essentially shelves the code along with a few Visual Studio settings such as window location, open files, and similar things. As long as you shelved (suspended) your in process work, then checked in a different bug fix, you should be able to merge with your updated source code once you resume and get latest version.

Related

Vs 2015: ReSharper 10.0.1 File Layout doesn't get applied

We used to arrange our Files with a Tool called NArrange.
Unfortunately, this doesn't get advanced anymore and thus doesn't work with the new C#-Expressions like String-Interpolation etc.
I'd like to use ReSharper for the arrangement and also tried to work trough the instructions: https://www.jetbrains.com/help/resharper/10.0/File_and_Type_Layout.html?origin=old_help
From what I've seen in them and in the VS, there is a default Template for every Type and the "Full Cleanup" should apply it.
But just nothing happens.
I also tried to change some stuff on the Default Layout and created my own Profile as suggested, but it keeps happening nothing.
Since I can't get any information from Mr. Google, I guess I'm doing something wrong, which is pretty obvious?
Got it: ReSharper can't make use of other Regions than the ones defined in the File Layout: As soon as a to ReSharper unknown Region is in the File, it seems to stop the whole process and just does nothing.

anksvn checkin file

I am using the most recent version of anksvn for a visual studio 2008 project file. I now
want to check this code into anksvn, but I am having a problem.
The situtation is, I checked in the most current version of code into anksvn. That is fine.
However I have another version of this code that I did not check out from subversion initially. This other copy of the code was for a 'demo' only. However now this code needs to become the production code. Thus I am trying to determine how to check this code into anksvn.
What I know I can do is to 'remove' the most curent code folder that is in anksvn. I could then place this project folder into that location. since the origianl 'demo' code also includes the current production code.
However I am trying to see if there is a better method to accomplish this goal. Could I possibly use the branch/switch option?
Is the demo code checked out of Subversion at all? I know you didn't check it out, but was it checked out? If it was, you could commit this code back into Subversion, then update your working directory.
It his code has nothing to do with Subversion, you will have to take a more complex route: You will have to copy the changes manually to your code.
Since you're using Windows, you should take a look at Beyond Compare, This is commercial code, but you can download a limited time demo for free -- more than enough time to handle your situation. I use Beyond Compare all the time to compare two different directories or Java jar files or zip archives, etc. It not only can quickly show you the differences, but makes it each to copy those differences from one to the other.
I have no relationship with Scooter software, the makers of Beyond Compare except as a customer.

How to remove previous user settings after settings upgrade?

After doing a:
MyApp.Properties.Settings.Default.Upgrade();
How can I remove any previous setting files? The problem I'm having is I have a function where the user can reset his/her own data using:
Properties.Settings.Default.Reset();
However on the next start of the application, since the old user settings are still there it will be upgraded again.
How do you keep user.config settings across different assembly versions in .net?
seems to be what you are looking for.
So use Upgrade, UpgradeRequired=true or false, and Save : it would be quite long to explain all cases, but it is in fact quite easy to figure out what to do.
Looks like there is no way to do this other than doing it manually yourself.
So after a successful upgrade, you can remove the old version manually using file system methods.

Visual studio 2010 empties the file on crash

I got a really bad problem while working on visual studio 2010. Accidently the power plug switched off and when I started the computer again the file was completly empty. I tried out following things:
I opened it in notepad and other couple of editors and it was empty.
I then opened it in Hex Editor. Hex editor shows that all bytes are set to 0.
I programatically read the file and it also showd all bytes set to 0.
Checked "Documents\Visual Studio 2010\Backup Files\" for my project and it was empty.
The file size is still showing in KBs but the code is completly gone.
Is there any possible way by which I can recover my code?
If there is not, can anyone suggest me a setting/patch taht should be there so that it never happens again.
Note: I already have Autorecover option set for every 5 minutes in IDE.
Update:
As suggested by Henok, If you have compiled and built the code at least once, you can reverse engineer the binary through reflector.
Doesn't look like it, to stop in future though, save and save often. Also look at using subversion like svn, or Git.
IIS has DLLs cached under C:\Windows\Microsoft.NET\v4.0.xyz\Temporary ASP.NET Files. Look for the dll and use a reflector. I use ILSpy.
Save often and use source control. I use C.V.S., personally.
It sounds like the I.D.E. had the file(s) open for writing at byte 0 when the computer went down, clearing everything out.
Beyond your software problems, I suggest you manage your power plug in such a way that it won't be accidentally switched off.
Same thing happened to me and thought I would post it here for those who would come here for answers.
If you have compiled and built the code at least once, you can reverse engineer the binary. Reflector did the trick for me.
Visual Studio still makes source files empty on sudden crashes, so I think I should share my solution.
Use any cloud file syncing service that supports file versions (for deleted files, too). Dropbox and Google Drive is what I can name. I randomly preferred Google Drive, though Dropbox can do all the same things.
I simply put my source tree in Google Drive, because it has file versions. My builds happen in Google Drive too, so there's much of unwanted traffic for big projects, but you can exclude some subfolders from syncing.
The drawback is that sometimes (in rare cases) Google Drive locks files and Visual Studio pops up "Save As..." dialog or some messages. You can usually close it, then save again successfuly. In very rare cases I had "The file is used by process" errors, and I had to restart Google Drive.

Releasing WinForm Program Updates

I'd like to release some updates for a WinForm program, but to date I have simply released an all-new compile. People have to un-install the old version and install the new version.
EDIT: I'm using an auto-generated InstalWizard. It preserves my file strucutre and places the [PrimaryProgramOutput] in a particular directory. I forget what this is called.
I bet there's a way to get around this, but I don't know what it's called. As you may guess, searches for "updates" "new version" "install" and the other obvious things I've tried have generated an impressive number of irrelevant results. >_<
I suspect this process has a particular name, which should point me in the right direction, but if it doesn't please link to a tutorial or something.
I see from the tags you are using C#. Visual Studio can create Setup projects for these kind of tasks. The setup projects als contain a property RemovePreviousVersion, which will remove a previous version if the versioning of your setup is correct and the GUID of the application stays the same.
See this link for more information:
http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
ClickOnce deployment is a great solution most of the time...
You can deploy to the web and when ever your users start the application it will check for updates and automatically update the application if there is a new version available.
It can also be configured not to update automatically but only to notify the user that there is a new version available and allow the user to control the update process.

Categories