Link to home
Start Free TrialLog in
Avatar of mpdillon
mpdillon

asked on

Argument matching parameter 'baseAddresses' narrows from 'Object' to 'System.Uri'

I am creating a WCF Service in a Console application (based on the article. I cannot post the URL to the article. ). I am getting the error in the title of this article on the second DIM statement.

What does it mean?
And how do I eliminate it?

Imports System.ServiceModel
Imports System.ServiceModel.Description

Module Module1
    Dim uri = New Uri("http://localhost:8240/demo/wcf/samples")
    Dim host As New ServiceHost(GetType(PersonService), uri)  '<== Error occurs here. The uri is underlined in blue with this error message.
    Sub Main()

    End Sub
    'Argument matching parameter 'baseAddresses' narrows from 'Object' to 'System.Uri'
End Module

Open in new window

Avatar of ste5an
ste5an
Flag of Germany image

You've declared uri as object instead of Uri.
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mpdillon
mpdillon

ASKER

So obvious. I must have looked at that line 20 times and never saw it. Just use AS instead of "=".  Thank you.