0

My C# .NET console application opens my web browser when Debugging, as well as the console itself. How can I set the project such that only the console opens, and not the browser?

7
  • Do you have a web application project in your solution as well? If so, it will be your Build Configuration. Commented Dec 21, 2016 at 22:50
  • @Adrian The project was previously a web application, and was modified to be a console application. Perhaps there was a setting that was forgotten to be changed...? Commented Dec 21, 2016 at 22:54
  • So I assume you have changed your project's Output type to Console Application, but did you change the project's type guid from a Web Project to a Console Application? Commented Dec 21, 2016 at 22:57
  • @Adrian The project type GUID in .csproj.user was changed from Web Application to C# Commented Dec 21, 2016 at 23:08
  • In the .user file? What about the actual .csproj file. The user file is your local settings only. It might be conflicting. Commented Dec 21, 2016 at 23:20

1 Answer 1

1

The issue is being caused by the project type GUID of the project file still being set to a web application, even though the project output is set to "Exe".

The .csproj file (not the .csproj.user file) will need to be manually edited to change the project type GUID to {36761217-1D8E-4C0F-9A00-B86D9D12B086} so that Visual studio will recognise the project as a C# application and not a web project, and will therefore not attempt to open a browser when the project is debugged.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.