Build/compile errors with shared Header variables, Duration access, and C# feature support in EventIDE
Dear Community,
I’m building my first closed-loop go/no-go experiment in EventIDE using a cybernetic layout (Sensor → Comparator → Controller → Actuator) on the root layer, and I’m encountering a few blocking compile/runtime issues that I can’t quite explain.
Bug 1 — “inaccessible due to its protection level”
After a clean save, (without any compilation error indicated within any snippets) the global banner reports snippet compilation errors, and I get:
“DynamicSnippetAssembly.clHeaderOnlySnippetHub.W is inaccessible due to its protection level.”
However, W (a constant representing the size of a sliding window used in my model) and the sliding-window state (Queue win, winSum, mean_win_ms, err_ms) are all defined once in the header and used across events.
Bug 2 — Duration property not visible from snippets
In GO/NO_GO > Before Onset, writing Duration = rt_* produces the error:
“Duration does not exist in this context.”
So I’m currently using proxy variables (Duration_go, Duration_nogo) bound to Control → Duration, which do work — (at least when I compile, I couldn't manage to run my project due to the first bug) but I’m a bit confused about which event properties are directly accessible in snippets, and which ones require proxies. Is this behavior expected for all event properties?
Question concerning C# syntax support
String interpolation fails with “unexpected ‘$’”, while string.Format() works fine, so I assume the snippet compiler targets an older C#/.NET version.
Related question:
Which exact C#/.NET version is used by EventIDE’s snippet compiler, and which System.* APIs are guaranteed (e.g., is Math.Clamp available, or should we fall back to Math.Max/Min)?


Hi Mathilde,
I will try to comment on all point below.
Bug 1 — “inaccessible due to its protection level”
When you declare variables in the Header snippet, EventIDE wraps them with additional change-tracking code. In some cases—especially for complex types—this wrapping can fail, leading to confusing compile errors that actually originate from the generated wrapper code.
If that happens, you can add the internal keyword in front of the variable declaration, for example:
internal int i = 5;
This tells EventIDE to skip wrapping for that variable, which usually resolves the compilation issue.
Bug 2 — Duration property not visible from snippets
None of the element or event properties are directly accessible by default. You need to create proxy variables (via the “+” button in the property panel) for each property you want to access from snippets.
Note that you can also create proxy arrays or proxy hub variables linked to multiple objects — just select several objects before creating the proxy variable.
C# syntax support
Good catch. EventIDE should automatically use the most recent C# compiler compatible with its .NET 4.8 core (i.e., C# 7). However, in practice, the current version still defaults to the older C# 5.0 compiler, which explains the missing support for string interpolation and newer syntax.
We’ll fix this in the next update — but if you’d like, I can send you a patch right away.