Make sure the namespace in your source code matches the namespace in the project properties.
Hi Jim, thanks for the reply.
Yes, the namespace is the same in source code and project properties. the problem is not this.
the problem was solved setting Visual Studio "Optimize code" checkbox (in build tab page) to False.