How to View a Website in Visual Studio
Run an ASP.NET site from Visual Studio, choose the right browser and launch profile, view pages without debugging, and fix common startup problems.
To view a website in Visual Studio, open the web solution, select its launch profile and browser, then press F5 or choose Debug > Start Debugging. Visual Studio builds the project, starts the configured server, and opens the application URL in a browser. Use Ctrl+F5 (Debug > Start Without Debugging) when you want the page without an attached debugger.
Quick decision guide
| Action | What it does | Best use |
|---|---|---|
| F5 / Debug > Start Debugging | Builds, starts the selected profile, opens the site, and attaches the debugger. | Breakpoints, stepping through server code, inspecting variables. |
| Ctrl+F5 / Debug > Start Without Debugging | Builds and opens the site without debugger features. | A normal browser session with less debugging overhead. |
| View in Browser | Opens the selected renderable page. | Checking one page without changing the startup route. |
View an ASP.NET Core website step by step
- Open the solution. Start Visual Studio and open the
.slnfile, or open the web project directly. - Choose a launch profile. Use the debug-target dropdown in the toolbar. Typical choices include an HTTPS project profile, IIS Express, or a configured local IIS profile. The profile supplies the server and URL.
- Check browser launching. Open the project’s Debug properties and confirm Launch browser is enabled if Visual Studio should open a browser automatically.
- Start the site. Press F5 or select Debug > Start Debugging. Visual Studio builds the application, starts the server, and navigates the browser to the profile URL. Microsoft documents this workflow in its ASP.NET Core MVC tutorial.
- Open the route you need. Follow links or type a route such as
/,/Privacy, or your controller and action path into the browser. - Stop the site. Press Shift+F5 or click the Stop button. This stops the running debugging session.
Run without the debugger
Press Ctrl+F5, or select Debug > Start Without Debugging. The selected profile still determines the server and URL, but Visual Studio does not attach the debugger. This is useful when checking behavior closer to a regular user session or when you do not need breakpoints.
Open one page with View in Browser
In Solution Explorer, select a page that renders as a web page, right-click it, and choose View in Browser. The legacy Visual Studio documentation lists Ctrl+Shift+W for this command. It is not available for files that do not render as pages, such as Web.config. This action opens the selected page instead of necessarily using the project’s startup page.
Choose the browser Visual Studio opens
- Use the browser dropdown beside the launch profile in the toolbar and select an installed browser.
- For older web projects, right-click a page in Solution Explorer and choose Browse With.
- Select a browser and choose Set as Default if it should be used for this website.
With Microsoft Edge integration, Visual Studio builds the app, starts its web server, launches Edge, and navigates to the URL represented by launchSettings.json. You can use a different installed browser through the same profile controls.
Understand launch profiles and URLs
For ASP.NET Core projects, launch profiles are usually stored in Properties/launchSettings.json. They describe the server choice, application URLs, environment, and whether a browser should launch. A simplified profile looks like this:
{
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7043;http://localhost:5043",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Do not assume the port shown in an article or screenshot is yours. Use the URL from the selected profile or the address Visual Studio displays after startup. If several profiles exist, selecting a different one can change both the server and the page that opens.
Open the correct startup page
For ASP.NET Core, the startup route comes from the application’s routing and endpoint configuration. After the browser opens, navigate directly to the route you want to inspect. For older ASP.NET website and web application projects, the startup page can be configured separately; running the current page and running the startup page are different workflows.
Serve CSS, JavaScript and images
In an ASP.NET Core project, place static CSS, images and JavaScript under wwwroot, the normal root for website content. Reference those files from the page, then restart or refresh the browser after starting the project. If a file returns 404, verify its path, casing, and that static-file middleware is enabled by the project template.
Use breakpoints while viewing the site
Start with F5, set a breakpoint in a controller, Razor Page handler, middleware, or other server-side code, then navigate to the matching route. The request pauses when execution reaches the breakpoint, allowing you to inspect state and step through code. Continue with the debugger or stop with Shift+F5.
Refresh several browsers with Browser Link
Browser Link can connect multiple browsers to the running ASP.NET Core project, refresh them together, and provide a dashboard. It is useful for checking responsive or cross-browser changes while the application is running. Disable it if extra connections or automatic refreshes interfere with a specific test.
Common problems and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| F5 opens the wrong page | The wrong profile or startup route is selected. | Choose the intended profile, inspect its URL in Debug properties or launchSettings.json, then navigate to the required route. |
| No browser opens | Launch browser is disabled, or the project is not a browser-launching web profile. | Enable Launch browser in Debug properties and select a web launch profile. |
| The HTTPS URL shows a certificate warning | The local development certificate is missing, expired, or untrusted. | Use the HTTP URL from the same profile temporarily, or repair and trust the local development certificate using your team’s approved .NET tooling. |
| Port already in use | Another process is listening on the profile’s port. | Stop the other process, close a previous run, or change the profile’s applicationUrl to an available port. |
| 404 for CSS, JavaScript or images | The file is outside wwwroot, the URL is wrong, or static files are not enabled. |
Move the asset under wwwroot, correct the reference, and verify the project’s static-file setup. |
| Breakpoints never bind | The code path is not reached, symbols are unavailable, or the app was started without debugging. | Start with F5, confirm the browser request reaches that route, and rebuild the project. |
| View in Browser is unavailable | The selected file is not a renderable web page. | Open a Razor, HTML, or other page that the project can serve, or start the project and enter its route manually. |
| Browser shows an old version | Cached assets or a stale running process. | Hard-refresh the page, confirm the request is going to the current profile URL, and stop and restart the project. |
| Different browser than expected opens | Visual Studio’s selected browser or system default changed. | Use the toolbar browser dropdown or Browse With and set the desired browser as default. |
Performance and reliability while developing
- Choose the lightest workflow. Use Ctrl+F5 when you only need to inspect rendered output; use F5 when you need breakpoints and diagnostics.
- Keep profile URLs explicit. Stable ports make bookmarks, API clients, and browser tabs easier to reuse.
- Watch startup logs. Build errors, binding failures, and middleware exceptions usually appear in Visual Studio’s output or terminal before the browser can render a page.
- Test the same profile you intend to share. IIS Express, Kestrel project profiles, and local IIS can differ in URL, headers, authentication, and environment variables.
- Use direct routes for repeatable checks. A bookmarked route avoids relying on whichever page the startup configuration currently selects.
Or skip the browser setup
If you need a rendered image or PDF instead of an interactive local debugging session, ScreenshotNeo provides a website screenshot API and MCP server. It accepts one GET request and returns PNG, JPEG, WebP, or PDF. Before capture it accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
See the ScreenshotNeo API documentation for all options, including full-page capture, CSS selectors, device presets, custom CSS and JavaScript, waits, request blocking, authentication headers, cookies, geolocation, caching, signed links, asynchronous jobs, bulk capture, usage data, and PDF settings.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The MCP server includes take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Can I view a website without debugging?
Yes. Press Ctrl+F5 or choose Debug > Start Without Debugging.
Why does F5 use a localhost address?
The selected launch profile starts a local development server and supplies its application URL, commonly through launchSettings.json.
How do I open a specific page?
Start the project, then enter the route in the browser, or select a renderable page and choose View in Browser.
Where should static files go?
ASP.NET Core templates normally serve CSS, JavaScript, and images from wwwroot.
Can Visual Studio open more than one browser?
Browser Link can refresh multiple connected browsers while the project runs.


