When running an existing script in ZEN 3.11 which was created for an older ZEN version, you may encounter an error message that a specific .Net function cannot be found. In such cases, you need to add additional imports to the script.

  1. Open your browser and a search engine and search for .NET and the name the function.
  2. Search results are displayed.
  3. Select and open the result for the Microsoft Learn page.
  4. The information for the function are displayed.
  5. Make sure that in the top left the Version is set to .NET8.
  6. The information for the function for .NET8 are displayed.
  7. Check the displayed information in which Assembly the function is based.
  8. Go back to ZEN and open your script in the editor.
  9. Your script is displayed.
  10. Add clr.AddReferenceByPartialName("New assembly name").
  11. You have added the required import to your script.

Example: Importing FileVersionInfo

For this example you need to import an assembly for the FileVersionInfo function to your script.

  1. Open your browser and a search engine and search for .NET FileVersionInfo.
  2. Search results are displayed.
  3. Select and open the result for the Microsoft Learn page.
  4. The information for the function are displayed.
  5. Make sure that in the top left the Version is set to .NET8.
  6. The information that for .NET 8 FileVersionInfo has moved to the assembly System.Diagnostics.FileVersionInfo.dll is displayed.
  7. You can double check if you change Version to .NET Framework 4.5.
  8. The information displays that for .NET Framework 4.5 the function was in the System.dll.
  9. Go back to ZEN and open your script in the editor.
  10. Your script is displayed.
  11. Add clr.AddReferenceByPartialName(System.Diagnostics.FileVersionInfo).
  12. You have added the required import to your script.