Book a Demo

Author Topic: CS_AddinFramework-Sample does not run (VS 2012/13)  (Read 4884 times)

PatrickS

  • EA User
  • **
  • Posts: 46
  • Karma: +1/-0
    • View Profile
CS_AddinFramework-Sample does not run (VS 2012/13)
« on: June 17, 2014, 10:10:29 pm »
Hi
The Sparx' Sample for an EA add in written in C# uses Visual Studio 2003 (which I no longer have installed). When following the Readme and running it, it does instanciate EA but shows in the "Manage Add-Ins" dialog a line for "CS_AddinFramework" with the Status "Error-Missing (0x800401f3) which means "Invalid class string".

For one item of the readme file I don't know what to do in VS 2012/13: "- Select Configuration Properties | Debugging and Change the debug mode to Program and the start application to "C:\Program Files\Sparx Systems\EA\EA.exe" (or whatever is relevant to you).". Where to set this?
Thanks for help

PatrickS

  • EA User
  • **
  • Posts: 46
  • Karma: +1/-0
    • View Profile
Re: CS_AddinFramework-Sample does not run (VS 2012
« Reply #1 on: June 17, 2014, 11:38:49 pm »
On some compiles I get this error: "Cannot register assembly "C:\EAAutomation\Sample\bin\Debug\CS-AddinFramework.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\CS_AddinFramework.Form1' is denied."
However I am an administrator.
But this is exactly what seems to happen, that the registration of the com component is missing.

VadimV

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: CS_AddinFramework-Sample does not run (VS 2012
« Reply #2 on: June 19, 2014, 06:47:10 am »
1)
Quote
For one item of the readme file I don't know what to do in VS 2012/13: "- Select Configuration Properties | Debugging and Change the debug mode to Program and the start application to "C:\Program Files\Sparx Systems\EA\EA.exe" (or whatever is relevant to you).". Where to set this?
Project "CS_AddinFramework.csproj" Properties->Debug tab->"Start Action" block->
Start External Program="C:\Program Files (x86)\Sparx Systems\EA\EA.exe"
(for VS 2013 at Win8 x64 environment)



2)
Quote
However I am an administrator.
But this is exactly what seems to happen, that the registration of the com component is missing.
In Win7\Win8 environment you should be not only the member of local\domain admin group but also start
the application in "administrative" mode (run as administrator)






3) However, at the end of all - EA ver 11.0.1107 is not recognizing COM as Add-IN:
after pressing F5, I see successfully started EA without any available AddIns:

Plugins list is empty:


and debugging shows that neither EA_Connect() nor EA_GetMenuItemsnor() methods are called
Code: [Select]
\Main.cs:

public String EA_Connect(EA.Repository Repository)

public object EA_GetMenuItems(EA.Repository Repository, string Location, string MenuName)
breakpoints in these methods were not activated


WBR, /me

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: CS_AddinFramework-Sample does not run (VS 2012
« Reply #3 on: June 19, 2014, 04:45:36 pm »
You still have to create the registry key for any addin to show up in the manage addins window.
I've written some of this down in this article: Tutorial: Create your first C# Enterprise Architect addin in 10 minutes

Geert

VadimV

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: CS_AddinFramework-Sample does not run (VS 2012
« Reply #4 on: June 20, 2014, 06:48:42 pm »
Thanx for your good tutorial, Geert.

The problem was really in the missed reg key.
Btw, \EAAddins\ subkey itself is not created by EA installer - it should be created manually too.


WBR, /me

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: CS_AddinFramework-Sample does not run (VS 2012
« Reply #5 on: June 23, 2014, 09:27:56 am »
The CS_AddinFramework zip file contains a reg file that registers the add-in with EA.