473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Mixing and matching VB and C# in vs.net 2005

I've been working with C# for over a year now without touching vb.net
code. I had a few light years of vb.net before that. No real vb6 or
windows form experience.

Suddenly, I have an assignment where I've been asked to create a few
new pages on an exsisting website. The website is written in vb.net
with vb.net codebehind and classes.

My employer says I can use C# for new stuff If I want.

Is it really possible and what's the cleanest way to do this?

Also, at the old shop where I was at I was the only .NET deployer I
would deploy from TEST to PROD by doing an xcopy of the website
directory. Is this the way most shops deploy from TEST to PROD. And, if
they don't have VSS, can more than one developer develop and change the
same object in the same project at the same time and then deploy
(possibly at the same time)? How do must small shops coordinate
multiple developers working on the same projects/pages?

Finally, I was just playing with VB.NET, and i noticed the code snippet
feature seems to be much more robust or at least easier to read than
what's available in C#, with things like create a folder.. is this
true? and is there a c# comparable for things like:

My.Computer.FileSystem.CreateDirectory(`)
Thanks

Sep 28 '06 #1
3 2069
you can add subdirectories to the App_Code directory
in order to process multiple languages under the App_Code directory.

In order to do this, you need to register each subdirectory in the application's Web.config.

<configuration>
<system.web>
<compilation debug="false">
<codeSubDirectories>
<add directoryName="VB"/>
<add directoryName="CS"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>

Then, simply creating the App_Code\VB and App_Code\CS directories,
and placing your VB and CS files in each, will allow you to use both languages in your app.

This only works in ASP.NET 2.0! ( and is quite easy to implement )

Caveat: this works only for "helper classes".
You cannot place code-behind pages in the individual language directories.

However, it *does* allow you to mix different-language source files in the same app.

An alternative would be to compile your different-language source files
from the command-line, and placing the compiled assemblies in /bin.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================

<ja***@cyberpine.comwrote in message news:11*********************@e3g2000cwe.googlegrou ps.com...
I've been working with C# for over a year now without touching vb.net
code. I had a few light years of vb.net before that. No real vb6 or
windows form experience.

Suddenly, I have an assignment where I've been asked to create a few
new pages on an existing website. The website is written in vb.net
with vb.net codebehind and classes.

My employer says I can use C# for new stuff If I want.

Is it really possible and what's the cleanest way to do this?

Also, at the old shop where I was at I was the only .NET deployer I
would deploy from TEST to PROD by doing an xcopy of the website
directory. Is this the way most shops deploy from TEST to PROD. And, if
they don't have VSS, can more than one developer develop and change the
same object in the same project at the same time and then deploy
(possibly at the same time)? How do must small shops coordinate
multiple developers working on the same projects/pages?

Finally, I was just playing with VB.NET, and i noticed the code snippet
feature seems to be much more robust or at least easier to read than
what's available in C#, with things like create a folder.. is this
true? and is there a c# comparable for things like:

My.Computer.FileSystem.CreateDirectory(`)
Thanks


Sep 28 '06 #2
That's going to be rough.

I did some testing and see the problem is mainly with VS.NET and trying
to compile the two different languages under the same project. I can
try and set up codebehind as C# but vs.net has problems with that.

I read that can have of course have two different projects under the
solution explorer one vb and C#, but it seems kinda messy with two
different web.config files, set of refrences and directories etc...

One thing I can't figure out under VS.NET, I can add a new (different
language) website into my solution and have both visible.. but how do
Open an exsisting project into the current solution without it closing
the one I have open. And what if I want to have 4 projects under my
solution always open and want to close vs.net and open that set of
solutions.

Seems to me mixing and matching is going to be really messy.

If I decide I want to do all new development for a website in C#, and I
create a new website under the old website named c.. ala
g:\web\mysite\c\ and start adding pages there knowing that there might
be menus that cross in and out of that c directory.. would that be a
terrible choice? Also wondering if master and content pages can cross
languages?

This must be a big issue with so many java developers moving into C#
without even looking at vb.net. I wonder if most shops just covert over
cold turkey? I think MS should make it even more seemless somehow,
allow cross language in the same project and even in the same page.
Juan T. Llibre wrote:
you can add subdirectories to the App_Code directory
in order to process multiple languages under the App_Code directory.

In order to do this, you need to register each subdirectory in the application's Web.config.

<configuration>
<system.web>
<compilation debug="false">
<codeSubDirectories>
<add directoryName="VB"/>
<add directoryName="CS"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>

Then, simply creating the App_Code\VB and App_Code\CS directories,
and placing your VB and CS files in each, will allow you to use both languages in your app.

This only works in ASP.NET 2.0! ( and is quite easy to implement )

Caveat: this works only for "helper classes".
You cannot place code-behind pages in the individual language directories.

However, it *does* allow you to mix different-language source files in the same app.

An alternative would be to compile your different-language source files
from the command-line, and placing the compiled assemblies in /bin.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================

<ja***@cyberpine.comwrote in message news:11*********************@e3g2000cwe.googlegrou ps.com...
I've been working with C# for over a year now without touching vb.net
code. I had a few light years of vb.net before that. No real vb6 or
windows form experience.

Suddenly, I have an assignment where I've been asked to create a few
new pages on an existing website. The website is written in vb.net
with vb.net codebehind and classes.

My employer says I can use C# for new stuff If I want.

Is it really possible and what's the cleanest way to do this?

