> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/documentation/en/framework/web/controllers.md).

# Deploy Controller Plugins

Build and deploy Discussions Web class library, check controller discovery and request prerequisites.

The API project of Discussions is a Web class library, and the OutputType is Library. It contains the controller but has no independently launchable entry and must be deployed together with [Web Host](/documentation/en/hosting/web.md) and domain plugins.

## Build the Actual Project

First build [Core](https://github.com/Zongsoft/framework/tree/main/Zongsoft.Core) and Web in the sibling framework repository as described in [Your First Business Plugin](/documentation/en/get-started/first-business-plugin.md), using the same configuration and target framework. See [Prerequisites](/documentation/en/get-started/prerequisites.md) to prepare the SDK and source directories.

{% code title="Build the API from the discussions root directory" %}

```powershell
dotnet build src/api/Zongsoft.Discussions.Web.csproj -f net10.0 -p:ZongsoftFrameworkPathReferenced=true -p:GeneratePackageOnBuild=false
```

{% endcode %}

This also builds the domain library. Local references do not build framework automatically. If your NuGet source already provides the required versions of [Core](https://github.com/Zongsoft/framework/tree/main/Zongsoft.Core) and the other dependencies, you can omit the property and use the default package references.

## Web Manifest Dependency Domain Plugin

Source: [src/api/Zongsoft.Discussions.Web.plugin](https://github.com/Zongsoft/Zongsoft.Discussions/blob/main/src/api/Zongsoft.Discussions.Web.plugin#L9) (excerpt; see source for context).

{% code title="Zongsoft.Discussions.Web.plugin" %}

```xml
<manifest>
	<dependencies>
		<dependency name="Zongsoft.Discussions" />
	</dependencies>

	<assemblies>
		<assembly name="Zongsoft.Discussions.Web" />
	</assemblies>
</manifest>
```

{% endcode %}

Dependencies ensure that domain modules are assembled first, and the assembly declaration allows the host to discover the controller. Deploying only Web DLLs without domain mapping, identity extensions, and data drivers will result in controllers existing but business calls failing.

## Resources Delivered with the Package

Source: [src/api/Zongsoft.Discussions.Web.deploy](https://github.com/Zongsoft/Zongsoft.Discussions/blob/main/src/api/Zongsoft.Discussions.Web.deploy#L1) (excerpt; see source for context).

{% code title="Zongsoft.Discussions.Web.deploy" %}

```ini
artifacts/Zongsoft.Discussions.Web.plugin
lib/$(Framework)/Zongsoft.Discussions.Web.*

[templates]
artifacts/templates/*.xlsx
```

{% endcode %}

User archive templates are in templates. The project also enters the docs/http request file into artifacts/http for interface verification; the address and credentials in the request must be provided by its own environment.

## Verify Path

First confirm that the Discussions and [Discussions.Web](https://github.com/Zongsoft/discussions/tree/main/src/api) lists are loaded, and then confirm that Threads, Forums, Users and other controllers enter the application model. Then check the authentication, site, connection, mapping and external file configuration, and finally verify the query and business action.

Public actions are based on the current routing of the controller. repository The early docs/api.md is a historical interface draft; singular paths therein should not be considered current executable examples without checking. See [Requests and Data Service APIs](/documentation/en/framework/web/data-services.md) for the specific code of subject review.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/documentation/en/framework/web/controllers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
