Share via


Cannot show as association because '<element>' cannot be found

Class Designer generates this error when you invoke the Show as Association command and it cannot determine the association between a type and another type, for example, a typedef and its source type.

If the C++ type on which you request the association is managed (as in a CLR project), this error is generated because Class Designer supports only native C++ code.

To correct this error

  • Ensure that the code element that you entered is an existing type.

  • If you have a C++ project that contains managed (CLR) code, ensure that the code element is not managed.

  • If the code element that you entered is defined outside your project, ensure that you have included the correct references in Solution Explorer.

  • If you modify your project structure or move source files in the project, Class Designer can lose track of the type. (This is especially true of the source type of a typedef, base classes, or association types). If this is the case, drag the modified or relocated source code to the class diagram again to redisplay it.

See Also

Concepts

Working with Visual C++ Code in Class Designer

Other Resources

Working with Classes and Other Types

Class Designer Error Messages