Also, at the old shop where I was at I was the only .NET deployer I
would deploy from TEST to PROD by doing an xcopy of the website
directory. Is this the way most shops deploy from TEST to PROD. And, if
they don't have VSS, can more than one developer develop and change the
same object in the same project at the same time and then deploy
(possibly at the same time)? How do must small shops coordinate
multiple developers working on the same projects/pages?

Finally, I was just playing with VB.NET, and i noticed the code snippet
feature seems to be much more robust or at least easier to read than
what's available in C#, with things like create a folder.. is this
true? and is there a c# comparable for things like:

My.Computer.FileSystem.CreateDirectory(`)
Thanks
Sep 29 '06 #3
I am working on integrating a new site for our company. Our legacy system
interface is entirely in VB (6 and 2005 versions) and the site designers
used C#. Works like a champ as long as you ensure the public interfaces are
CLR compliant. Mixing languages in the same project isn't as simple, but
multiple projects in the same solution can all be easily handled.

Mike Ober.

<ja***@cyberpine.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
That's going to be rough.

I did some testing and see the problem is mainly with VS.NET and trying
to compile the two different languages under the same project. I can
try and set up codebehind as C# but vs.net has problems with that.

I read that can have of course have two different projects under the
solution explorer one vb and C#, but it seems kinda messy with two
different web.config files, set of refrences and directories etc...

One thing I can't figure out under VS.NET, I can add a new (different
language) website into my solution and have both visible.. but how do
Open an exsisting project into the current solution without it closing
the one I have open. And what if I want to have 4 projects under my
solution always open and want to close vs.net and open that set of
solutions.

Seems to me mixing and matching is going to be really messy.

If I decide I want to do all new development for a website in C#, and I
create a new website under the old website named c.. ala
g:\web\mysite\c\ and start adding pages there knowing that there might
be menus that cross in and out of that c directory.. would that be a
terrible choice? Also wondering if master and content pages can cross
languages?

This must be a big issue with so many java developers moving into C#
without even looking at vb.net. I wonder if most shops just covert over
cold turkey? I think MS should make it even more seemless somehow,
allow cross language in the same project and even in the same page.
Juan T. Llibre wrote:
you can add subdirectories to the App_Code directory
in order to process multiple languages under the App_Code directory.

In order to do this, you need to register each subdirectory in the
application's Web.config.
>
<configuration>
<system.web>
<compilation debug="false">
<codeSubDirectories>
<add directoryName="VB"/>
<add directoryName="CS"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>

Then, simply creating the App_Code\VB and App_Code\CS directories,
and placing your VB and CS files in each, will allow you to use both
languages in your app.
>
This only works in ASP.NET 2.0! ( and is quite easy to implement )

Caveat: this works only for "helper classes".
You cannot place code-behind pages in the individual language directories.

However, it *does* allow you to mix different-language source files in the
same app.
>
An alternative would be to compile your different-language source files
from the command-line, and placing the compiled assemblies in /bin.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================

<ja***@cyberpine.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
I've been working with C# for over a year now without touching vb.net
code. I had a few light years of vb.net before that. No real vb6 or
windows form experience.

Suddenly, I have an assignment where I've been asked to create a few
new pages on an existing website. The website is written in vb.net
with vb.net codebehind and classes.

My employer says I can use C# for new stuff If I want.

Is it really possible and what's the cleanest way to do this?

Also, at the old shop where I was at I was the only .NET deployer I
would deploy from TEST to PROD by doing an xcopy of the website
directory. Is this the way most shops deploy from TEST to PROD. And, if
they don't have VSS, can more than one developer develop and change the
same object in the same project at the same time and then deploy
(possibly at the same time)? How do must small shops coordinate
multiple developers working on the same projects/pages?

Finally, I was just playing with VB.NET, and i noticed the code snippet
feature seems to be much more robust or at least easier to read than
what's available in C#, with things like create a folder.. is this
true? and is there a c# comparable for things like:

My.Computer.FileSystem.CreateDirectory(`)
Thanks

Sep 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Andrew McLean | last post by:
I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. Basically, I have two databases containing lists of...
9
by: Chi Man Wong | last post by:
I have a problem using VB which I'll try to explain: In sheet A I have a table with : column 1: dates (e.g. 01-01-2005) over a range of 3 years column 2 till 8: numbers In sheet B I have a...
1
by: Brian Begy | last post by:
Anyone seen this? "Type mismatch could be due to the mixing of a file reference with a project reference " We have solution we are trying to upgrade to VS 2005. We have about 10 projects in...
6
by: Toby Bradshaw | last post by:
Hi, Consider the following: class A { public: virtual bool foo() = 0; };
28
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later...
2
by: laura | last post by:
Hi, I'm looking for the algorithm which does the lowest number of comparison for the string matching problem (in the worst case). I know that the complexity is liniar in the length of the...
4
by: J | last post by:
Hello Group- I have limited programming experience, but I'm looking for a generic way to search through a root directory for subdirectories with similar names, organize and group them by...
2
by: anoosh | last post by:
hi all I want to write a sotred procedure which has a parameter,called @name.The SQL statement must return all rows where this parameter is a subatring of a special column called FirstName.This...
6
by: hsmit.home | last post by:
Hello, I came across a strange error and it's really been bugging me. Maybe someone else has come across this and any insight would be appreciated. What I'm trying to accomplish is using...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.