Register assembly

Add-in Express™ Support Service
That's what is more important than anything else

Register assembly
In the app was installed a nuget package that suppose not affect the addinmodule 
Luis Delgado




Posts: 10
Joined: 2020-08-07
Hi I read about similra error like this : Severity Code Description Project File Line Suppression State
Error Cannot register assembly "C:\Users\XllerateTG\Documents\Visual Studio 2019\MeisterNew\MeisterCOM\MeisterCOM\bin\Debug\MeisterCOM.dll". Exception has been thrown by the target of an invocation. MeisterCOM

How to fix in this case that? I share the AddinModule code:

namespace MeisterCOM
{
/// <summary>
/// Add-in Express Add-in Module
/// </summary>
[GuidAttribute(\"51F90F7E-D6A0-4CC2-835A-03946C34517E\"), ProgId(\"MeisterCOM.AddinModule\")]
public partial class AddinProcessor : AddinExpress.MSO.ADXAddinModule
{
private string sError;

internal ReportProcessor ReportProcessor { get; set; }
internal string UserName { get; set; }
//internal clsReport rReport;
public static MeisterSDKReporting.MeisterSDKReporting Sdk { get; } = MeisterSDKReporting.MeisterSDKReporting.Instance;


public AddinProcessor()
{
Application.EnableVisualStyles();
InitializeComponent();
}
#region Add-in Express automatic code

// Required by Add-in Express - do not modify
// the methods within this region

public override System.ComponentModel.IContainer GetContainer()
{
if (components == null)
components = new System.ComponentModel.Container();
return components;
}

[ComRegisterFunctionAttribute]
public static void AddinRegister(Type t)
{
AddinExpress.MSO.ADXAddinModule.ADXRegister(t);
}

[ComUnregisterFunctionAttribute]
public static void AddinUnregister(Type t)
{
AddinExpress.MSO.ADXAddinModule.ADXUnregister(t);
}

public override void UninstallControls()
{
base.UninstallControls();
}
Posted 07 Sep, 2020 23:23:13 Top
Dmitry Kostochko


Add-in Express team


Posts: 2865
Joined: 2004-04-05
Hi Luis,

Thank you for the code sample, it was very helpful.

The add-in module (your AddinProcessor class) is created during registration. I think you are getting this exception because your module has the static property that for some reason cannot be initialized. Please check this on your side.
Posted 08 Sep, 2020 04:07:45 Top
Luis Delgado




Posts: 10
Joined: 2020-08-07
But I set those two lines in static and don't work, they should be static!!

[ComRegisterFunctionAttribute]
public static void AddinRegister(Type t)
{
AddinExpress.MSO.ADXAddinModule.ADXRegister(t);
}

[ComUnregisterFunctionAttribute]
public static void AddinUnregister(Type t)
{
AddinExpress.MSO.ADXAddinModule.ADXUnregister(t);
}
The others at moment are public
Regards!!
Posted 08 Sep, 2020 13:15:54 Top
nwein




Posts: 568
Joined: 2011-03-28
I believe what Dmitry was referring to was your
public static MeisterSDKReporting.MeisterSDKReporting Sdk { get; } = MeisterSDKReporting.MeisterSDKReporting.Instance;

not the auto generated adx code...
Posted 08 Sep, 2020 14:50:28 Top
Dmitry Kostochko


Add-in Express team


Posts: 2865
Joined: 2004-04-05
Thank you, Nir.

Luis, is the issue resolved?
Posted 09 Sep, 2020 04:03:51 Top
Luis Delgado




Posts: 10
Joined: 2020-08-07
Hi Dmitry I fixed that to no including this line
public static MeisterSDKReporting.MeisterSDKReporting Sdk { get; } = MeisterSDKReporting.MeisterSDKReporting.Instance;
I read about in other forum that injecting some kind of things like mine is a service that give me some parameters to recognize a login and other tasks, is not apparently correct for the addin module
Is important to know that I figured out in many hours but it's important recognize that kind of Instance something

Thank you!!
Posted 09 Sep, 2020 11:08:38 Top
Dmitry Kostochko


Add-in Express team


Posts: 2865
Joined: 2004-04-05
Hi Luis,

Thank you for keeping us informed.
If you have any questions or face problems, feel free to ask.
Posted 10 Sep, 2020 03:59:52 Top