Navigation: CodeStencil > Troubleshooting > Nanite Not Loaded |
After code generation, it is possible to get a list of errors indicating that a code nanite was not loaded. You can get a prompt similar to this:
1)ZeraSystems.CodeNanite.Schema.TableList is the Code nanite that was not loaded
2)The current stencil is MyStencil.codestencil and it is located in the folder: c:\temp\MyStencil
3)This is the folder where the DLL (or Assembly) containing the code nanite should have been located
4)As we can see there are no assemblies listed here. A physical examination of the folder shows that it is empty:
Solution:
(1) Import Assemblies : You can import (copy) existing assemblies into the stencil where you have empty assemblies. To do this, you right-click on the Code Nanites grid:
Click on the "Import Assemblies" and follow the prompt to navigate to the Code Nanites Folder and select the assemblies to copy.
(2) Reset Code Nanites: In the case where the Code Nanite assemblies have not been properly loaded, usually after an upgrade, resetting the Code Nanites listing may fix this.
To do a Reset:
(3) Primary Keys : Another cause of this error is a lack of Primary Keys in a table.
Almost any stencil designed to make use of database schema will need a primary key to manipulate data, especially for CRUD operations like EDIT, DELETE, show DETAILS. So, if a table does not have a primary key, the stencil will not be able to use the meta data of the schema to generate CRUD related code, hence as part of the error, you may see "Object reference not set to an instance of an object"
To fix this, simply add a primary key to the table from the Global Schema.
Check the "Primary" checkbox.