Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 86251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:13:00+00:00 2026-05-10T22:13:00+00:00

I was working with the generic class in vb.net. And it seems extension method

  • 0

I was working with the generic class in vb.net.
And it seems extension method cannot be applied to generic class without specifying the type.

I have this generic class

Public Class MyGeneric(Of T)     'Methods and properties go here      '     ' End Class   

This is Ok

<Extension()> _ Public Sub DoSomething(ByVal myGenericDoubleObj As MyGen(Of Double))  End Sub   

This is NOT Ok(IDE gives me error T as not defined.)

<Extension()> _ Public Sub DoSomethingGeneric(ByVal myGenericObj As MyGen(Of T))  End Sub 

Is this something to do with the static checking of the .Net.
Saying me ‘Something which may you try with doing with Type T is may not compatible and I will not allow you to do it.’

P.S. All the this pain I have taken as Generic Class comes from another library, And used at many different places. I am little wary of inheriting and adding this method in my inherited generic class.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:13:01+00:00Added an answer on May 10, 2026 at 10:13 pm

    If you make your extension method a generic method it should work

    i.e DoSomething (Of T) () instread of just DoSomething()

    <Extension()> _ Public Sub DoSomething(Of T)(ByVal myGenericObj As MyGeneric(Of T)) End Sub 

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working with .Net 2.0 and have an interface whose generic type
Previous working asp.net webforms app now throws this error: System.MissingMethodException: Method not found The
In a proof-of-concept project I'm working on, I have a generic abstract class that
I am working with a generic data structure, say MyGeneric<Type> . There is a
I'm working on creating a new base class for an asp.net app in order
I am working in ASP .net 2.0. I am a learner. I have a
I have code that works in a .NET 3.5 app that isn't working when
This issue is technology agnostic, but I am working with C# and ASP.NET and
I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on
I am working on an asp.net web app, and I have few classes in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.