Book a Demo

Author Topic: MDG Link generate "using statement" in VS  (Read 3046 times)

IritP

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
MDG Link generate "using statement" in VS
« on: August 29, 2006, 05:27:35 am »
Hello,

I followed this scenario:
  1. I created new model in Enterprise Architect
  2. I added some packages and classes to this model
  3. I connected one of the packages to Visual Studio 2005
  4. I generated the model through MDG Link. All classes was generated as I expect (with the correct "using statements").
  5. I added new class (NewClass) in Enterprise Architect and connect it to an existent class (OldClass) with generalization connection
  6. I generated the whole project again through MDG Link (Merge with Visual Studio). The generation results was:
      * The new class was generated fine
      * The existent class updated by getting the inheritance declaration - public class OldClass : NewClass {…}
      * The problem was that the "using statement" of the OldClass namespace wasn't generated.

This is a problem because the generated code will not path the next build.

Is there a solution to this problem?
« Last Edit: August 29, 2006, 05:28:38 am by IritP »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDG Link generate "using statement"
« Reply #1 on: September 04, 2006, 03:24:02 pm »
The reason why the using statement wasn't generated is because EA does not generate using statements when synchronising with existing code.  Only when generating the entire file.

The workaround could be to generate with override enabled.  You can turn on the option to import method bodies so they won't be lost.  It does require a bit more work to keep everything in synch though.