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

Here's one for the gurus

Hello all,

I've thought about this for a while, but can't seem
to find any examples OR explanations, so I'm just
gonna throw it out there.

I know that .NET allows for the use of multiple
programming languages, and I know all about how
to, say, write a .dll in C# and then use it in a VB.NET
application by referencing it in the project (or from
the command line compiler). What I am wondering
is, is there a way to use multiple languages and then
compile them all into the same assembly as
embedded entities?

Say I had two programmers working on a project.
One is good with C# and the other just cannot get
C# at all and insists on using VB. Once the two have
written their respective classes, etc., and the project
is ready to be compiled, can everything be put into
one assembly WITHOUT referencing anything?
After looking around, I have not come across
anything that looks like it will work, or maybe I am
just missing it altogether. If this is not clear, here is
what I mean:

I have One.cs and Two.cs

Now, I can just use "csc One.cs Two.cs" and make
one assembly that does not necessarily rely on any
other assembly (except normal System.* and such).

What if I have One.cs and Two.vb? Is there any way
to compile these two together like the above?

The only way I can think of is to give the two the same
namespace, compile both with their respective
compiler, and then use ILDASM to dump them both.
After that, I could just ILASM the two together and I
have actually done that. I'm just hoping that this is
not the only way. Surely MS didn't do THAT to us, did
they?
Jul 21 '05 #1
4 1218
I'm not exactly sure what you're asking here, but if I'm getting the part
about "One.cs" and Two.vb" maybe creating modules instead of assemblies will
help. Look in the .NET reference for "Multifile Assembly Example". I think
..netmodules are what you're looking for. The only problem is that Visual
Studio does not support this type of output so you'll have to build from the
command line or use something like nAnt.

Still, the "way of .NET" is to create lots of little assemblies that
encapsulate functionality. So I don't see why it's a big deal to just
compile the VB code and the C# code into their corresponding assemblies? If
you have dependency issues you might want to create a third assembly with
interfaces and reference that instead of having the two implementation
assemblies depend on each other.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Gary Morris" <gm*******@carolina.rr.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello all,

I've thought about this for a while, but can't seem
to find any examples OR explanations, so I'm just
gonna throw it out there.

I know that .NET allows for the use of multiple
programming languages, and I know all about how
to, say, write a .dll in C# and then use it in a VB.NET
application by referencing it in the project (or from
the command line compiler). What I am wondering
is, is there a way to use multiple languages and then
compile them all into the same assembly as
embedded entities?

Say I had two programmers working on a project.
One is good with C# and the other just cannot get
C# at all and insists on using VB. Once the two have
written their respective classes, etc., and the project
is ready to be compiled, can everything be put into
one assembly WITHOUT referencing anything?
After looking around, I have not come across
anything that looks like it will work, or maybe I am
just missing it altogether. If this is not clear, here is
what I mean:

I have One.cs and Two.cs

Now, I can just use "csc One.cs Two.cs" and make
one assembly that does not necessarily rely on any
other assembly (except normal System.* and such).

What if I have One.cs and Two.vb? Is there any way
to compile these two together like the above?

The only way I can think of is to give the two the same
namespace, compile both with their respective
compiler, and then use ILDASM to dump them both.
After that, I could just ILASM the two together and I
have actually done that. I'm just hoping that this is
not the only way. Surely MS didn't do THAT to us, did
they?

Jul 21 '05 #2
In traditional programming environments, you would compile both something
like a.cs and b.vb into a.obj and b.obj (.obj is an "object module"), and
then "link" them together into a single executable.

The current .Net toolset doesn't quite allow this. You can "fake it", just
as you outline, by doing something like compiling a.cs and b.vb, and then
using a disassembler to disassemble them to .il code, and then using an
assembler to assemble and link them both together into an executable.
That's kind of kludgy, but it definitely works.

