Monica.Generators.AutoController
0.1.0-preview.3
See the version list below for details.
dotnet add package Monica.Generators.AutoController --version 0.1.0-preview.3
NuGet\Install-Package Monica.Generators.AutoController -Version 0.1.0-preview.3
<PackageReference Include="Monica.Generators.AutoController" Version="0.1.0-preview.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Monica.Generators.AutoController" Version="0.1.0-preview.3" />
<PackageReference Include="Monica.Generators.AutoController"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Monica.Generators.AutoController --version 0.1.0-preview.3
#r "nuget: Monica.Generators.AutoController, 0.1.0-preview.3"
#:package Monica.Generators.AutoController@0.1.0-preview.3
#addin nuget:?package=Monica.Generators.AutoController&version=0.1.0-preview.3&prerelease
#tool nuget:?package=Monica.Generators.AutoController&version=0.1.0-preview.3&prerelease
Monica.Generators.AutoController
Monica.Generators.AutoController provides:
- HTTP API controller generation for Monica handlers
- build-integrated RPC metadata export / consume
- generated HTTP and Local RPC client implementations
The authoritative end-user documentation now lives in the Monica.Docs project in this repository.
Primary page:
Monica.Docs/docs/zh-CN/scenarios/build-integrated-rpc.md
This README is intentionally brief so package docs do not drift away from the published Monica.Docs content.
FIPS2022/Directory.Build.props and FIPS2022/Directory.Build.targets are examples of this pattern.
This extra setup is only for local source-reference development against the MoLibrary repository.
NuGet Usage
After this package is published to NuGet, the project-level usage stays the same:
- producer projects still set
MonicaRpcMetadataExportDirectory - consumer projects still use
RpcMetadataby default or overrideMonicaRpcMetadataConsumeDirectory - consumer projects still declare
RpcClientConfig - shared request/response contracts still belong in the consumer/shared protocol project
- local modular-monolith hosts still use
UseLocalTransport(), while distributed hosts still useUseHttpTransport()
What changes with NuGet is only the infrastructure around the package:
- you use
PackageReferenceinstead of a sourceProjectReference - you do not need custom
Directory.Build.propsorDirectory.Build.targetsglue just to find the build tasks - the package already carries the analyzer, build props/targets, and the build task assembly
So the answer is: yes, the workflow is the same after publishing to NuGet, and the setup is actually simpler.
Recommended Repository Layout
src/
Services/
Alarm/
AlarmService.API/
Shared/
Platform.Protocol/
PublishedLanguages/
RpcMetadata/
Recommended ownership:
- API projects own handlers and export metadata.
- The shared protocol project owns contracts and generated RPC clients.
RpcMetadata/*.jsonis checked into source control next to the consumer project.
Troubleshooting
No metadata file is exported
Check the producer project for all of the following:
- the generator is referenced
AutoControllerConfigis presentMonicaRpcMetadataExportDirectoryis set- the build actually produced
__RpcMetadata.g.cs - the handler contracts live in shared namespaces that the consumer can reference
No RPC client code is generated
Check the consumer project for all of the following:
RpcClientConfigis present- the metadata JSON files are under
RpcMetadata/or the configured consume directory - the project contains the shared contract types under
PublishedLanguages
Rebuild after deleting metadata still fails
Bootstrap requires:
- producer source projects in the same repository
- matching export and consume directories
- readable shared contract source files in the consumer project
If those conditions are not true, restore the checked-in metadata files or build from a repository layout that includes both producers and the consumer project.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.4 | 153 | 4/23/2026 |
| 0.1.0-preview.3 | 58 | 4/22/2026 |
| 0.1.0-preview.2 | 54 | 4/21/2026 |
| 0.1.0-preview.1 | 63 | 1/31/2026 |
Initial preview release of Monica framework. This is a prerelease version for early testing and feedback.