Quick answer
Start with the file named in the compiler error, even if you were editing a different script. NinjaTrader compiles all included NinjaScript files together. Missing references and duplicate definitions need different fixes; a platform restart does not correct either source-code problem.
Find the failing file before changing the open script
Open New > NinjaScript Editor from the Control Center and compile. The error grid identifies the NinjaScript file, description, code, line and column. Double-click an error to open the affected file; clicking its error code opens the related help.
A working indicator can be blocked by an unfinished strategy or another imported script. The file shown in the error grid is a better starting point than the tab you happened to have open.
| Code | What to investigate | First distinction |
|---|---|---|
| CS0234 / CS0246 | A type or namespace cannot be resolved. | A missing assembly, an incorrect name and a missing namespace import are different possibilities. |
| CS0101 | Two definitions conflict within a namespace. | Look for a copied or imported definition with the same name. |
| CS0111 | A type contains conflicting member definitions. | Compare the member names and parameter types, not just the filenames. |
A missing name does not always mean a missing DLL
For CS0234 or CS0246, read the unresolved type or namespace in the message. Microsoft documents missing assembly references and naming mistakes among the possible causes. Adding a using directive can make an existing namespace accessible; it cannot install a missing assembly.
NinjaTrader documents one common third-party case: a script still references a DLL that was removed. If that dependency is still required, restore the vendor's appropriate assembly, then right-click inside the NinjaScript Editor and open References > Add. Select the intended DLL; NinjaTrader warns against referencing the x86- or x64-suffixed variant instead of the main reference assembly.
If the error followed a vendor update, identify the required version and dependency with that vendor. Do not add an unrelated DLL simply because its name resembles the unresolved type.
Duplicate definitions need a source-level fix
CS0101 points to a namespace that already contains the named definition. CS0111 points to a member that duplicates an existing signature. Importing another copy or making a second file with the same class can create a conflict; changing only the filename does not establish that the definitions are different.
For your own custom scripts, compare the conflicting declarations and retain or rename the intended implementation. NinjaScript Explorer's Rename operation updates the associated class names and components. Close the custom script before renaming it. For vendor code, ask which version should remain instead of editing generated or supplied internals.
Exclude an unfinished script only if the rest can stand without it
NinjaTrader compiles custom NinjaScript files into one DLL. In NinjaScript Explorer, right-click a custom script and select Exclude From Compilation to leave it out temporarily. It appears faded; unchecking the option includes it in the next compilation. Locked system scripts cannot be excluded.
This is useful for isolating unfinished work, but another included script may still depend on the excluded type. In that case, exclusion leaves a dependency problem to resolve. It is not equivalent to repairing the script.
Exclude From Compilation and Remove are different actions. Remove permanently deletes the script, so preserve any custom source you need before choosing it.
Recompile, then separate compiler success from runtime behavior
Compile again after the specific correction and inspect the resulting error grid. If another error remains, follow its file, code and location. A successful compilation establishes that the included source and references compile; it does not establish that an indicator calculates correctly or a strategy behaves correctly in operation.
For a vendor handoff, include the exact error code and description, affected file and line, and the import or update that preceded it. If NinjaTrader itself will not open, use the separate startup and workspace guide.
Official sources
Platform monitoring
Keep platform health in view
Ninja Watchdog monitors NinjaTrader and connection health. Email alerts are available today; SMS and WhatsApp alerts are coming soon.
