Showing results 1 to 2 of 2

Thread: IoC inside AddIn

  1. #1
    Join Date

    Default 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=, 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 2594 1 35BC 190703075830,524836 01 00 0003 e:\builds\1_zenon\zenon\zenon800_build\source\cdne twrapper\managed\logclient.cpp 0007 CDNetWrapper::LogClient::LogMessage 0004 98 0027 Scada.Internal.DotNetAddInExtension.AddInIntegrati on.Startup Error while starting service with id 'ZenMobile.AddIn.ZenonProjectService.ZenMobile.Add In.Service.ProjectServiceExtension' Exception information:Scada.Internal.AddIn.Engine.ExtensionM anagement.ExtensionExecutionException Error while starting service with id 'ZenMobile.AddIn.ZenonProjectService.ZenMobile.Add In.Service.ProjectServiceExtension' Void Start() ~~Server stack trace: ~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.Se rviceExtensionController`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.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)~~ at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)~~ at Scada.Internal.AddIn.Engine.Contracts.ExtensionMan agement.IServiceExtensionController.Start()~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.Se rviceManager.StartService(String instanceId, IServiceExtensionController serviceExtensionController)~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.Ad dInRunner.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.Lo gProjectInfo(IProject project)~~ at ZenMobile.AddIn.Service.ProjectServiceExtension.St art(IProject context, IBehavior behavior)~~ at Scada.Internal.AddIn.Engine.ExtensionManagement.Se rviceExtensionController`2.Start()
    Last edited by jaroslavurban : 3rd July 2019 at 09:01 Reason: added log

  2. #2
    Join Date

    Idee Re: IoC inside AddIn

    I had the same problem...

    For each dll you don't find in the scadaAddin file (is a zip file renamed...) inside you have to add an attribute inside AddInInfo.cs like that

    [assembly: ImportAddinAssembly("Microsoft.IO.RecyclableMemoryStream.dll", Scan = true)]

    I had success with this...

    My problem was related OWIN and all it's dependency: my AddInInfo.cs is soooo long.

Similar Threads

  1. Using the Scada.Addin.Contracts API For XML Imports
    By Kyle in forum Add-In Framework
    Replies: 1
    Last Post: 15th May 2019, 07:35
  2. VSTA in Addin Workspace
    By luca.bardon in forum VSTA
    Replies: 2
    Last Post: 9th January 2018, 15:03
  3. Using a button inside a symbol?
    By Evanmj in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 2
    Last Post: 26th February 2016, 09:00
  4. Replies: 1
    Last Post: 17th March 2015, 14:09
  5. Workspace Addin mit VB.Net
    By and12121 in forum VSTA
    Replies: 5
    Last Post: 26th February 2014, 11:55

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts