troubleshooting Question

"Not Most Specific" Trying to use extensions

Avatar of stevejung
stevejung asked on
.NET ProgrammingC#
5 Comments1 Solution849 ViewsLast Modified:
I am trying to create some extension to work with a double. One of them is below. I just want to have a bunch of them set up this way so that I don't have to wrap everything. Whenever I try to compile after using it I get the following error message. I looked in a lot of places and cannot find anyone having the same issue.

Error      2      Overload resolution failed because no accessible 'ToSingle' is most specific for these arguments:
    Extension method 'Public Function ToSingle() As Single' defined in 'DLL_GraphicsWindow.modExtensions': Not most specific.
    Extension method 'Public Function ToSingle() As Single' defined in 'DLL_GraphicsWindow.modExtensions': Not most specific.      C:\Program Files\SMP-NET\DLL_GraphicsWindow\User Controls\GDWDisplay.vb      1004      42      DLL_GraphicsWindow

<Extension()> Public Function ToSingle(ByVal pDouble As Double) As Single
        Return CSng(pDouble)
    End Function
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros