# Microsoft.VisualStudio.Web.BrowserLink

**Kind:** Service

**Source:** `Pams/Web/Pams.Web/Pams.Web.csproj` (line 1)

**Part of:** [Pams](subsystem-pams)

NuGet package dependency

`Microsoft.VisualStudio.Web.BrowserLink` is a NuGet dependency in `Pams.Web` that supports Visual Studio Browser Link during local web development. It connects the running ASP.NET application and open browser sessions so development tools can trigger browser updates.

## Diagram

```mermaid
sequenceDiagram
    participant Developer as Developer
    participant VS as Visual Studio
    participant App as Pams.Web Application
    participant Browser as Browser

    Developer->>VS: Start debugging
    VS->>App: Run application with Browser Link support
    Browser->>App: Request page
    App-->>Browser: Return page and Browser Link client script
    VS->>Browser: Send development refresh command
    Browser->>Browser: Refresh displayed page
```

## Usage

```ts
// Browser Link is configured by the ASP.NET host during local debugging.
// Client-side code continues to interact with the Pams.Web application normally.

async function loadDashboard() {
  const response = await fetch("/api/dashboard");

  if (!response.ok) {
    throw new Error("Unable to load dashboard data.");
  }

  return response.json();
}

loadDashboard().then((dashboard) => {
  console.log(dashboard);
});

// When debugging through Visual Studio, Browser Link can refresh the page
// after server-side or client-side changes.
```

## AI Coding Instructions

- Treat `Microsoft.VisualStudio.Web.BrowserLink` as a development-time NuGet dependency for the `Pams.Web` project.
- Do not add Browser Link calls to application TypeScript or JavaScript; the ASP.NET and Visual Studio tooling manages the connection.
- Verify changes to the project file preserve the package reference and SDK-style project configuration.
- Test browser refresh behavior through the Visual Studio debug host rather than relying on production deployment behavior.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Injected or called by (1)

- `Pams.Web` — `Pams/Web/Pams.Web/Pams.Web.csproj`:1
