How to fix browser not opening in debug mode? - c#

I am unable to start my web add-in in google chrome or any other browser I clicked on start button which have written IIS Express instead of start it goes into debug mode after clicking the button but nothing happens.
Here is screenshot before starting :
after start mode :

One reason is the your visual studio is not run as ADMIN. You must run visual studio with Administrator Privilege's - to do that on the short cut icon of Visual studio, right click and "run as administrator" - or for permanently check that go to Properties, Click Advanced, then click "Run as administrator" - When you run it this way you see a Label "ADMIN" on the right up corner of the VS.
Now if this is not work, alternative you can run get into the debugger using this call System.Diagnostics.Debugger.Launch();
Create an empty page and make this call on PageStart, then just load this page from your browser
System.Diagnostics.Debugger.Launch();

Check this setting in your web project's settings and ensure it's not set to "don't open a page"
and the reason behind the HTTP Error 403.14 - Forbidden error is the directory browsing feature is turned off. you can enable by following below steps:
Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt:
C:\Program Files\IIS Express
Type the following command, and then press Enter:
appcmd set config /section:directoryBrowse /enabled:true

In VS2022 you can check/uncheck a flag to launch the web project in the default browser.
To do this, right click on the relevant project in your solution and click Properties. In the menu on the left click Debug, then 'Open debug launch profiles UI'.
In the dialog which appears, select the relevant profile on the left pane, then scroll down to 'Launch browser'. Check/uncheck this option as required.
Alternatively, open the Properties/launchSettings.json file within the project and add the following line under the relevant profiles entry:
"launchBrowser": true,

Related

How do I set the default browser in Visual Studio 2017?

I don't have the stupid Browse With, and every time i figure out where it's out it only gives me options for Internet Explorer... It doesn't give me an option to change the browser... Strange enough I've already removed Internet Explorer from my PC... How is it still using it...
"Browse With" is still available
You should be able to select the browser you want from the next window, its self- explanatory.
Try this out
First you have to install google chrome
Then go to visual studio and you can see a attach button with combo
on the top of the window
Click the combo to select the browser
You can see a window of attach process
Their you can see a available processes grid and select the chrome
browser
Go To Project
==> open folder
==> select file (ex: sample.aspx)
==>left click
==> select Browse with
==>Select Chrome
==>Click Set As Default
It works

Visual Studio 2012 "Unable to start debugging"

I am trying to host web services with IIS Express on my local machine. I can start debugging one time. Every time after that I get a dialog box with "Unable to Start Debugging" whenever I try to run the project. If I shut down VS 2012 then open back up it works one more time. I see the issue in this post.
I believe it has something to do with my password changing a few days ago. However, I can't find where my credentials are stored and I have no idea how to change this configuration. Please help!
UPDATE:
Turns out the same thing happens if I try to run a local console app. This means (I think) it is a VS setting somewhere. I was having to shut down VS and restart it every time. However, I did find that if I shut down these tasks and then debug it works:
Any ideas?
It appears from your screenshot that IIS Express is not shutting down when you stop debugging. This is actually a setting in Visual Studio called “Enable Edit and Continue”. When enabled, IISExpress will close when Debugging ends and if disabled IISExpress will remain open.
This setting is normally set on by default in Visual Studio 2013, but actually defaulted to off in versions prior, including 2012, which you state you're using. You probably want it ON.
To adjust globally:
Open Options dialog box by clicking Tools -> Options
Click Debugging -> Edit and Continue
Toggle "Enable Edit and Continue"
You can also turn adjust on a per project basis.
Open properties for web project
Click Web tab
Toggle Enable Edit and Continue" under Debugger at the bottom of this page
Further reading on MSDN here:
https://blogs.msdn.microsoft.com/webdev/2013/07/11/enable-edit-and-continue-debugging-option-is-now-on-by-default-for-new-web-applications-in-vs2013-preview/
First Check the Identity settings
Update your credentials in the "Identity" setting, under IIS/Application Pools.
if your password had recently changed, the "Identity" might still set to your old credentials.
OR
Reset Visual Studio Settings
reset visual studio settings and restart it again.
On the Tools menu, click Import and Export Settings.
On the Welcome to the Import and Export Settings Wizard page, click Reset all settings and then click Next.
If you want to save your current settings combination, click Yes, save my current settings, specify a file name, and then click Next.
—or—
If you want to delete your current settings combination, choose No, just reset settings, overwriting my current settings, and then click Next. This option does not delete default settings, which will still be available the next time you use the wizard.
In Which collection of settings do you want to reset to, select a settings collection from the list.
Click Finish.
OR Check Truely Reset VS

