Neo has released Neo DevPack v3.10.2 for .NET. The devpack is the official toolkit for writing Neo N3 smart contracts in C#. Its compiler, nccs, translates C# source code into NeoVM bytecode (the instruction format executed on-chain by the Neo Virtual Machine) and produces a contract manifest.

The toolkit also includes testing utilities, a linter, a disassembler, and project templates.

Breaking change: catching specific exception types now fails the build

In v3.10.2, contracts that catch a specific exception type, such as catch (SomeException e), no longer compile. The rule behind this, NC4027, was a warning in v3.10.1. It is now an error.

Neo contracts can only catch System.Exception. In standard C#, naming a specific exception type limits what the block catches. On Neo, the compiled contract catches every exception anyway. The code does not do what it appears to do, so the compiler now rejects it.

Developers upgrading from v3.10.1 should check every try/catch block first. Any catch that names a type other than System.Exception must be changed or removed before the contract will build.

Divide-by-zero errors are now catchable

Prior to v3.10.2, a division by zero inside a try/catch block would abort the entire contract call rather than throwing a catchable exception. The error was not reachable by the catch handler at all.

The compiler now inserts a zero check before division and remainder operations, unless the divisor is a non-zero constant. If the divisor is zero, the guard throws an exception that the surrounding catch block can handle normally. The runtime cost of the guard is approximately 120 datoshi (the smallest unit of GAS) per guarded division.

Outside a try/catch, a zero divisor still aborts the call. The change closes a correctness gap for contracts with division logic inside a try/catch.

GAS snapshot testing

v3.10.2 adds a GasSnapshot utility to the testing component of the devpack. The tool saves a baseline record of GAS consumption for a contract operation, then compares subsequent test runs against that baseline. A test fails when consumption moves outside a configured tolerance.

This builds on GAS tracking that was already present in the testing framework. The snapshot tool enables automatic detection of GAS regressions as part of a standard test suite, without requiring developers to manually compare figures between builds.

Next steps for developers

Developers should review the full release notes before upgrading, particularly if their contracts use division logic or catch blocks. Neo DevPack v3.10.2 contains 294 commits since v3.10.1 shipped in July, covering GAS optimization improvements and a range of fixes to how the compiler reports unsupported C# patterns.

The full release notes can be found at the link below:
https://github.com/neo-project/neo-devpack-dotnet/releases/tag/v3.10.2