Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: metamorphium on June 01, 2010, 06:59:19 pm
-
Hello,
I can't make this working. I've created a class model and I am able to generate all files (EA professional). However, the generator doesn't enclose the class in the namespace x.y { } although it's defined in Namespaces and in Tools->Options->C# I have Generate Namespaces set to true.
I've tried to search the doc and forum but it seems it works for everyone else? Could any kind sould direct me what am I doing wrong?
Thanks and best regards!
-
What version are you on?
Geert
-
8.0.856 (Build 856) - Professional Edition
thanks!
-
You are right, there is something strange happening with the "name space root" setting.
Have you tried removing all "namespaces" from your model? It seems to help. (and treats each package as namespace)
Geert
-
thanks again. However, even if I delete all namespace from the settings, I'm getting incorrect results.
EA generates correctly folders for each namespace (per package) but the class definition is still wrong. I even tried to modify class template but I'm getting stack overflow error and the EA crashed so I reverted to original definition (which IMO doesn't contain namespace block).
-
Hmm, must be something that is kept on the class.
What happens if you try the same on a fresh model, with new classes?
Anyway, I would report this as a bug if I were you.
Geert
-
I started a new project. Added a single class with one attribute and did the export. Again no namespace was exported.
Submitting as bug now, thanks for your help.
-
Also ensure that the "Generate Namespaces" flag is set in the EA options.
(1) Go to "Tools" > "Options"
(2) Under "Source Code Engineering" select "C#"
(3) Set "Generate Namespaces" to "True" under "Options for the current user"
Moreover, make sure that the namespace root is set to the absolute root package, for example, if you have a package structure as follows
- C# Model
-- Logic
--- Ifc
--- Implementation
your namespace root should be set on "C# Model", yielding namespaces "Logic", "Logic.Ifc", and "Logic.Implementation", respectively.
Cheers,
Till
-
Hi Till,
THANK YOU!!!
I had to create nested packages and it works now!
-
Glad I could help. :) Happy modelling!
Cheers,
Till