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?
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
You've declared uri as object instead of Uri.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So obvious. I must have looked at that line 20 times and never saw it. Just use AS instead of "=". Thank you.