Book a Demo

Author Topic: V15 - ConstLayoutStyles causing problem with .Net 4  (Read 4495 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
V15 - ConstLayoutStyles causing problem with .Net 4
« on: December 20, 2019, 05:47:37 pm »
I haven't touched my Diagrammer C# code in over a year but due to change of "gig", need to recompile in a new environment.  I've had to move up to .Net 4 (I think because the later Interop.EA.dll requires that).  However, I'm getting the following message from the C# compiler:
Severity   Code   Description   Project   File   Line   Suppression State
Error   CS1752   Interop type 'ConstLayoutStyles' cannot be embedded. Use the applicable interface instead.   <project>   <path>\<file>   389   Active

(where <project>   <path>\<file> have been removed...)

A sample code that worked was:
Code: [Select]
Layout(
ConstLayoutStyles.lsCrossReduceAggressive
+ ConstLayoutStyles.lsCycleRemoveDFS
+ ConstLayoutStyles.lsLayeringOptimalLinkLength
+ ConstLayoutStyles.lsInitializeDFSOut
+ ConstLayoutStyles.lsLayoutDirectionDown
, s_PROCESS_NAME
); //ONLY layout if inserted....

Searching for a solution implies that I need to set the Embed Interop Assembly property to false for the project, but I can't seem to find it.  Is there "an applicable interface" instead?  The documentation on the Sparx site for ConstLayoutStyles doesn't imply that.

HELP!!!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13505
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: V15 - ConstLayoutStyles causing problem with .Net 4
« Reply #1 on: December 20, 2019, 05:51:31 pm »
Paolo,

Check your References for Interop.EA
Then in the properties of that set "Embed Interop Type" to False
It's not specific to ConstLayoutStyles. You would run into other issues even if you didn't use that enumeration.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: V15 - ConstLayoutStyles causing problem with .Net 4
« Reply #2 on: December 20, 2019, 07:07:28 pm »
Paolo,

Check your References for Interop.EA
Then in the properties of that set "Embed Interop Type" to False
It's not specific to ConstLayoutStyles. You would run into other issues even if you didn't use that enumeration.

Geert
Thanks, Geert!
That did the trick!  Looks like this was the only enum I'm using that suffers from that problem.

Avagoodweegend  as we say in Oz!

Paolo


Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!