Understanding IEC 17309-04: Technical Specification for C# Language and .NET Integration

Scope, Technical Requirements, and Compliance Guidelines for the Fourth Part of the IEC 17309 Standard

Scope of IEC 17309-04

IEC 17309-04 is a joint ISO/IEC standard that specifies the syntax, semantics, and core functionality of the C# programming language, with a particular focus on its integration with the .NET Framework and the Common Language Infrastructure (CLI). It serves as the fourth part of the IEC 17309 series, which defines the complete C# language specification. The scope includes lexical structure, types, expressions, statements, classes, interfaces, delegates, exceptions, attributes, generics, and conformance requirements. This standard is applicable to any implementation that aims to provide a fully conforming C# compiler and runtime environment that interoperates with the .NET ecosystem.

Technical Requirements

Lexical and Syntactic Elements

IEC 17309-04 defines the exact lexical grammar, including identifiers, keywords, literals, operators, and punctuators. All implementations must support Unicode source files and follow the prescribed scanning rules. The standard mandates the set of reserved keywords (e.g., class, struct, interface, delegate, enum, namespace, using, static, virtual, override) and contextual keywords (e.g., partial, yield, var, dynamic).

Type System

The standard specifies a unified type system where every value is derived from System.Object. Types are categorized as value types (structs, enumerations, primitive types) and reference types (classes, interfaces, delegates, arrays, strings). Type parameters for generics are supported, including constraints on reference types, value types, constructors, and base types.

Type CategoryExamplesStorage LocationDefault Value
Value typesint, float, bool, struct, enumStack (typically)0, 0.0f, false, dynamically determined
Reference typesclass, string, delegate, interface, arrayHeapnull
Type parametersTn/adefault(T)

Expressions and Statements

IEC 17309-04 defines operator precedence and associativity for all built-in operators, including arithmetic, relational, logical, bitwise, and compound assignment. The standard introduces expression-bodied members, pattern matching expressions, and nullable value types. Statement constructs cover selection (if, switch), iteration (for, foreach, while, do), jump (break, continue, return, goto), exception handling (try, catch, finally, throw), and checked/unchecked contexts.

Metadata and Attributes

Conforming implementations must support custom attributes applied to assemblies, types, methods, parameters, and other targets. The standard defines a subset of intrinsic attributes (e.g., System.ObsoleteAttribute, System.CLSCompliantAttribute) and the mechanism for user-defined attributes.

Implementation Highlights

Implementers of IEC 17309-04 must provide a compiler that translates C# source code into Common Intermediate Language (CIL) targeting a runtime that adheres to the Common Language Infrastructure (ISO/IEC 23271). The standard mandates deterministic semantic analysis, including overload resolution, type inference, and implicit/explicit conversions.

Tip: Ensure your compiler uses the latest version of the standard’s grammar to avoid ambiguities in expression parsing. Prioritize capturing nullable context and target-typed conditional expressions.
Warning: The standard deprecates certain legacy constructs (e.g., Enum.ToString() format pitfalls). Conforming implementations must warn on use of obsolete patterns such as new constraints without explicit constructor constraints.

Versioning is a critical aspect: IEC 17309-04 defines a version-tolerance mechanism through the use of the AssemblyVersion attribute and the #pragma warning directive to handle breaking changes in referenced libraries.

Compliance Notes

Conformance to IEC 17309-04 requires passing the official test suite, which covers all mandatory language features and error diagnostics. Compliant implementations must be certified by a recognized testing body and include the standard conformance assertion in their product documentation.

Success: A fully compliant implementation ensures maximum portability of libraries and tools across runtimes (e.g., .NET Core, .NET Framework, Mono). It also enables official logo licensing and ecosystem trust.
Risk: Non‑compliance can lead to runtime incompatibilities, wrong execution semantics, and rejection by corporate or government procurement processes that require standards certification.

All implementations must support the full Unicode specification for identifiers and character literals, as defined in the standard. Additionally, they must provide a documented way to switch between language versions for backward compatibility (e.g., /langversion compiler option).

Frequently Asked Questions

Q: What is the relationship between IEC 17309-04 and ECMA-334?
A: ECMA-334 serves as the baseline; IEC 17309-04 adds further guidance on .NET integration, metadata handling, and CLI interaction. It is the international adoption with additional compliance and certification requirements.
Q: Does IEC 17309-04 cover platform‑specific I/O or GUI frameworks?
A: No. The standard is strictly a language specification. Platform‑specific libraries (e.g., file I/O, networking, UI) are defined in separate runtime standards (IEC 23271 and vendor specifications).
Q: How often is IEC 17309‑04 updated?
A: The standard is revised approximately every three years to incorporate new C# language features (e.g., records, primary constructors, interceptors). Each revision supersedes the previous version, and implementers must track the IEC publication timeline.

Last updated: 2026

📥 Standard Documents Download

🔒
Please wait 10 seconds, the download links will appear after the ad loads

Leave a Reply

Your email address will not be published. Required fields are marked *