How do I view form code history? - c#

I'm working on a C# desktop application for a class, using Visual Studio Online source control system. It gave me a choice of Team Foundational Server or Git, and I choose Git because I've heard of it and my professor recommends it. This is my first time using these features and I'm finding them a little confusing.
I can view the history of most of the files I'm working with, and revert to old versions, but I can't seem to do that for my form code. I think it has to do with what files are attached to source control, indicated by the blue lock icons.
Here's a screenshot of what I'm talking about:
I would like to be able to see the history of Production Buddy.cs, what am I doing wrong here? I can see Production Buddy.Designer.cs's history, so I may be not fully understanding what's going on here.
Thanks!

The screenshot shows there was neither red tick or blue tick. Which indicates that the file was not under source control. This happened may be because you copy pasted the file or the solution was on offline mode or solution file was updated when you took latest which replaced the entry of Production Buddy.cs file, and since it was not on the server there was no server history for that file.
I would recommend using Source Control Explorer when you have to compare the files.

Related

Visual Studio 2008 - C# Edits not showing in ASP Intranet Site/App

First of all, I am not a C# developer. Only briefly glanced at it once or twice. I mainly have worked with VBA for Office and SQL Server for coding.
In my role now, I'm asked to make a correction to an Intranet site/page/tool. The change (I think) is just a simple text change, which I already made and saved all the files containing the text. It was literally changing one string to another.
I made the file changes to all the files where the IIS says the app/site is located - where the files are located.
The changes do not show (it seems) in the actual tool/site.
Is there some way I can test it to verify the chagnes aren't actually showing?
Secondly, is there some way I can safely force the site/app to reflect my changes/edits?
I found this former discussion, but was not sure whether any of those suggestions would be relevant to my scenario:
Visual Studio. Code changes don't do anything
Thanks in advance for any hints or tips.

Advice on publishing VS MVC3 project to web server

As a company for years we have worked using old ASP (vbscript), we have just started updating to c# .net. our first MVC3 project is ready to be uploaded to the web server for testing and to iron out any bugs.
After reading about it I have made myself fairly familiar with the theory of it.
System.Web.Mvc
System.Web.Routing
System.Web.Abstractions
Have all been set to copy local 'true'
Right clicked the solution and selected 'Publish'
Created a new profile
Filled in the connection details, although I am unsure exactly what is meant by the 'Site Path' and 'Destination URL'
As it stands the site path is the scripting path and the destination URL is the URL as it would be typed into an address bar in a browser.
connection does validate.
in setting I have selected release
The there is a little tick box which seems scary to me, it says "Delete all existing files prior to publish" The server I am uploading to contains all our live and test websites, although I have created a new folder for the project, I under no circumstances want it to touch, edit, modify or delete anything else on the server. So this box is unchecked. Can anyone verify that leaving this unchecked will ensure it does nothing to anything else on the server?
Then in preview it simply says "Your application will be published to: (IP address of server)
Can anyone who has done this before give me some guidance this is the correct method to go? I could do it will less worries through a normal ftp but would like to be able to utilise Visual Studios tools. Its Visual Studio 2012.
Sorry if this isn't the exact correct place for this question.
After trying to do this for a while I discovered that publishing to ftp was a waste of time and the hard way to go about things. Although probably alot of you know this.
Instead I just published to a system file and then uploaded it with cuteftp to the web server. This maybe isn't the most professional way to go about things but from someone that comes from a primarily web scripting background, I found this alot less confusing and alot easier to manage.
I just thought I would answer my own question to resolve this thread.

How to avoid all code nodes to expand on project opening?

I have a C# project and some code pages have few thousand lines of code. I really like the idea of nodes in the code editor. I use it a lot and create many regions. But every time I open the project, all the nodes are expanded and I have to minimize them manually. It gets really annoying.
I have not found any help about this on internet nor in the options of VS. There must be a setting somewhere.
In the Options dialog onder Text Editor --> C# --> Advanced, there is an option "Enter outlining mode when files open". This should be checked.
In the IDE, from the Tools menu click Options. Alter default Outlining using
TextEditor->C#->Formatting->Advanced
There is a checkbox here you can use to set defaults for Outlining. This is VC# 10 Express but similar in other versions.
If you try the suggested change, you may be disappointed. According to this C# PM, who's responding to a similar complaint:
It is a bit confusing, but the
behavior you're seeing is intended.
The feedback that we received with VS
2003 was that we should persist the
outlining state of source files after
they have been closed and then
reopened. The option in Tools |
Option now effectively means what the
default behavior should be for a file
that you have never opened before. It
has no effect on files that you have
opened previously, since those files
already have a persisted outlining
state.
I don't want be a smart ass here, but often if you have that huge code in one file, you have more than one logical unit and might be able to (ans should) split it. (Single Responsibility Principle).
For my share, I don't like the regions because they are hiding code and I prefer to see all of it.

Visual Studio 2008 and C#

