I have created a simple control add-in for Dynamics NAV/BC and I'm having some trouble with it. I have done exactly the same (as far as I can tell) in this add-in, as I have done in previous add-ins I have created of the same type, which have worked just fine.
The problem is that when the add-in assembly is added to a page (personally I don't know much about this part, I'm just watching as it is being done), the events and methods of the add-in are supposed to appear (stub code should be generated), however this is not the case... Nothing happens.
When they try with a similar assembly (same framework, same kind of interface, same version of 'Microsoft.Dynamics.Framework.UI.Extensibility' assembly - in short a very much similar assembly) the code for the methods and events is generated as expected.
So my question is, obviously, why is it working for one assembly and not the another, when they are next to identical in the C# code?
Here is the code for the assembly not working.
using Microsoft.Dynamics.Framework.UI.Extensibility;
namespace Dynamics.NAV.CR
{
[ControlAddInExport("Dynamics.NAV.CR")]
public interface ICRAddIn
{
[ApplicationVisible]
event ApplicationEventHandler AddInReady;
[ApplicationVisible]
event DataEventHandler ButtonClicked;
[ApplicationVisible]
event DataEventHandler ElementHtmlRetrieved;
[ApplicationVisible]
event DataEventHandler ElementTextRetrieved;
[ApplicationVisible]
void setElementHtml(string control_id, string html);
[ApplicationVisible]
void setElementText(string control_id, string text);
[ApplicationVisible]
void setElementCss(string control_id, string css);
[ApplicationVisible]
void addElementCssCls(string control_id, string cls);
[ApplicationVisible]
void removeElementCssCls(string control_id, string cls);
[ApplicationVisible]
void setElementProp(string control_id, string prop_name, string prop_value);
}
}
What am I missing?
The person deploying the assembly says he has made sure it's 'unblocked', so that shouldn't be the issue.
I forgot to add the code for the custom event handler - here it is.
namespace Dynamics.NAV.CR
{
public delegate void DataEventHandler(object data);
}