Error while trying to edit code in debugging mode in VS2013

I'm a C# programmer and recently I've installed Visual Studio 2013. The problem is when i set a break point or get an error and trying to edit the codes while debugging I get this error and I couldn't find the same error searching on Google.
Changes are not allowed for this module as it was not built for
changes while debugging or the target .NET runtime version does not
support it
I also tried to check the options on Tools -> Options -> Debugging -> Edit and Continue, But didn't help.
Any idea what the problem is?
To edit a C# program while you're running it in Visual Studio 2013:
Go to Project, Properties, Build.
Set Platform target: x86
Disable "Optimize code"
Set Advanced, Debug Info: Full
I came across the same issue and found that "solution configuration" on the top bar was changed to Release from Debug,because I build the last version into Release folder.Changing back to Debug mode will solve the issue.
The code your probably modifying is included in the exception. Since, your code is not posted here, I can't say. So please refer to this link and check whether it is really not allowed.
We just had the same issue in Visual Studio 2013 and in our case it was because we had disabled the Visual Studio Hosting Process on the Debug tab in Project Settings.
You can try
Right click 'Solution' in the Solution Explorer.
Select Properties.
Choose Configuration Properties from the left menu.
Select 'Debug' from the dropdown list in the upper-left corner labeled 'Configuration:'.
I just had the same problem and found a solution that worked for me right here after trying 100 other things:
https://stackoverflow.com/a/12543388/5367013
1.) execute VsPerfCLREnv /globaloff
2.) reboot your computer
In a Web Forms application, I initially received the "Changes are not allowed for this module as it was not built for changes while debugging or the target .NET runtime version does not support it" error message. Based on suggestions above I completed the following:
Right click the project name, just under the Solution name in Solution Explorer and select Properties, the "Build" tab
Set Platform target: x86 (Note, for me this was already set)
Disable "Optimize code"
Click the “Advanced” button (near bottom) and set, Debug Info: Full
I tried to modify code, but then I received the "Edit and Continue" window stating "Changes are not allowed while code is running."
Here was the important part: I can only make changes while stopped at a breakpoint. If the page is loaded, I get that same "Changes are not allowed..." message. So set a breakpoint to a line above where you need to make the change, complete the update and you should be set.
Or (as I subsequently discovered) another way to modify code without using a breakpoint is to click in Visual Studio "Debug/Break All" (Ctrl+Alt+Break), make your change and then press F5 or click the "Continue" button. (Using this method you will might need a page refresh to see the mods.)
It worked for me by unchecking "Enable optimizations" option.
Please refer below image for more info.

Is this message an error?: "The Operation Can Not Be Completed"

I've got a very simple Solution with a single Project in it.
The project is just a simple WinForms, a config file to connect to sql-server, and 2 class files.
I've published the WinForms into production and it is working ok.
If I now open the Solution in VS and select the WinForms and press F5 I get an message "The Operation Can Not Be Completed" and the Winforms does not appear.
If, instead of F5 I use "Start Without Debugging" then it appears ok.
Should I be concerned about this message? If I should then how do I track down the reason behind it?
EDIT
Here are the debug options I have available:
YES! That is an Error Message!
In the Debug tab of YourProject there is a debugger option for "Enable the Visual Studio hosting process".
for more info check
http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/

Disable Publishing in MSBuild

I have an application that I wrote in C# and build in VisualStudio. One day I was exploring the 'publish' tab in the project properties section just to see what it did. Now everytime I build my application, I get a whole bunch of files related to ClickOnce installers (*.application, *.deploy, etc.) that I don't really want anymore. How do I disable or otherwise stop these items from appearing when I build my project??
I solved the problem by unchecking 'Sign ClickOnce Manifests' in the 'Signing' tab as well as 'Enable ClickOnce security settings' in the 'Security' tab.
For WinForms Windows Application
Go to: Project > Properties > Security
Then uncheck 'Enable ClickOnce security settings'
2 ways to do it,
Go to the web project and click on properties, go to the 'Package/Publish Web' tab and uncheck the option
Over ride it from your build definition, click edit on your build defination, go to process tab and expand advanced and pass the following argument /P:CreatePackageOnPublish=false
HTH
Cheers, Tarun
In vs 16.5 go to project=>properties=>package/publish and enable it.
Web Deployment Overview for Visual Studio and ASP.NET

Categories