Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# / VB .NET 4.0 | Methodenüberladung mit ByRef und ByValue

Empfohlene Antworten

Veröffentlicht

Guten Abend allerseits,

in meiner C#-Assembly gibt es folgende Klasse:

class Klasse

{

     TResult methode<T1, TResult>(ref T1 p1)

     {

            return default(TResult);

     }


     TResult methode<T1, TResult>(T1 p1)

     {

            return default(TResult);

     }

}
Sofern ich die Assembly in C# nutze kann ich beide Methoden unterscheiden und explizit ansprechen.
void test()

{

    string p1 = string.Empty;

    int i = methode<string, int>(ref p1);

    int x = methode<string, int>(p1);

}

Binde ich die Assembly allerdings unter VB.NET ein, so werden beide Methoden nicht erwähnt, sprich ich kann sie überhaupt nicht ansprechen.

'methode' is ambiguous because multiple kinds of members with this name exist in class 'ClassLibrary1.Klasse'

Eine Abfrage über GetType(Klasse).GetMethods() liefert mir jedoch beide Definitionen zurück.

Es ist nahezu undenkbar die Methoden per Reflection anzusprechen und ich bin auf diese Unterscheidung zwingend angewiesen.

Hat jemand eine elegante Lösung dafür?

Besten Dank,

fetzi

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.