Rich
Rich

Reputation: 4248

Can I merge ASP.Net VB and ASP.Net C#

I was wondering if I can merge ASP.Net VB and ASP.Net C#. I made my research and some of the netizens said no here. And this blog and this blog said it is possible. I was wondering if it is possible, how can I access the class of ASP.Net VB to the class of ASP.Net C# from different project?

Upvotes: 1

Views: 410

Answers (3)

Sajjad Ali
Sajjad Ali

Reputation: 114

It is possible to convert two different languages project into one. Simply follow these steps:

  1. Compile VB.Net project
  2. add library references of compiled project into another project which is in ASP.Net C#
  3. Now instantiate the object of referenced library in you C# code and you can access all methods of VB.Net project.

Please don't forget to +1 the answer if it helped. Cheers!

Upvotes: 2

Bhuban Shrestha
Bhuban Shrestha

Reputation: 1324

If you are thinking of creating single ASP.NET project from multiple ASP.NET project which are written in different programming language then that is not possible. Here by creating I mean to say including c# file and vb file in a single project.

But if you are going to add reference (dll reference) of those project in a new project then that is possible.

Upvotes: 1

KeithN
KeithN

Reputation: 434

If they are in different projects, absolutely... Once compiled .Net assemblies can be referenced and accessed regardless of .Net language.

I don't believe however that you can mix source files in the same project, as both use different compilers to compile to IL.

And finally, if you are talking about uncompiled scripts in App Code folder, I'm not sure. I don't work with uncompiled code files due to security reasons.

Upvotes: 2

Related Questions