Skip to content

Shared creation policy is not applied #11

@sobolev88

Description

@sobolev88

Shared creation policy is not applied when ZyanComponent is imported on the server-side.
Two instances are created instead of one.

How to reproduce:

  1. Creating shared service

[ZyanComponent(typeof (ITelphinService))]
[PartCreationPolicy(CreationPolicy.Shared)]
public partial class TelphinService : ITelphinService
{
public event EventHandler Answered;

public void OnAnswered(EventArgs args)
{
    Answered.SafeInvoke(null, args);
}

}

  1. Subscribe to event on client-side

TelphineService.Answered += new EventHandler(TelphinService_Answered);

  1. Raise event on server-side:
    [Import]
    private ITelphinService TelphinService { get; set; }

TelphinService.OnAnswered(new EventArgs());

  1. Event is not raised on client-side

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions