Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conversion in VB.NET does not work
Message
De
15/07/2014 03:11:34
 
 
À
14/07/2014 14:33:16
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01603662
Message ID:
01603685
Vues:
70
This message has been marked as the solution to the initial question of the thread.
>From this page:
>
>http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.messageencodingbindingelement(v=vs.110).aspx
>
>...I converted the BuildChannelListener() method.
>
>This gives this:
>
>
>    Public Overrides Function BuildChannelListener(Of TChannel)(context As System.ServiceModel.Channels.BindingContext) _
>     As System.ServiceModel.Channels.IChannelListener(Of TChannel)
>        If context Is Nothing Then
>            Throw New ArgumentNullException("context")
>        End If
>
>        context.BindingParameters.Add(Me)
>        Return context.BuildInnerChannelListener(Of TChannel)()
>    End Function
>
>
>This gives:
>
>"Public Overrides Function BuildChannelListener(Of TChannel)(context As System.ServiceModel.Channels.BindingContext) As System.ServiceModel.Channels.IChannelListener(Of TChannel)' cannot override 'Public Overridable Function BuildChannelListener(Of TChannel As {System.ServiceModel.Channels.IChannel, Class})(context As System.ServiceModel.Channels.BindingContext) As System.ServiceModel.Channels.IChannelListener(Of TChannel)' because they differ by type parameter constraints."
>
>"Type argument 'TChannel' does not inherit from or implement the constraint type 'System.ServiceModel.Channels.IChannel'."
>
>"Type argument 'TChannel' does not satisfy the 'Class' constraint for type parameter 'TChannel'."
>
>All the other methods work ok on the conversion. This one at the designer level it does not work that much.
>
>Anyone would know what I am missing?

Maybe;
    Public Overrides Function BuildChannelListener(Of TChannel As {Class, IChannel})(context As BindingContext) _
As IChannelListener(Of TChannel)
        If context Is Nothing Then
            Throw New ArgumentNullException("context")
        End If

        context.BindingParameters.Add(Me)
        Return context.BuildInnerChannelListener(Of TChannel)()
    End Function
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform