Public API for rules_csharp.
name
Imports precompiled Roslyn analyzer and source generator assemblies.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| analyzers | Precompiled Roslyn analyzer DLL files. | List of labels | optional | [] |
| dlls | Precompiled implementation assembly DLL files. | List of labels | optional | [] |
name
Compiles Roslyn analyzer or source generator assemblies.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| srcs | C# source files to compile. | List of labels | optional | [] |
| resources | Embedded resource files mapped to logical names. | Dictionary: Label -> String | optional | {} |
| analyzers | Precompiled Roslyn analyzer DLL files. | List of labels | optional | [] |
| compile_refs | Precompiled reference assembly DLL files. | List of labels | optional | [] |
| content | Static content files copied to runtime directories. | List of labels | optional | [] |
| copy_to_output | Files mapped to destination output paths. | Dictionary: Label -> String | optional | {} |
| defines | Preprocessor symbols to define during compilation. | List of strings | optional | [] |
| dlls | Precompiled implementation assembly DLL files. | List of labels | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| generate_assembly_info | Synthesize assembly information attributes. | Boolean | optional | True |
| implicit_usings | Synthesize implicit global usings namespace imports. | Boolean | optional | True |
| internals_visible_to | Friend assembly names for InternalsVisibleTo. | List of strings | optional | [] |
| langversion | Target C# language version specification. | String | optional | "latest" |
| native_libs | Unmanaged target platform shared libraries. | List of labels | optional | [] |
| nowarn | Compiler diagnostic codes to suppress. | List of strings | optional | [] |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| runtime_dlls | Precompiled runtime implementation assembly DLL files. | List of labels | optional | [] |
| sdk | Target .NET SDK project flavor. | String | optional | "Microsoft.NET.Sdk" |
| target_framework | Target framework moniker string. | String | optional | "" |
| target_type | Compiler target type output flag. | String | optional | "library" |
| warn_as_error | Treat compiler warnings as errors. | Boolean | optional | False |
| warning_level | Compiler diagnostic severity level. | Integer | optional | 4 |
name
Compiles a C# executable and stamps the native application host binary.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| srcs | C# source files to compile. | List of labels | optional | [] |
| resources | Embedded resource files mapped to logical names. | Dictionary: Label -> String | optional | {} |
| content | Static content files copied to runtime directories. | List of labels | optional | [] |
| copy_to_output | Files mapped to destination output paths. | Dictionary: Label -> String | optional | {} |
| defines | Preprocessor symbols to define during compilation. | List of strings | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| generate_assembly_info | Synthesize assembly information attributes. | Boolean | optional | True |
| implicit_usings | Synthesize implicit global usings namespace imports. | Boolean | optional | True |
| internals_visible_to | Friend assembly names for InternalsVisibleTo. | List of strings | optional | [] |
| langversion | Target C# language version specification. | String | optional | "latest" |
| nowarn | Compiler diagnostic codes to suppress. | List of strings | optional | [] |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| sdk | Target .NET SDK project flavor. | String | optional | "Microsoft.NET.Sdk" |
| target_framework | Target framework moniker string. | String | optional | "" |
| target_type | Compiler target type output flag. | String | optional | "exe" |
| warn_as_error | Treat compiler warnings as errors. | Boolean | optional | False |
| warning_level | Compiler diagnostic severity level. | Integer | optional | 4 |
name
Compiles Protocol Buffer and gRPC service definitions into a C# assembly library.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| srcs | C# source files to compile. | List of labels | optional | [] |
| resources | Embedded resource files mapped to logical names. | Dictionary: Label -> String | optional | {} |
| analyzers | Precompiled Roslyn analyzer DLL files. | List of labels | optional | [] |
| compile_refs | Precompiled reference assembly DLL files. | List of labels | optional | [] |
| content | Static content files copied to runtime directories. | List of labels | optional | [] |
| copy_to_output | Files mapped to destination output paths. | Dictionary: Label -> String | optional | {} |
| defines | Preprocessor symbols to define during compilation. | List of strings | optional | [] |
| dlls | Precompiled implementation assembly DLL files. | List of labels | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| generate_assembly_info | Synthesize assembly information attributes. | Boolean | optional | True |
| implicit_usings | Synthesize implicit global usings namespace imports. | Boolean | optional | True |
| internals_visible_to | Friend assembly names for InternalsVisibleTo. | List of strings | optional | [] |
| langversion | Target C# language version specification. | String | optional | "latest" |
| native_libs | Unmanaged target platform shared libraries. | List of labels | optional | [] |
| nowarn | Compiler diagnostic codes to suppress. | List of strings | optional | [] |
| plugin | The grpc_csharp_plugin executable. | Label | optional | None |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| proto | Target providing ProtoInfo with proto sources. | Label | optional | None |
| runtime_dlls | Precompiled runtime implementation assembly DLL files. | List of labels | optional | [] |
| sdk | Target .NET SDK project flavor. | String | optional | "Microsoft.NET.Sdk" |
| target_framework | Target framework moniker string. | String | optional | "" |
| target_type | Compiler target type output flag. | String | optional | "library" |
| warn_as_error | Treat compiler warnings as errors. | Boolean | optional | False |
| warning_level | Compiler diagnostic severity level. | Integer | optional | 4 |
name
Imports precompiled reference and implementation assemblies.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| analyzers | Precompiled Roslyn analyzer DLL files. | List of labels | optional | [] |
| compile_refs | Precompiled reference assembly DLL files. | List of labels | optional | [] |
| dlls | Precompiled implementation assembly DLL files. | List of labels | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| native_libs | Unmanaged target platform shared libraries. | List of labels | optional | [] |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| runtime_dlls | Precompiled runtime implementation assembly DLL files. | List of labels | optional | [] |
| target_framework | Target framework moniker string. | String | optional | "" |
name
Compiles C# source files into reference and implementation assemblies.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| srcs | C# source files to compile. | List of labels | optional | [] |
| resources | Embedded resource files mapped to logical names. | Dictionary: Label -> String | optional | {} |
| analyzers | Precompiled Roslyn analyzer DLL files. | List of labels | optional | [] |
| compile_refs | Precompiled reference assembly DLL files. | List of labels | optional | [] |
| content | Static content files copied to runtime directories. | List of labels | optional | [] |
| copy_to_output | Files mapped to destination output paths. | Dictionary: Label -> String | optional | {} |
| defines | Preprocessor symbols to define during compilation. | List of strings | optional | [] |
| dlls | Precompiled implementation assembly DLL files. | List of labels | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| generate_assembly_info | Synthesize assembly information attributes. | Boolean | optional | True |
| implicit_usings | Synthesize implicit global usings namespace imports. | Boolean | optional | True |
| internals_visible_to | Friend assembly names for InternalsVisibleTo. | List of strings | optional | [] |
| langversion | Target C# language version specification. | String | optional | "latest" |
| native_libs | Unmanaged target platform shared libraries. | List of labels | optional | [] |
| nowarn | Compiler diagnostic codes to suppress. | List of strings | optional | [] |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| runtime_dlls | Precompiled runtime implementation assembly DLL files. | List of labels | optional | [] |
| sdk | Target .NET SDK project flavor. | String | optional | "Microsoft.NET.Sdk" |
| target_framework | Target framework moniker string. | String | optional | "" |
| target_type | Compiler target type output flag. | String | optional | "library" |
| warn_as_error | Treat compiler warnings as errors. | Boolean | optional | False |
| warning_level | Compiler diagnostic severity level. | Integer | optional | 4 |
name
Compiles Protocol Buffer definitions into a C# assembly library.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| srcs | C# source files to compile. | List of labels | optional | [] |
| resources | Embedded resource files mapped to logical names. | Dictionary: Label -> String | optional | {} |
| analyzers | Precompiled Roslyn analyzer DLL files. | List of labels | optional | [] |
| compile_refs | Precompiled reference assembly DLL files. | List of labels | optional | [] |
| content | Static content files copied to runtime directories. | List of labels | optional | [] |
| copy_to_output | Files mapped to destination output paths. | Dictionary: Label -> String | optional | {} |
| defines | Preprocessor symbols to define during compilation. | List of strings | optional | [] |
| dlls | Precompiled implementation assembly DLL files. | List of labels | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| generate_assembly_info | Synthesize assembly information attributes. | Boolean | optional | True |
| implicit_usings | Synthesize implicit global usings namespace imports. | Boolean | optional | True |
| internals_visible_to | Friend assembly names for InternalsVisibleTo. | List of strings | optional | [] |
| langversion | Target C# language version specification. | String | optional | "latest" |
| native_libs | Unmanaged target platform shared libraries. | List of labels | optional | [] |
| nowarn | Compiler diagnostic codes to suppress. | List of strings | optional | [] |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| proto | Target providing ProtoInfo with proto sources. | Label | optional | None |
| runtime_dlls | Precompiled runtime implementation assembly DLL files. | List of labels | optional | [] |
| sdk | Target .NET SDK project flavor. | String | optional | "Microsoft.NET.Sdk" |
| target_framework | Target framework moniker string. | String | optional | "" |
| target_type | Compiler target type output flag. | String | optional | "library" |
| warn_as_error | Treat compiler warnings as errors. | Boolean | optional | False |
| warning_level | Compiler diagnostic severity level. | Integer | optional | 4 |
name
Compiles and executes a C# test binary under the Bazel test harness.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Direct dependency libraries. | List of labels | optional | [] |
| srcs | C# source files to compile. | List of labels | optional | [] |
| data | Runtime data files for test execution. | List of labels | optional | [] |
| resources | Embedded resource files mapped to logical names. | Dictionary: Label -> String | optional | {} |
| content | Static content files copied to runtime directories. | List of labels | optional | [] |
| copy_to_output | Files mapped to destination output paths. | Dictionary: Label -> String | optional | {} |
| defines | Preprocessor symbols to define during compilation. | List of strings | optional | [] |
| env | Environment variables for test execution. | Dictionary: String -> String | optional | {} |
| env_inherit | Environment variables inherited from client environment. | List of strings | optional | [] |
| exports | Dependencies exported to downstream consumers. | List of labels | optional | [] |
| generate_assembly_info | Synthesize assembly information attributes. | Boolean | optional | True |
| implicit_usings | Synthesize implicit global usings namespace imports. | Boolean | optional | True |
| internals_visible_to | Friend assembly names for InternalsVisibleTo. | List of strings | optional | [] |
| langversion | Target C# language version specification. | String | optional | "latest" |
| nowarn | Compiler diagnostic codes to suppress. | List of strings | optional | [] |
| plugins | Roslyn analyzer and generator plugins. | List of labels | optional | [] |
| sdk | Target .NET SDK project flavor. | String | optional | "Microsoft.NET.Sdk" |
| target_framework | Target framework moniker string. | String | optional | "" |
| target_type | Compiler target type output flag. | String | optional | "exe" |
| test_filter | Default test filter expression. | String | optional | "" |
| warn_as_error | Treat compiler warnings as errors. | Boolean | optional | False |
| warning_level | Compiler diagnostic severity level. | Integer | optional | 4 |
analyzers
Propagates Roslyn analyzer and source generator assembly files.
FIELDS
| Name | Description |
|---|---|
| analyzers | Depset of Roslyn analyzer and generator assembly Files. |
compile_ref
Propagates compilation references, runtime assemblies, and unmanaged libraries.
FIELDS
aspnetcore_ref_pack
Defines resolved C# SDK tools, packs, and target monikers.
FIELDS
0.1.02026-10-15 |