It seems that there are problems with my written library of written extensions in VB.NET.
I2 overloaded extension methods crop ().
When I refer to Lib from the VB.NET project, I see them. If it refers to the C # project, then I can not see them.
What's going on?
It works like this:
- In C # When you call a method with a
outsideorrefparameter, the compiler will calloutorriff Keyword needs to be repeated. This is because it does not make any difference to the language whether the variable is already initialized or not.- In VB.NET, when you call a method with the
ByRefparameter, the compiler lets you repeat theByRefon the calling logic Not necessarily, this fixes it for you because the language does not make any difference whether the variable is already initialized or not. - In VB.NET, when you call a method with the
Therefore, VB.NET can easily solve an extension method by using ByRef . , Because there is only one possible way in which it can be called. However, C # does not know what to do because by saying that there is no syntax for calling method using outside or riff .
All you can do is:
- Write your extension methods again to use the
ByValparameter wherever possible. - If this is not possible, you get stuck with them in normal ways like calling C #.
Comments
Post a Comment