How to choose which file to debug in Visual Studio 2012 prof - visual-studio-2012

Kinda stupid question, but I've only been using this IDE for two days now. I havent found anything in google yet and I figured that once in a while you're entitled to a stupid question:
I have a project (or solution as Microsoft chose to call it) with two .cs-files. When I click on debug, it's alwys the same file that opens. How can I get VS to open the other .cs-file?

It sounds like you have multiple static Main methods in your project. If that's the case then you have to set the startup object to the object that you want to run.
Right-click on the project in the Solution Explorer and select
Properties (or select Project >> Projectname Properties from the
toolbar).
On the Application form, select the appropriate value
for Startup Object.

Related

Activity templates disappeared from new project in Android Studio

Hi I am new to programming and wanted to create a new project in Android Studio for experimentation.
I wanted to start with the Empty activity which creates the Hello World program but suddently its no longer possible. The window which I get when I click
is compleatly different.
Instead of getting the window which lets me select the target API and activity type I get this
And from there It only lets me select project name and whether or not it creates the basic main main java method. No XML no nothing.
I dont know what happened
EDIT: I would like to add that I deleted .gardle yesterday once because it was a solution to another problem I had earlier
I solved this myself by resetting Android studio by deleting .AndroidStudio2.3
Resetted all setting which sucks a bit, but I rather have that.

Add existing project to blank solution in source control

I am trying to put several existing projects in one blank solution. This solution plus existing projects then need to be added to TFS source control.
Is there any way to achieve this? I simply am not able to find out how to get this done. Adding the project to a blank solution is relatively easy. Except it only places references to the existing project, rather than adding the files to the solution.
So when checking-in at sourcecontrol, it does not recognise the projectfiles as they do not get added to the solution, just references.
How can I get this done?
I managed to figure it out.
Add projectfiles of the project to be added to the solutiondirectory.
Add a reference to existing project (the one now in your solution directory).
In Windows Explorer, rightclick on the projectmap you just added and navigate to "Team Foundation Server" --> "Add".
The showing messagebox will describe which files will be added (they should be ONLY projectfiles, no bindirectory or anything).
Then reopen the solution in Visual Studio and the project should appear to be in source control.
Edit: The changes to show up in the pending-changeswindow, you just have to add them manually. They should show as "detected". Select these to be promoted and you should be able to check them in.

visual studio 2010 not opening projects

i just installed visual studio 2010 and it is not opening any projects .I can make projects but i can not add any file in it and also it is not opening recent projects.
I am stuck here , kindly cooperate with me!
OK, sounds like the installaion got munged up.
first obvious questions: do you have any code that has actually been saved?
If "yes," copy that code to an alternate location, and use the simplest solution: use the Windows Control Panel to deinstall the MSVC instance and reinstall. If no code saved, just de-install and reinstall.
That's the obvious answer. You may also check the location for the project files, and the settings Visual Studios uses.
from the toolbar, click "tools".
From the drop-down list select "options"
Within the displayed list, scroll down to "projects and solutions"
expand that list (click on the little "+" box)
3 locations will be displayed.
Make sure you have write permission to all three locations
all the check boxes should be selected. Especially the one marked "save new projects when created"
click "OK" to accept the changes

Visual Studio 2012 not recognizing all pending changes?

I'm working in TFS with my team for project and the problem occurs when I'm trying to make new modeling project for my classes, it doesn't show up in pending changes.
So here is how I go:
First I enter my folder where I keep my classes. I've tried from there many combinations: I've tried first right-clicking on my folder and putting "check-out for edit" and then continued to * (see later); next I've tried clicking on .csproj of my classes so I activate my project when I'll be adding modeling project and then moved to *; last I tried to activate whole solution of our whole projects which is connecting them and then to moved to *.
None of it worked. (I was always having last version)
here is what I did next for all the possibilities:
I went to Architecture -> New diagram (named diagram and left create new project) -> Create (then windows shows up for creating new project in which folder and I always select my folder where I keep my classes).
After when that was done, I went to check to "pending changes" in Team Explorer, because there should be some available since I created already Modeling project. But there was none. Since I couldn't do it like that, the last solution how I made it was by right-clicking to Source-control Explorer on my project and going to Add items to folder and selected my project which was created locally where I wanted it to be created.
But, this last solution was giving me errors while trying to open my modeling project after. I know I should activate first modeling project, so I clicked to .modelproj and while clicking to it, it was giving me this "notice" or rather "warning":
The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?
--
What am I doing wrong? Why solutions are not integrated by default while creating my project (my friends are doing it automatically, they don't need to right-click in Source Control Explorer to add item to be able to see pending changes)?
I hope I made myself understandable.
It looks like your solution binding is broken. Either click yes on the question to bind your solution to source control, this is information that must be stored in the solution file and while Visual Studio does see that the folder is mapped to source control, it also sees that your solution isn't (did you check the add solution to source control checkbox when you created it?)
Optionally try opening file -> Source Control -> (optionally) Advanced -> Manage Source Control. You can select project in your solution individually and then click the bind button on the toolbar to bind them to sourcecontrol manually.
I had a similar issue and, in my case, the solution was to right click on my project and choose Source Control->Go online. Apparently I must have somehow been switched to the offline mode.
I have successfully checked in files from source control explorer instead of solution explorer in this case. Then after that it has worked again
VIEW > Other Windows > Source Control Explorer
Other way to do it:
File--> Source Control --> Advance --> Change Source Control.
In the window displayed select all the projects you want to bind to the TFS
I had the same issue and solve it by clicking:
File -> Source Control -> Advanced -> Refresh Status
In VS2013+, you can check if your solution is online. In my case, due to VSO service outage, my solutions went offline. I had to open the solution, File > Source Control > Go Online.

Coded UI Test Builder cannot be started because the file '' is read-only

I have created an new UIMap in my project. I was able to work with it day before this error appeared. Now, when I right click on the new UIMap in VS (Visual Studio) and Click "Edit With Coded UI Test Builder" option - above error pops up.
I tried starting VS as admin, editing the .uitest file in the project folder (bad practice even if you know what you're doing) and saving it (it allowed me to do this), but still won't let me record using the new UIMap.
Additionally the original UIMap still works. I am using different names for UIMap if anyone is wondering.
I am using VS2012.
Any ideas would be appreciated. Thanks.
I have found the problem and A Solution for it, but not the cause. The properties of UIMaps .cs and .Designer.cs files were set to read-only. Please do let me know if anyone does find out what causes this and how to prevent this from occuring in the future.
My Solution:
Right click on the UIMaps .cs and .Designer.cs files in the project folder
Click on Properties
Untick Read-only tickbox
VoilĂ !
Thanks all.

Resources