Make notes in Visual Studio, but not in source code - visual-studio

Is there a tool that will let me add/attach/associate notes to lines of code in Visual Studio 2013, but does not go into the source code.
Think of post-it notes sitting on some papers I'm working on, helping me keep track of some things I need to do, when I'm done I take them off.

Try the Visual Studio Task List
http://msdn.microsoft.com/en-us/library/txtwdysk.aspx
You can add items to it as needed, or add special comments in your code such as
// TODO: Do this later
Which will also show up in the task list.

What I usually do, if I don't want anything in the source code, is add a textfile to my project. You can do this by clicking:
Project -> Add New Item
And select Text File under General.
This way your notes are attached to your project to keep it central, but there is nothing actually in your source code. Maybe it helps.

Related

Issues removing sourcecontrol bindings

I want to migrate a lot of projects from Clear Case to TFS2015 via the "add to source control" option of VS2015.
I started out with this How to transfer a project from ClearCase to TFS? SO question and its answers.
This works out fine for most of the cases but in some cases the clear case reference seems undeletable. Whenever i go right click on my solution and want to add it to source control it gives me a clear case error "Project must be in a view". When i inspect File -> Sourcecontrol -> Change source control i can see no binding to clear case and when i first opened the solution i took the option "permanently remove all source control bindings from this project"
So my question is, are there any further references to a solutions/projects source control other than the "scc" nodes in the .proj files and how can i delete them so that i can add it to my TFS?
I just found the answer myself:
First: do the same thing you did with .proj files with the .sln and remove the entire globalsection about sourcecontrol.
Second: go in Visual Studio to Extras -> Options... -> Source Control and there change the plug in from clearcase to TFS.
Finally: profit
I didn't bother checking this before because like i said this occured randomly and I don't know why when i started to migrate the plug in was always selected as TFS and then, after some projects, changed to clearcase... anyways i will let this question up here for someone who may run into the same issue since i did not find very much online about this topic.

There appears to be a discrepancy between the solution's source control information about some project(s) and the information in the project file(s)