I'm an IT Professional with a background with developing ASP/VBscript/SQL web applications. I want to take some training and get up to speed with Visual Studio 2008 and C# so that I can take over a project at work and make updates/bug fixes in house rather than calling in a third party.
The web application I'll be working on was developed in Visual Studio 2005 with a mix of C# code and some Ajax.
When I load the source code into Visual Studio 2008 I received a warning that the Source Control Plugin wasn't installed. It's looking for SourceSafe which I don't have. Is this necessary to use?
I'm starting a training course in February called Introduction to Visual Studio C# 2008. Well this be adequate to get me going in the right direction to be able to update, fix, and make minor changes to our web application? This is a big opportunity for me and I don't want to blow it.
Thanks!
SourceSafe is a Software Configuration Management tool from Microsoft, and is not required. I WOULD recommend using some form of SCM, but flavor is a matter of preference.
If the pop-ups are annoying to you and you would like to disable them, then removing the SourceSafe bindings from the project should stop them.
From http://weblogs.asp.net/bkcarroll/archive/2004/03/08/86059.aspx :
Solution:
1 - Go to the folder containing the solution files and delete the following:
mssccprj.scc
MyProject.vssscc
vssver.scc
2 - Open MyProject.sln in your favorite text editor and remove the following section:
GlobalSection(SourceCodeControl) = preSolution
...
EndGlobalSection
3 - Go to the folder containing the project files and delete the following:
MyProject.vbproj.vspscc
mssccprj.scc
vssver.scc
4 - Open MyProject.vbproj in your text editor and remove the following lines:
SccProjectName = "SAK"
SccLocalPath = "SAK"
SccAuxPath = "SAK"
SccProvider = "SAK"
Now you can open the solution/project with no source control errors.
As far as the class goes, if you're already familiar with ASP/VBScript, you can probably pick up a C# class and figure out the rest. If not, I would suggest going for an ASP focused class that utilizes a C# back-end.
I would expect that a course named "Introduction to Visual Studio C# 2008" would probably not cover Ajax technologies, so you might want to look for some additional resources on that topic. (It might not even cover ASP.NET in significant depth, so I'd advise checking the syllabus, and if the ASP.NET coverage is weak then prepare for some additional learning on that topic as well.)
Re the Source Safe plug-in: you will need this if you want to work on the code base (so you can check in and out of the existing VSS repository). You will not need it just to browse the code.
Well James that is up to you. I am not familer with the course but if you apply yourself and pay attention I'm sure you can achive your goal. Do not be afraid to move beyond just course work to learn new things. There is a lot of information about Visual Studio on the internet.
SourceSafe is not required to use Visual Studio.
Learning the basics of VS will definitely allow you to update and fix your web apps. VS allows you to work with all the technologies you mentioned all in one environment. Although ASP/VBScript are "legacy" at this point, there is still support for them in the VS environment.
James I'd suggest that you look at the free resources (video and textual) available to you on ASP.NET. I would presume that once you've read a few tutorials and watched some videos + taken your training course you should be able to maintain the code base. Add in the fact that sites like StackOverflow have a large .NET community and there are always people willing to help.
Good luck

How to merge two source files easily?

I am working with another colleague in C# in VS2005 in a not very complex project. However, we have no version control system, we send each other our last version and copy the changes into our own files.
We now have to merge both files (most of the project is a single form file) into a last version of the project.
Any suggestions? Maybe trying diff tools? It must be done quickly and probably learning how to use complex revision control programs is not doable.
I'll spare you the lecture on not using version control, but your best bet is to try and use a differencing tool like WinMerge to compare the differences of the 2 files and manually merge the changes that each of you has made into a single file.
If you have the common file that you both started with before you each made any changes, then you can use a 3-way merge feature to generate a file that has both of your changes in it.
It was pointed out to me that WinMerge does not offer a 3-way merge, so refer to this other question for finding a tool that supports it.
We use BeyondCompare - we have found that to be an excellent compare and merge tool.
I understand the need for speed to produce your final version of the code now.
However, if you are planning to start another project it really is worth investing the time to set up a source control system. You'll save that time in spades over the course of the project!
Try SourceGear DiffMerge. Some members of my team even use it instead of the standard compare/merge tool from Visual Studio.
I think WinMerge is great for diffing and merging files.
However, I would definitely recommend that you get yourself some kind of source control system. CVS, Subversion, Git, Mercurial, whatever!!! It doesn't really matter which you choose, just get one. You will almost immediately get return on that investment in time, and you will also learn about something that is crucial in all serious software development.
Try WinMerge
WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
Because I just found this question while looking for something completely different, and noticed the assertion that WinMerge doesn't do 3-way merge.
This used to be true, but WinMerge is under new management, and has had 3-way merge for some time now. At the time of this post, the current WinMerge version is 2.16.2, available at WinMerge.Org (setup kits for 32 and 64 bit, as well as source code).

Categories