Mixing vb.net and C# in same project

  • Thread starter Thread starter Rudolf
  • Start date Start date
R

Rudolf

Is it possible to add a vb.net source code module to a c#
project and if so how?

Thanks

Rudolf
 
Hello Rudolf,

Thanks for posting in the group.

If you want to paste a VB code slice in C# file, I don't think that is
possible, since C# compiler won't compile VB code.

However, it is possible to use different languages in a single project. You
may need to write command line build file to build the project. In .NET
framework SDK, there is one sample on it. You could access it in C:\Program
Files\Microsoft Visual Studio
.NET\FrameworkSDK\Samples\Technologies\CrossDevLanguage.

This sample demonstrates the use different development languages in a
single project. This sample creates two assemblies. The first is a library
or DLL assembly that defines a simple base class written in managed
extensions for C++. The second assembly is an executable assembly that
defines three derived classes written in C#, VB, and IL (Intermediate
Language). These types derive from each other and ultimately from the base
class written in managed C++. Finally, the executable creates instances of
each of the derived types and calls a virtual method for each. The .NET
Framework is an environment where various developers can work together
seamlessly while developing in their language of choice.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Rudolf" <[email protected]>
!Sender: "Rudolf" <[email protected]>
!Subject: Mixing vb.net and C# in same project
!Date: Thu, 4 Sep 2003 03:05:05 -0700
!Lines: 6
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNyzAOGCuM5l40bQCaPevCQHfcbMw==
!Newsgroups: microsoft.public.dotnet.general
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107235
!NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
!X-Tomcat-NG: microsoft.public.dotnet.general
!
!Is it possible to add a vb.net source code module to a c#
!project and if so how?
!
!Thanks
!
!Rudolf
!
 
Hello Rudolf,

You are welcome.

Thanks for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!Content-Class: urn:content-classes:message
!From: "Rudolf" <[email protected]>
!Sender: "Rudolf" <[email protected]>
!References: <[email protected]>
<[email protected]>
!Subject: RE: Mixing vb.net and C# in same project
!Date: Thu, 4 Sep 2003 06:00:54 -0700
!Lines: 85
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcNy5JNwVQFkpkT1Rd+pEkhBA8mf7w==
!Newsgroups: microsoft.public.dotnet.general
!Path: cpmsftngxa06.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107256
!NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
!X-Tomcat-NG: microsoft.public.dotnet.general
!
!Thanks, I'll have a look at it
!
!Rudolf
!
!>-----Original Message-----
!>Hello Rudolf,
!>
!>Thanks for posting in the group.
!>
!>If you want to paste a VB code slice in C# file, I don't
!think that is
!>possible, since C# compiler won't compile VB code.
!>
!>However, it is possible to use different languages in a
!single project. You
!>may need to write command line build file to build the
!project. In .NET
!>framework SDK, there is one sample on it. You could
!access it in C:\Program
!>Files\Microsoft Visual Studio
!>.NET\FrameworkSDK\Samples\Technologies\CrossDevLanguage.
!>
!>This sample demonstrates the use different development
!languages in a
!>single project. This sample creates two assemblies. The
!first is a library
!>or DLL assembly that defines a simple base class written
!in managed
!>extensions for C++. The second assembly is an executable
!assembly that
!>defines three derived classes written in C#, VB, and IL
!(Intermediate
!>Language). These types derive from each other and
!ultimately from the base
!>class written in managed C++. Finally, the executable
!creates instances of
!>each of the derived types and calls a virtual method for
!each. The .NET
!>Framework is an environment where various developers can
!work together
!>seamlessly while developing in their language of choice.
!>
!>Hope that helps.
!>
!>Best regards,
!>Yanhong Huang
!>Microsoft Online Partner Support
!>
!>Get Secure! - www.microsoft.com/security
!>This posting is provided "AS IS" with no warranties, and
!confers no rights.
!>
!>--------------------
!>!Content-Class: urn:content-classes:message
!>!From: "Rudolf" <[email protected]>
!>!Sender: "Rudolf" <[email protected]>
!>!Subject: Mixing vb.net and C# in same project
!>!Date: Thu, 4 Sep 2003 03:05:05 -0700
!>!Lines: 6
!>!Message-ID: <[email protected]>
!>!MIME-Version: 1.0
!>!Content-Type: text/plain;
!>! charset="iso-8859-1"
!>!Content-Transfer-Encoding: 7bit
!>!X-Newsreader: Microsoft CDO for Windows 2000
!>!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!>!Thread-Index: AcNyzAOGCuM5l40bQCaPevCQHfcbMw==
!>!Newsgroups: microsoft.public.dotnet.general
!>!Path: cpmsftngxa06.phx.gbl
!>!Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.general:107235
!>!NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
!>!X-Tomcat-NG: microsoft.public.dotnet.general
!>!
!>!Is it possible to add a vb.net source code module to a
!c#
!>!project and if so how?
!>!
!>!Thanks
!>!
!>!Rudolf
!>!
!>
!>.
!>
!
 
Back
Top