473,327 Members | 1,979 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,327 software developers and data experts.

Mixing languages in one assembly

BK
I have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This
class produces an Excel object and manipulates it based on some input I
provide. It works fine and has been fully tested.

Meanwhile, another programmer was writing a source file named
RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file
output. He has fully tested his source and it works as we need it.

I *thought* that all I would need to do is add his Cs file to my
project, recompile, and life would be grand. However, intellisense
only shows me the Vb class. So while FormattedOutput.ExcelOutput is
valid, FormattedOutput.RTFOutput is not. We've mixed and matched
different source files in this Solution before, but never mixed
languages in the same assembly. Can this be done?

Apr 5 '06 #1
7 1484

BK wrote:
I have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This
class produces an Excel object and manipulates it based on some input I
provide. It works fine and has been fully tested.

Meanwhile, another programmer was writing a source file named
RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file
output. He has fully tested his source and it works as we need it.

I *thought* that all I would need to do is add his Cs file to my
project, recompile, and life would be grand. However, intellisense
only shows me the Vb class. So while FormattedOutput.ExcelOutput is
valid, FormattedOutput.RTFOutput is not. We've mixed and matched
different source files in this Solution before, but never mixed
languages in the same assembly. Can this be done?


It can be... It just takes manual intervention (I think VS2005 can
handle this - but, I haven't tried it there so I'm not positive). In
other words, you will have to compile and link the code using the
commandline compiler/linker programs.

It would probably be easier to put the C# code in it's own dll and then
reference it from your VB project....

--
Tom Shelton [MVP]

Apr 5 '06 #2
AFAIK :
- you can't mix languages inside the same project.
- if I remember this is a VS.NET limitation. A workaround could be to
compile (using the command line compiler) one of the file to a "module"
(doesn't have anything to do with vb modules, see this rather as a .LIB
file) and then you could be able to compile (wiht the command line compiler)
the other file adding the previous "module"

I actually tried to find this in the doc and saw :
http://msdn.microsoft.com/library/de...ToAssembly.asp

Please let us know (never tried, would like to know if it works).

--
Patrice

"BK" <bk******@hotmail.com> a écrit dans le message de news:
11*********************@i40g2000cwc.googlegroups.c om...
I have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This
class produces an Excel object and manipulates it based on some input I
provide. It works fine and has been fully tested.

Meanwhile, another programmer was writing a source file named
RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file
output. He has fully tested his source and it works as we need it.

I *thought* that all I would need to do is add his Cs file to my
project, recompile, and life would be grand. However, intellisense
only shows me the Vb class. So while FormattedOutput.ExcelOutput is
valid, FormattedOutput.RTFOutput is not. We've mixed and matched
different source files in this Solution before, but never mixed
languages in the same assembly. Can this be done?

Apr 5 '06 #3

"BK" <bk******@hotmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
I have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This
class produces an Excel object and manipulates it based on some input I
provide. It works fine and has been fully tested.

Meanwhile, another programmer was writing a source file named
RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file
output. He has fully tested his source and it works as we need it.

I *thought* that all I would need to do is add his Cs file to my
project, recompile, and life would be grand. However, intellisense
only shows me the Vb class. So while FormattedOutput.ExcelOutput is
valid, FormattedOutput.RTFOutput is not. We've mixed and matched
different source files in this Solution before, but never mixed
languages in the same assembly. Can this be done?


No. One assembly, one language. You will either have to convert to a
single language or create two different projects.

Mythran

Apr 5 '06 #4
Not using the VS IDE, you need to do it by hand using the SDK command-line
compilers / linkers.

You can only mix languages in the same project using the IDE when doing VS
2005 web projects.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"BK" <bk******@hotmail.com> escribió en el mensaje
news:11*********************@i40g2000cwc.googlegro ups.com...
I have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This
class produces an Excel object and manipulates it based on some input I
provide. It works fine and has been fully tested.

Meanwhile, another programmer was writing a source file named
RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file
output. He has fully tested his source and it works as we need it.

I *thought* that all I would need to do is add his Cs file to my
project, recompile, and life would be grand. However, intellisense
only shows me the Vb class. So while FormattedOutput.ExcelOutput is
valid, FormattedOutput.RTFOutput is not. We've mixed and matched
different source files in this Solution before, but never mixed
languages in the same assembly. Can this be done?

Apr 5 '06 #5

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:OA**************@TK2MSFTNGP05.phx.gbl...

"BK" <bk******@hotmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
I have a .NET project named FormattedOuput with output type set to
Class Library. In it, I have a source file named ExcelOutput.Vb. This
class produces an Excel object and manipulates it based on some input I
provide. It works fine and has been fully tested.

Meanwhile, another programmer was writing a source file named
RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file
output. He has fully tested his source and it works as we need it.

I *thought* that all I would need to do is add his Cs file to my
project, recompile, and life would be grand. However, intellisense
only shows me the Vb class. So while FormattedOutput.ExcelOutput is
valid, FormattedOutput.RTFOutput is not. We've mixed and matched
different source files in this Solution before, but never mixed
languages in the same assembly. Can this be done?


No. One assembly, one language. You will either have to convert to a
single language or create two different projects.

Mythran


I stand corrected.

Mythran

Apr 5 '06 #6
BK
What I'm seeing from my research, it can be done but it must be done
from command line calls. It's not the end of the world if I can't do
it, I'll probably just rewrite my part in C# as an excercise. This
other developer and I get along real well here and commonly split
things up. He prefers C#, I prefer Vb. Thanks for all the replies!

Bill

Apr 5 '06 #7

BK wrote:
What I'm seeing from my research, it can be done but it must be done
from command line calls. It's not the end of the world if I can't do
it, I'll probably just rewrite my part in C# as an excercise. This
other developer and I get along real well here and commonly split
things up. He prefers C#, I prefer Vb. Thanks for all the replies!

Bill


You can still share your code without duplicating effort... Just write
them in class libraries/user controls and distribute the dll's. You
can have different projects in the same solution that use different
languages - the problems arise when you want to use different languages
in the same project.

--
Tom Shelton [MVP]

Apr 6 '06 #8

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

Similar topics

4
by: Rudolf | last post by:
Is it possible to add a vb.net source code module to a c# project and if so how? Thanks Rudolf
3
by: Tim | last post by:
I've heard it's possible to write multi-language programs, but can't find any examples of this. I'd like to write a program where the gui is in VB but the non-form classes are written in C#. Is...
3
by: Tim | last post by:
Hi I have a program that I had written in Managed C++ that writes messages to the console while running. I wanted to allow the user to enter commands at the console as well, but this became...
0
by: Rob R. Ainscough | last post by:
I'm getting a bizarre error in the IDE Error List: ****** The Error message ******* Value of type 'MyDLL.Customer' cannot be converted to 'MyDLL.Customer'. Type mismatch could be due to the...
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...
3
by: jason | last post by:
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...
0
by: HeroOfSpielburg | last post by:
Hello, I'm new to the realm of .NET application creation, so please forgive my ignorance. I have been tasked with debugging a problem that arises with using a DLL that contains managed and...
2
by: Newbie19 | last post by:
I was wondering what is the best concept or idea to mixing visual basic with ASP.net page that runs a SQL query on a database. The Visual Basic would be pulling data from another source that is not...
1
by: codefragment | last post by:
Hi (Second CAS question) At the assembly level I have: at the method level I have
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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.