I get this error message in a Reporting Services solution in Visual Studio 2010 [we're using TFS for source control]:
There appears to be a discrepancy between the solution's source
control information about some project(s) and the information in the
project file(s).
To resolve this discrepancy it will be necessary to check out the
project file(s) and update them. If the check out fails, however, and
the solution is closed without saving, you will see this warning again
the next time you open the solution.
Only some projects get checked out but others seem OK. So here is what I tried:
I tried to compare what might be different between the project
files that work and don't work but nothing catches my eye.
I looked around and tried a
number of proposed solutions like "adding a file, checking in and then removing
it and checking in". No luck.
I tried to look for "Scc" tags in project files
but I don't see any in there. I also don't see them in projects that
work fine. Looking at my solution the Scc entries look reasonable.
Help!! What am I missing?
Using Visual Studio you can solve this problem by unbinding and binding the solution and/or projects. Try this:
Open the problem solution in VS (did this in VS2013 just now)
Undo all pending changes to all the projects in that solution and the solution itself
Go to File -> Source Control -> Advanced -> Change Source Control
Select the problem projects and click "Unbind"
Click OK and close the window (THIS IS IMPORTANT - if you don't click OK VS doesn't update the solution properly)
Go to File -> Source Control -> Advanced -> Change Source Control
Select all the projects you unbound in #4 and click "Bind"
Click OK and close the window
Check In Your Changes
Close the solution and open it back up and everything should be fine now
Experienced the same problem in VS2015.
I found this workaround worked for me:
Change < Scc* > tag values to "SAK" (Should already know) in the project files:
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
https://connect.microsoft.com/VisualStudio/feedback/details/616751/discrepancy-between-the-solutions-source-control-information-about-some-project-s-and-the-information-in-the-project-file-s
Workaround #3
There was 1 person on our team who was doing the conversion to TFS from VSS who didn't have any errors. He never checked in his solution so we never saw it until now. I looked through his solution file and there are differences. I found the following differences for each project in "GlobalSection(TeamFoundationVersionControl) = preSolution":
Our NETReports.sln in TFS (the file that gave the error above):
SccProjectUniqueName7 = EllinReports\\DiagnosticReports\\DiagnosticReports.rptproj
SccProjectName7 = EllinReports/DiagnosticReports
SccLocalPath7 = EllinReports\\DiagnosticReports
His NETReports.sln (the file that DOESN'T give the error above):
SccProjectUniqueName7 = Reports\\DiagnosticReports\\DiagnosticReports.rptproj
SccProjectTopLevelParentUniqueName7 = NETReports.sln
SccProjectName7 = Reports/DiagnosticReports
SccAuxPath7 = http://<server>:8081/tfs/dev
SccLocalPath7 = Reports\\DiagnosticReports
SccProvider7 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
I guess it all makes sense now. We were all missing the SccAuxPathXXX, SccProviderXXX and SccProjectTopLevelParentUniqueNameXXX. Having them made the difference.

Broken Intellisense in One VS2010 Project

I have a solution that contains several projects, and all but one project loads full intellisense. The one project left is a C# class library and does have some intellisense, so I still get simple syntax and structs, but nothing useful like ObservableCollection, Go to Definition, list members, or parameter info. I can't even get intellisense on the properties in the current class.
Is there a log somewhere of what error caused intellisense not to work that would help me in this case?
Here is a list of the things that I have tried and have not worked for me:
Restarting my machine
devenv /resetuserdata
Tool -> Options, Text Editor -> All Languages -> Auto list members is selected
I gave up on the project and started a new project file, which worked. The only thing I can figure is that the project file got corrupted. When looking at the differences between the old file and the new file, it looks likes the structure encompassing many of the files was changed, possibly a difference between VS2008 and VS2010.

How do I show the References folder in Solution Explorer without selecting 'Show All Files' in a VB.NET project?

As I compare many C# example projects to my VB.NET projects, I see that the References folder shows in the Solution Explorer without having to select "Show All Files". Is it possible to have this for a VB.NET project as well? I find that it would be very helpful to have this folder displayed without having to see all the other hidden files as well.
I'm using VS2010 Professional.
This adds to my list of reasons why I should have learned C# first...
I guess I will have to definitively crush your dream. Sorry. It has been a decision by Microsoft to remove this from the default view to reduce the 'clutter'. However, your 'Show All Files' setting will persist when you save your project. So if you show all files once and then save, then it will always be on.
You can also see your References in the Project designer, which you can always keep open in a tab.
As of Visual Studio 2015, this behavior has been changed to show the References folder without selecting Show All Files.
From MSDN:
What’s new is the References node. This used to be hidden and you had to click Show All Files to see it—but that also showed lots of irrelevant files.
This previous behavior might have made sense 10 years ago when you’d start with a Windows Forms project and it would generally have the right set of references. But it’s a reality of modern development nowadays that the References node is used frequently—especially to manage NuGet references. It’s a small but handy convenience to be able to find it easily in Solution Explorer.
I add a separate folder called Dependencies, add my dll's to it and check them in as described here. That way my dll's are always visible in the Solution explorer without having to turn on Show All Files.
Select 'Show All Files option' in the solution explorer.

Adding a new project to an existing solution in TFS

I added a project to an existing solution that is currently under source control using TFS, but for some reason I cannot check in the new project. When I view my pending changes, none of the files in the new project show up. None of the files have a plus (for a new file) next to them. What did I do wrong? How do I fix it? It's time to check in.
The problem is the solution has lost its binding. That's why it's not checking out automatically when you add the new project.
In order to restore the binding in VS 2010, go to File->Source Control->Change Source Control. Look for the "Solution: your solution name" and if it's not bound it will say "no server". Click on it and then click "Bind" from the toolbar.
in Visual Studio 2012/2013 it's File->Source Control->Advanced->Change Source Control (Thanks to danglund).
This should create a new vssscc file that is correctly bound. Now add the new project and everything should work correctly.
I was also having the same problem, this is how I fixed it:
Go to Visual Studion: File->Source Control->Change Source Control
Find your project there, its status would be "Invalid", Click on it and press "Unbind". Now go back to Solution Explorer and Remove your project. Add this project again into the solution explorer solve the problem.
Good Luck!
Click on the Team Project name in Source Control Explorer
File -> Source Control -> Add Items to Folder...
Follow the wizard.
Head over to Source Control Explorer and browse to the place in the tree which matches where the new project is at for your solution. Add the files there.
However, I'd be concerned that you modified the solution file and it didn't ask you to check that out. What you may want to try doing is manually checking out the solution file, then readding the project to the solution and seeing if it takes then.
You shouldn't need to drop to the command line - this is a pretty straightforward operation.
Open the solution. Select the project (make sure it is in the solution).
File -> Source Control -> Properties will bring up the binding dialog.
Bind the project to source control.
You should now see + signs next to all your files. The key is that that a .vssscc is added for your project to version control.
If that fails, open your csproj in notepad (after making a backup), and ensure any version control bindings are removed, then try again.
Unfortunately, I'd wager that your best bet is to manually do the check-ins through the command line. I've ran into situations where the Team Explorer UI grows out of sync with what's actually happening in source control, and manually fixing things through tf.exe was the only way to resolve it.
That said, normally, adding a new project to a solution isn't a hassle.
TFS can simply do not know about your project existed. Just add your project files through Source Control Explorer and re-load the solution.
While loading of a solution it can ask you to bind your project to source control. Let it do so by clicking Bind button - it should do all the magic for you.
Make sure you get the latest version of the solution
Check out the solution file
Add the new project
If the newly added project was previously under (another) source control, that might mess things up, make sure to "unbind" it before adding it. (See source control bindings somewhere under the "file" menu in Visual Studio)
You shouldn't need the command line.
I had this same problem in VS 2019, where I had added a new project to an existing solution, and the project wasn't showing up in pending changes. Right-clicking on the project and going to Source Control only had an option to "Add Solution to Source Control".
Using the above answers, I started down the File --> Source Control path, which then yielded an option to directly "Add selected projects to source control". Taking that option solved the problem, so that now the new project shows up in pending changes. NOTE: I'm adding this answer since it's still an issue in VS 2019, but has an easier solution now than in the past.

Resources