IoC inside AddIn

IoC inside AddIn

Hello everyone, looking for help regarding to integration of Zenon AddIn. We are creating a Addin that shall do several stuff like running WebSocket server, Http Api server and of course consume some data from Zenon itself, like Variables or Language texts. I am using Autofac for DI and have troubles to get it working. First anyone around who successfully used IoC inside AddIn implemenation? Second topic is related to error: Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' - I have added library at AddinInfo.cs file, like [assembly: AddinModule("System.Web.Http.dll")] It mitigates the error, but then next error related to missing Autofac assembly appears and second declaration like [assembly: AddinModule("Autofac.dll")] causes the error (duplicit addinmodule). When I create all classes manually with new, it usually works. Any hint is most welcome. Cheers, Jaroslav From Zenon log 02 L 10.0.75.1 2594 1 35BC 190703075830,524836 01 00 0003 e:\builds\1_zenon\zenon\zenon800_build\source\cdnetwrapper\managed\logclient.cpp 0007 CDNetWrapper::LogClient::LogMessage 0004 98 0027 Scada.Internal.DotNetAddInExtension.AddInIntegration.Startup Error while starting service with id 'ZenMobile.AddIn.ZenonProjectService.ZenMobile.AddIn.Service.ProjectServiceExtension' Exception information:Scada.Internal.AddIn.Engine.ExtensionManagement.ExtensionExecutionException Error while starting service with id 'ZenMobile.AddIn.ZenonProjectService.ZenMobile.AddIn.Service.ProjectServiceExtension' Void Start() ~~Server stack trace: ~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.ServiceExtensionController`2.Start()~~ at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)~~ at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)~~~~Exception rethrown at [0]: ~~ at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)~~ at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)~~ at Scada.Internal.AddIn.Engine.Contracts.ExtensionManagement.IServiceExtensionController.Start()~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.ServiceManager.StartService(String instanceId, IServiceExtensionController serviceExtensionController)~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.AddInRunner.StartService(String instanceId, IScadaExtensionNode node)~~ at Scada.Internal.AddIn.Engine.Services.AddInService.Startup(String instanceId)~~System.NullReferenceException Object reference not set to an instance of an object. at ZenMobile.AddIn.Service.ProjectServiceExtension.LogProjectInfo(IProject project)~~ at ZenMobile.AddIn.Service.ProjectServiceExtension.Start(IProject context, IBehavior behavior)~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.ServiceExtensionController`2.Start()

This is a migrated post! Originally posted on 21.06.2019 by user jaroslavurban. Please be aware that information can be outdated.

    Disclaimer

    This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.

    The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.

    Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.

    Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.

    COPA-DATA reserves the right to change this document from time to time at own discretion.


    Ing. Punzenberger COPA-DATA GmbH
    Karolingerstraße 7b · 5020 Salzburg · Austria
    www.copadata.com