C# and VB in ASP.NET

L

Leslie

Hello

We have a C# ASP.NET project, however some of my new developers are VB.NET
users. Can we write both C# and VB.NET languages in one ASP.NET project?

Thanks,

Leslie
 
A

Allen Chen [MSFT]

Hi Leslie,

My name is Allen Chen. It's my pleasure to work with you on this issue.

To achieve the requirement I think you can either:

Let your VB.NET developers create class libraries and add the assemblies as
the references of your C# project.

Or:

If you're using ASP.NET Web Site you can try:

1. Create two folders in the App_Code folder. Name them as "cscode" and
"vbcode".

2. Add the VB.NET class file and C# class file into the respective folders.

3. Add the following tag in the Web.config file:

<compilation>
<codeSubDirectories>
<add directoryName="vbcode" />
<add directoryName="cscode" />
</codeSubDirectories>
</compilation>

Please have a try and let me know if it works. If you have further
questions please feel free to ask.

Regards,
Allen Chen
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Göran Andersson

Leslie said:
Hello

We have a C# ASP.NET project, however some of my new developers are
VB.NET users. Can we write both C# and VB.NET languages in one ASP.NET
project?

Thanks,

Leslie

Yes, you can mix C# and VB pages in a web site project, but not in a web
application project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top