Debugging Web Apps in Visual Studio 2010 Is Annoying - visual-studio

I just starting working with Visual Studio and I find that debugging web apps is rather annoying. After making a change and clicking f5 it sends you to localhost:port/ however many times you are not editing localhost:port/ but you are editing localhost:port/someOtherFile, so you can see how this can be pretty annoying.
I am hoping that there is a way to optimize this. Ideally I would want to be able to hit f5 and have it just refresh whatever tab in my browser has localhost:port/whatever/youGetThePoint If this is possible it would make for some really nice debugging because many times you would never even have to click the browser.
Also, why do we have to hit shift+f5 to stop debugging. Why not just f5...
EDIT: I am using MVC2

In Visual Studio, right click on the file (Mypage.aspx -?) you want to start debugging with and select "Set As Start Page."
This will automatically open that page instead of root.

Click on your application in the solution manager
View -> Property Pages
Select the 'Web' tab on the left
Set 'Start Action' to a specific page.

You can select any page in the web project to be the startup page - once you click F5, the browser will start at that page.

Two things you can do:
You can set your web application to use your local IIS for debugging. I'm assuming you're using the standard settings that get setup whenever you create a new web app project.
To set your project to use IIS first make sure you have IIS installed on your dev machine. Select the web application project from the Solution Explorer and then right click. Hit the properties selection. The first tab on the right (build), should allow you to configure IIS to have an application for your project. It will eliminate the port number part and should be a bit easier to navigate around in.
Second thing you can do is find the page you want to go directly to and right click on it and set it as the start page ("Set As Start Page").
Also, you can Google for a Visual Studio macro that will attach to the IIS worker proc so you don't have to refresh what the browser is currently doing. You can also go to the debug menu item and select "Attach to Process..." and then find the worker proc and attach to it.

I believe Start Options might do the trick for you.
Right-click on the project, and select "Start Options..."
On the Start Options dialog under "Start action" heading, you may specify a page or start URL.

Related

How to leave iisexpress running after stopping debugging in Visual Studio 2015 Update 2?

Previously this could be done by unchecking "Enable Edit and Continue" under (Project) Properties | Web | Debuggers. This checkbox is not there in Visual Studio 2015 Update 2. The same checkbox including four sub-options can be found in Options | Debugging | General, but unchecking this no longer resolves the issue.
Same problem here.
My workaround for now is to add "Detach all" shortcut on the toolbar instead of the "stop" button.
The feature you're looking for is Start without debugging (menu: Debug -> Start Without Debugging or shortcut Ctrl+F5).
If you need to debug this process at any time you can use Attach to Process (menu: Debug -> Attach to Process... or shortcut CTRL+ALT+P). If you stop debugging on the attached process VS won't kill it.
PS. For me the bug you're referring to is a great enhancement (killing the debug process with stop debug command). Sometimes when issexpress hang (on SignalR for instance) and VS couldn't run a new debug session. It forced me to kill the process manually.
Not a fantastic answer, but a workaround.
Select your Web App in Solution Explorer, then press F4 to see the properties pane. In there, ensure 'Always Start When Debugging' is set to true.
If you have another IIS Express Web App in the same solution, do the same for that.
If you don't have another IIS Express Web App then create a minimal .Net web app without any code using the File New templates and set 'Always Start When Debugging' to true for that too.
Here is the trick, right click on the Web App project in Solution Explorer that you don't want to leave running (the one in step 2 or 3) and select 'Set as StartUp Project'.
Run your solution as usual, you'll get both of your Web Apps running. When you exit, it only detaches and halts the startup project which leaves your main app running.
Obviously a bug if they can leave the other Web App running. But at least this workaround will make debugging a little easier.
This bug have been Fixed in Update 3
Maybe this is not the answer to the OP question, but I use the "view in browser" option to achieve this.

Why am i not seeing the security tab in my Office Solution properties?

