VS2012 Debugger will not open browser when debugging ASP MVC project - asp.net-mvc

I am trying to debug an ASP MVC 4 project in Visual Studio 2012. However, once the code compiles the debugger stops completely, never bringing up the browser. I am able to run ASP.Net projects just fine from this computer, however this project doesn't seem to want to work.
With this project if i click on IIS Express in Notification area so it shows my website and if i click on it so then it opens up my site on browser but by default on debugging with Visual Studio it doesn't open.
I also tried to set my start up project but this also does not work????

Check this setting in your web project's settings and ensure it's not set to "don't open a page"

Related

IIS Express gets stuck and css styles sometimes not being applied when debugging an ASP.NET MVC application from Visual Studio 2013

I am debugging an ASP.NET MVC app from Visual Studio 2013. When I start the debug process from Visual Studio, IIS Express where app is hosted gets stuck (my app is not started). It often happens to me. In this situation, I manually stop IIS Express from the tray icon. Even stopping IIS Express from the tray icon I often need to stop manually the debugging from Visual Studio through the stop button. Once debugging is stopped, If I try to debug again it does not work, well, sometimes works and sometimes not, it is random. I have verified that if I clear all browser history and cookies, it works in most cases except for some time. Also I have observed that Visual Studio 2013 takes a long time to boot IIS Express where my ASP.NET MVC app is hosted. Finally, I have observed that my ASP.NET MVC app hosted in IIS Express sometimes is not being displayed correctly when debugging from Visual Studio, I mean, it is displayed without css styles being applied, it seems like css styles are missed. In this case, if I stop debugging and start it again it works.
So How can I improve or solve these kind of weird issues?
IIS Express gets stuck and css styles sometimes not being applied when
debugging an ASP.NET MVC application from Visual Studio 2013
This is a quite strange issue and l suggest you could try these suggestions
Suggestion
1) delete all caches under C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache, C:\Users\Administrator\AppData\Local\Temp and C:\Users\Administrator\AppData\Local\Microsoft\WebsiteCache.
2) close VS Instance, delete .vs hidden folder,bin,obj folder under the physcial path of the solution and then reopen your project
3) If you have IntelliTrace, please disable Enable IntelliTrace under Tools-->Options-->IntelliTrace-->General.
4) try another port like 56000 by right-clicking on the project-->Properties-->Web--> project url.
5) disable any third party extensions by Tools-->Extensions and Updates or just use devenv /safemode in developer command prompt for vs2013.
6) try to reinstall IIS on the control panel and if your IIS is not 10.0, I suggest you could download and use it.
In addition, VS2013 is too old and Microsoft does not continue to maintain it. So l suggest you could download and use the latest VS2019. It has more optimization and stronger performance than the previous VS and fixes some remaining issues from previous releases.

Uploading file in MVC project under Debug forces program to exit debug mode

So, I create new empty/MVC project, add simple controller and view for uploading file, lauch program under the Debug mode and trying to upload file.
After selecting file (immediately, right after chosing the file in explorer!) program exits debugging and I'm getting 404 in my browser.
When lauching project without debugging everything works good, but this is not a solution... what if I need to test uploading exactly in the Debug mode?
In ASP Core I'm getting the same issue.
I've tried different variations of code, including version of A. Freeman, published in his book "Pro ASP.Net MVC 5" - nothing works.
This is a bug of visual(I am not sure). You can fix this by change keyboard of visual studio to Visual C# 2005. You should run in Chrome, Firefox or Microsoft Edge. Others browser is not compatible.
You can find keyboard settings in Tools -> Options -> Environment -> Keyboard
Change setting to Visual C# 2005 -> Ok. Restart computer or visual studio. It will works!

Visual Studio 2015 opens file from inetpub instead of local file while debugging

I've got a problem while attempting to debug my ASP.NET MVC site in Visual Studio 2015. Don't think it matters, but it's a Sitecore MVC site.
I deploy locally to an IIS 10 website. I place a breakpoint on my cshtml view. I attach to the w3wp.exe process. When the proper page loads in the browser, Visual Studio opens up another tab that contains my view, but the path to it uses the 'inetpub' path. So instead of opening '\vs\code\mysite\views\myview.cshtml', it opens '\inetpub\wwwroot\mysite\views\myview.cshtml.' While both tabs are open, I can see that my breakpoint is only on the inetpub version and attempting to set a breakpoint on the 'local code' version results in Visual Studio switching to the inetpub version. (doesn't allow me to set a breakpoint on the local code version)
So, the breakpoint is still hit, but I don't have intellisense in my immediate window. After stopping debugging, I'm left with two tabs with the same view and have to figure out which one to modify before deploying again. Larger issue is that I don't have intellisense, but I suspect this is due to this issue of opening the wrong file. Note: I do have intellisense during the same debugging session for another library project that is further down the execution path.
Feels like a VS configuration issue, but I have been unsuccessful in locating what the issue might be. Anyone seen this behavior before?

VS2010 Debugger will not open browser when debugging ASP MVC project

I am trying to debug an ASP MVC 3 project in Visual Studio 2010. However, once the code compiles the debugger stops completely, never bringing up the browser. I am able to run ASP.Net projects just fine from this computer, however this project doesn't seem to want to work.
This turned out to be a result of no start up project being selected. Simply going to Solution > Properties > then selecting a start up project fixed the issue.

In Visual Studio 2010, how do you invoke the "View In Browser" feature on an MVC app?

In Visual Studio 2010, you can right-click an aspx page in a web forms app, or on the web forms app itself in the solution explorer, and you get "View in Browser" in your context menu.
In ASP.NET MVC projects, this item doesn't seem to be available in the context menu. The only way I know to run the app is to set the MVC app as a startup project and hit CTRL+F5. But, if there are two MVC apps in the solution, this doesn't really work. How do you accomplish this for mvc apps?
You really can't.
Routes are determined at runtime. There is no way for Visual Studio to know what View its going to use until routes are added, controller actions are hit and the ActionResult is executed.
You can configure your web applications to use IIS so you don't have to hit F5 to run them. The IIS process will automatically start the web site for you. It's such a time saver!
Right click a web project and choose Properties
Go to the Web tab and choose the "Use Local IIS Web server" option.
Enter a url like http://localhost/MyProject
Rebuild.
Navigate your browser to the url you entered.
If you want to debug your website, you can go to Debug > Attach to process..., then attach to w3wp.exe. This will attach to all web apps within your solution. (You might have to select the show processes from all uses option.) If you've just rebuild, you have to reload the site before IIS recycles and the breakpoints turn solid red. (If the breakpoints are ever only outlined in red that means the code running in IIS is an older build than what you are seeing. In rare cases you may have to kill the IIS process, but cleaning and rebuilding usually clears this up for me.)
Note: you'll probably have to go into Window's Programs and Features control panel and enable the IIS features. VS should prompt you if these aren't configured already.

Resources