Follow

What is CS0246?

Symptoms

  • I am trying to access a namespace, but receive the following error:
error CS0246: The type or namespace name `________' Could not be found. 
Are you missing a using directive of assembly reference?

Cause

This error is caused when the namespace that you are trying to use does not exist.

Error presented in this example: 

error CS0246: The type or namespace name `MySystem' Could not be found. 
Are you missing a using directive of assembly reference?

Resolution

There are two solutions to this error. The first is to correct the name of the namespace to match one that already exists. The second is to fix the custom namespace that was created.

1. Correcting the name of the namespace:

Utilise the drop down menu "Intellisense" also known as "auto complete".

2. Fixing your own namespace:

We have a helpful section of the Unity manual on namespaces that should help when fixing your own. This is found here.

More Information

https://msdn.microsoft.com/en-us/library/c4aad8at(v=vs.90).aspx

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.