asp.net - Is it possible to call a vb function from C# (same project) -
i have hybrid mvc/webforms project created in vs 1013 both vb , c#. need call vb functions c# code. not seem work, cannot access vb functions or classes c# or visa-versa.
is possible? how?
so long stay cls compliant, should able use public methods declared in vb.net assemblies directly c#, , vice versa.
using system; // assembly marked compliant. [assembly: clscompliant(true)] // class marked compliant. [clscompliant(true)] public class mycompliantclass { // changevalue exposes uint32, not in cls. // compile-time warning results. public void changevalue(uint32 value){ } public static void main( ) { int = 2; console.writeline(i); } } some language features (like parameterized properties, example, available in vb.net) not available in both languages, you'll have watch out those. cls compliance conservative approach; if avoid language-specific features, ought able compile assemblies, reference 1 other, , use methods across assemblies without further effort.
i don't think can mix c# code , vb.net code in same assembly, you'll have put c# code in 1 project , vb.net code in another.
Comments
Post a Comment