I recently published an office solution as a click once application on my one drive. My client downloaded it from there and when he tried to install, it gave him this error.
I want to republish it by making it a full trust application but i cannot find the security tab in project properties.
Thanks in advance.
I had the same issue and the solution was super annoying to figure out. Someone on another website mentioned that the Security tab is only relevant for certain types of ClickOnce applications so I started playing around with various options and figured it out.
In the Application tab, for Application Type, select Windows Forms Application from the drop-down menu (other drop-down options might also work but haven't tried them)
Save everything: In the main menu bar of Visual Studio, click File > Save All.
Close your project Properties window (i.e. the one with the Application tab that we were just modifying)
Open your project Properties window again: in your Solution Explorer, select your project, go to the main menu bar, click Project, click Properties.
Voila! It should be there. :)

Visual Studio - Web Development and Debugging

I'm doing some web development and when I push the debug button it starts off with the selected tab and it is really annoying because it will throw errors because those pages are not meant to be ran at first. Is there a way to have visual studio always run a default page first?
Right click the page you want to be the start page and select "Set As Start Page:"
Check out the Web Application's Properties Window, Web Tab. It has a box where you can enter the URL to load upon starting debugging.
That is; Right-click on the project item in the Solution Explorer, choose 'Properties', then click the Web tab, and select the proper option for your needs.
You can also right-click on your desired start page and select Set as Start Page.

Any good way to start 2 exes from VS 2008 IDE for debugging?

I have an exe that is a 'server' and exe that is its client.
I would like that when I hit RUN (F5):
server starts
client starts with debugger attached
Any good ways to do it?
If you have Multiple projects in One solution and you want to start more than one then,
Right Click on Solution ->Properties ->Common Properties->StartupProject->Select Multiple Start Up Projects ->Set the Sequence.(suitable For WCF like Scenario When Server and Client should start together, but in same IDE instance for debugging)
Other Ways
Right click on Project ->Debug->Select Start External Project-> Enter the Path.
Go To tools menu And click on Attach To Process.
Right click on the project in the solution explorer, thene select debug->run new instance

Visual Studio "Multiple Startup Projects" Problem

Background: I have a Visual Studio 2008 solution containing three different web application projects. If I right click on the solution, choose "Set Startup Projects.." and then choose "Multiple Startup Projects", I am able to fire them all up at once when I hit F5 (Start Debugging).
Desired Behavior: What used to happen (until it unexpectedly stopped working) was that it would automatically open up three browser instances (IE by default) and run each of the web apps in each of the three browser windows.
Current (Undesired) Behavior: All of a sudden, instead of opening three browser windows, it now opens a single browser instance and sequentially starts them all up with the exact same window/tab, which means that I am left with only one app actually running. (Whatever the last app it was that got started.)
Any idea what could cause this? I've checked my project and browser settings (including the "Reuse windows when launching shortcuts" option) and can't seem to figure it out. Any ideas?
Update: I changed Visual Studio's default browser to Firefox, and it works as expected by opening up multiple browser windows. I guess I'll just use Firefox when debugging for now, which is probably a good thing anyway.
I don't know why it had stopped working but rather have a suggestion: Check 'Don't open a page. Wait for a request from an external application.' option under 'Start Options' page of your Web project property pages. It specifies that Visual Studio won't open the browser window automatically. It should start your project in a Web server and wait for another application to make a request.
This seems to be a bug/feature in newer instances of MSVS and/or IE.
It happens in Visual Studio 2013 and 2015 as well, and might not be a bug as such, but can certainly be an undesired behaviour.
To reproduce:
Select 2 web projects in multiple startup projects.
Set one to Startup and the other to Start without debugging.
Only one browser tab is used, but you will see the tab used briefly by each project before the next one is loaded.
The problem is that the last loaded project is not necessarily the project you want to have in the browser.
An other workaround is to simply set both projects to Start.
It turns out using Firefox did the trick for me. Since there are no other answers, I will just accept this one.

Resources