'System.DateTime' is not a valid Windows Runtime parameter type

前端 未结 2 934
南旧
南旧 2021-02-05 11:33

I\'m using a C# class and it works perfectly fine in my Windows Store App (C#). But when I try to use it in a Windows Runtime Compenent I get the following error:

2条回答
  •  太阳男子
    2021-02-05 12:25

    I was also facing the same issue in my Windows Runtime Component as below.

    Severity Code Description Project File Line Suppression State
    Error Method '.put_TxPower(System.SByte)' has parameter 'value' of type 'System.SByte'.  
    System.SByte' is not a valid Windows Runtime parameter type.
    

    As Lukasz Madon mentioned in the comment, changing the access modifier from the public to internal worked for me.

    Before:

    public sbyte TxPower { get; set; }
    

    After:

    internal sbyte TxPower { get; set; }
    

提交回复
热议问题