Class Does Not Contain (Member) Definition
If you are trying to use a property that requires special syntax (the get- or set-accessor), you'll get an error message that looks like this:
Compiler Error CS0117: 'type' does not contain a definition for 'identifier'
There are two situations when you need to use the get- or set-accessor syntax for properties:
If the property uses different classes or data types for getting vs. setting (see Implementation Differences for Properties)
If the property takes input arguments (see Properties with Input Arguments)
You can check the C# Syntax section in the reference section which displays the correct syntax to use. In addition, you can use the ObjectBrowser or the auto-complete features in Visual Studio .NET.
If the enum or string constant is not prefixed with its module name, you'll get an error message that looks like this:
Compiler Error CS0103: The name 'identifier' does not exist in the current context
For enums, you must include the module name. For example:
siMenuAnchorPoints.siMenuTbGetPrimitiveCurveID siToolbarControl.siTBCtrlBlankSeparator siImageBitDepth.siImageBitDepthFloat16 siClassID.siGeometryID // etc.
For string constants, you must use StringModule. For example:
StringModule.siBendOpType StringModule.siCurveFilter StringModule.siLocalType StringModule.siUIButtonDisable // etc.
If you omit an optional argument when calling an object model method you'll get an error message that looks like this:
Compiler Error CS1501 No overload for method 'method' takes 'number' arguments
If you used a property which requires different data types or classes for getting vs. setting (such as Preferences.Categories or the deprecated XSIApplication.ActiveProject), you'll get an error message that looks like this:
Compiler Error CS1545: Property, indexer, or event 'property' is not supported by the language; try directly calling accessor methods 'set accessor' or 'get accessor'
In some cases, an alternative method or property exists that resolves the problem; for example, XSIApplication.ActiveProject2 is an alternative property which returns and sets a Property object.
In cases where there are no alternative methods or properties, use the accessor method associated with the property. The accessor method can be called by prefixing get_ and set_ to the name of the property:
// Raises compiler error CS1545: Preferences pref = xsi.Preferences; ProjectItemCollection proj_itms = pref.Categories; // Special syntax as a workaround ProjectItemCollection proj_itms = pref.get_Categories; pref.set_Categories( proj_itms );
For more information, see Implementation Differences for Properties.
Type/Namespace Could Not Be Found or Does Not Exist
If the Softimage Object Model assemblies were not properly installed or referenced or you forgot to reference them with the using directive, you'll get an error message that looks like this:
Compiler Error CS0246: The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)
Compiler Error CS0234: The type or namespace name 'name' does not exist in the namespace 'namespace' (are you missing an assembly reference?)
Verify whether the following directives appear in your .cs source file (the plug-in wizards include them automatically):
using XSIOM; // Softimage object model using XSIMath; using XSIUtil;
If they do appear, most likely the assemblies have not been either referenced or installed properly. Open the References folder in the Solution Explorer:
If the assembly you are trying to use is not in the list you can right-click to add a reference to the assembly. If it is in the list then it is possible that it has not been installed properly. To correct this situation, you need to find out whether it was properly installed and if not, add it to the GAC.