In Whidbey, I believe the plan is to allow the .Net "linker" (which I think
is al.exe - I don't use it much) to (optionally) statically link .netmodule
files together, instead of just the current model where an executable is
built that has a reference to the .netmodule, and requires the .netmodule as
a separate file. So Whidbey will directly support what you are talking
about.

--Don

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Gary Morris" <gm*******@carolina.rr.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello all,

I've thought about this for a while, but can't seem
to find any examples OR explanations, so I'm just
gonna throw it out there.

I know that .NET allows for the use of multiple
programming languages, and I know all about how
to, say, write a .dll in C# and then use it in a VB.NET
application by referencing it in the project (or from
the command line compiler). What I am wondering
is, is there a way to use multiple languages and then
compile them all into the same assembly as
embedded entities?

Say I had two programmers working on a project.
One is good with C# and the other just cannot get
C# at all and insists on using VB. Once the two have
written their respective classes, etc., and the project
is ready to be compiled, can everything be put into
one assembly WITHOUT referencing anything?
After looking around, I have not come across
anything that looks like it will work, or maybe I am
just missing it altogether. If this is not clear, here is
what I mean:

I have One.cs and Two.cs

Now, I can just use "csc One.cs Two.cs" and make
one assembly that does not necessarily rely on any
other assembly (except normal System.* and such).

What if I have One.cs and Two.vb? Is there any way
to compile these two together like the above?

The only way I can think of is to give the two the same
namespace, compile both with their respective
compiler, and then use ILDASM to dump them both.
After that, I could just ILASM the two together and I
have actually done that. I'm just hoping that this is
not the only way. Surely MS didn't do THAT to us, did
they?

Jul 21 '05 #3
Hi,

The following groups post outlines the steps required to build a multi-file
assembly as well as some problems you might encounter. In the post all
sources where in C#, but that does not have to be the case.

http://tinyurl.com/3grcu
OR
http://groups.google.com/groups?hl=e...or_za%2Bal.exe

Hope this helps

--
Chris Taylor
http://dotnetjunkies.com/WebLog/chris.taylor/
"Gary Morris" <gm*******@carolina.rr.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello all,

I've thought about this for a while, but can't seem
to find any examples OR explanations, so I'm just
gonna throw it out there.

I know that .NET allows for the use of multiple
programming languages, and I know all about how
to, say, write a .dll in C# and then use it in a VB.NET
application by referencing it in the project (or from
the command line compiler). What I am wondering
is, is there a way to use multiple languages and then
compile them all into the same assembly as
embedded entities?

Say I had two programmers working on a project.
One is good with C# and the other just cannot get
C# at all and insists on using VB. Once the two have
written their respective classes, etc., and the project
is ready to be compiled, can everything be put into
one assembly WITHOUT referencing anything?
After looking around, I have not come across
anything that looks like it will work, or maybe I am
just missing it altogether. If this is not clear, here is
what I mean:

I have One.cs and Two.cs

Now, I can just use "csc One.cs Two.cs" and make
one assembly that does not necessarily rely on any
other assembly (except normal System.* and such).

What if I have One.cs and Two.vb? Is there any way
to compile these two together like the above?

The only way I can think of is to give the two the same
namespace, compile both with their respective
compiler, and then use ILDASM to dump them both.
After that, I could just ILASM the two together and I
have actually done that. I'm just hoping that this is
not the only way. Surely MS didn't do THAT to us, did
they?

Jul 21 '05 #4
Thanks, fellows,

That pretty much tells me what I wanted to know. I have fooled around with
the .netmodules, at first thinking that these were intended to be embedded
into an assembly at compile time, but soon found that not to be the case.

As for al.exe, I haven't really done much with it (yet), though it looks
like it
can accomplish what I'm after.

I'm not really averse to using referenced assemblies, in fact they are
indispensable with a large project. I was just thinking of what could happen
in an environment where C#, VB, JS, and even Delphi.net were being used
to create a project. Sure, it might be just as easy to assign the C# guy all
of the code for a single assembly instead of trying to tie an assembly
together from multiple languages, but there might be a situation where this
would not be feasible. In that case, I would hope that there would be a way
to compile the assembly using code from two or more languages, and now
I know that there is, it's just not as convenient as using one compiler.

"Don Dumitru [MSFT]" <do***@online.microsoft.com> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
In traditional programming environments, you would compile both something
like a.cs and b.vb into a.obj and b.obj (.obj is an "object module"), and
then "link" them together into a single executable.

The current .Net toolset doesn't quite allow this. You can "fake it", just as you outline, by doing something like compiling a.cs and b.vb, and then
using a disassembler to disassemble them to .il code, and then using an
assembler to assemble and link them both together into an executable.
That's kind of kludgy, but it definitely works.

In Whidbey, I believe the plan is to allow the .Net "linker" (which I think is al.exe - I don't use it much) to (optionally) statically link ..netmodule files together, instead of just the current model where an executable is
built that has a reference to the .netmodule, and requires the .netmodule as a separate file. So Whidbey will directly support what you are talking
about.

--Don

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Morris" <gm*******@carolina.rr.com> wrote in message
news:eE**************@TK2MSFTNGP12.phx.gbl...
Hello all,

I've thought about this for a while, but can't seem
to find any examples OR explanations, so I'm just
gonna throw it out there.

I know that .NET allows for the use of multiple
programming languages, and I know all about how
to, say, write a .dll in C# and then use it in a VB.NET
application by referencing it in the project (or from
the command line compiler). What I am wondering
is, is there a way to use multiple languages and then
compile them all into the same assembly as
embedded entities?

Say I had two programmers working on a project.
One is good with C# and the other just cannot get
C# at all and insists on using VB. Once the two have
written their respective classes, etc., and the project
is ready to be compiled, can everything be put into
one assembly WITHOUT referencing anything?
After looking around, I have not come across
anything that looks like it will work, or maybe I am
just missing it altogether. If this is not clear, here is
what I mean:

I have One.cs and Two.cs

Now, I can just use "csc One.cs Two.cs" and make
one assembly that does not necessarily rely on any
other assembly (except normal System.* and such).

What if I have One.cs and Two.vb? Is there any way
to compile these two together like the above?

The only way I can think of is to give the two the same
namespace, compile both with their respective
compiler, and then use ILDASM to dump them both.
After that, I could just ILASM the two together and I
have actually done that. I'm just hoping that this is
not the only way. Surely MS didn't do THAT to us, did
they?


Jul 21 '05 #5

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

Similar topics

5
by: Ali Eghtebas | last post by:
Hi, I've made this regex to catch the start of a valid multiline comment such as "/*" in e.g. T-SQL code. "(?<=^(?:*'*')*?*)(?<!^(?:*'*')*?--.*)/\*.*?$" With Multiline option on. As we know...
1
by: Alex | last post by:
I'm sure that the following is possible, I just need a little help please. I have a object which I declare as a application object "gObj". I need to use "gObj" with all sessions. I need...
4
by: Zach Martin | last post by:
Working on developing a smart client application and I am trying to get past one nasty stumbling block. Hoping someone with previous smart client deployment experience can steer me in the right...
0
by: Greg Gilman | last post by:
The Los Angeles SQL Server Professionals Group is hosting the LA Winter SQL Server Gurus Event at UCLA on February 17th and 19th, 2005. This once-in-a-lifetime event will feature nationally...
3
by: OhMyGaw | last post by:
Hello Excel/automation Gurus, I am working on an application where I have to keep a centralized database of all macros distributed to user and save the changes back on a nightly basis back to...
3
by: Marek | last post by:
Hello gurus! I wrote a code in VBS, that will check, that current user is in one from three groups. But i don't know how asimilate it with asp.net. This page will be a bridge between 2 - main...
1
by: Gary Morris | last post by:
Hello all, I've thought about this for a while, but can't seem to find any examples OR explanations, so I'm just gonna throw it out there. I know that .NET allows for the use of multiple...
0
by: bruce | last post by:
Hi.. I'm not that familiar with Pythin, but I wasn wondering if there are any XPath/Python Gurus that I might be able to talk to regarding screen scraping applications... Thanks -Bruce...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.