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

Compile C# and VB.Net code together?

Hello,

I have a Windows Forms control written in VB.Net which I want to include it
to my C# project...

For a special reason,instead of distributing the dll with my ap, I want it
to compile and link it into my C# code...Is it possible?

Thanks in advance...

Özden
Nov 15 '05 #1
5 1696
Özden Irmak <oz********@isnet.net.tr> wrote:
I have a Windows Forms control written in VB.Net which I want to include it
to my C# project...

For a special reason,instead of distributing the dll with my ap, I want it
to compile and link it into my C# code...Is it possible?


From the command line, it is - you can compile each of your bits of
codes into a module, and then link the modules into a single assembly.
However, there's no way of doing this from VS.NET.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Hello,

I didn't use command line compiler so far and don't know anything about it?

Any sample can you provide or a resource in web I can check?

Regards,

Özden

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Özden Irmak <oz********@isnet.net.tr> wrote:
I have a Windows Forms control written in VB.Net which I want to include it to my C# project...

For a special reason,instead of distributing the dll with my ap, I want it
to compile and link it into my C# code...Is it possible?


From the command line, it is - you can compile each of your bits of
codes into a module, and then link the modules into a single assembly.
However, there's no way of doing this from VS.NET.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Özden Irmak <oz********@isnet.net.tr> wrote:
I didn't use command line compiler so far and don't know anything about it?

Any sample can you provide or a resource in web I can check?


You'd need to use csc to compile the C# code and vbc to compile the
VB.NET code. In both cases, use /t:module to produce modules. Then use
al to link them together, eg:

csc /t:module File1.cs
vbc /t:module File2.cs

al /t:exe /main:Foo.Main File1.netmodule File2.netmodule

(Untested, but I believe it'll work.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4
Jon Skeet [C# MVP] <sk***@pobox.com> wrote:
vbc /t:module File2.cs


Whoops - this should of course be File2.vb or whatever.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5
Thank you very much...I'll try it...

Özden

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Jon Skeet [C# MVP] <sk***@pobox.com> wrote:
vbc /t:module File2.cs


Whoops - this should of course be File2.vb or whatever.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #6

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

Similar topics

2
by: LP | last post by:
Hi, I have a site which runs on .Net technology. The site is already deployed and running. I need to change 1 file for some small enhancement. Please tell me, how can I compile that 1 file and...
3
by: Laax | last post by:
Hi, I am trying to compile a .cc file and get the following error. I have translated the error message from original japanese text. So, it may not look exactly like standard(English) error...
4
by: Greger | last post by:
Dear all, what do you people use for organising code for optimal compile time? I have an app , gui + core + file ops, which is growing and compile time is too long, need a better way of organising...
7
by: Profetas | last post by:
In a c program I have a var with the name of a file that I want to compile, how would I compile it using c code?
1
by: Keith Clark | last post by:
When I load a csharp program into the MS DbgCLR.exe debugger and trace it everything is fine the first time. Assume now, I change somewhere a code statement in the source file (outside the...
4
by: nickpreiser | last post by:
Hi Everyone, I trying to get a build of Python together to run on an Embedded Linux / Mips machine. I run the ./configure --host= XXXmips(my mips proc) --build=XXX x86(my pc). and the...
9
by: Boris Yeltsin | last post by:
I use Master Pages, so I make use of URL rebasing through the ~ operator, like this in the <head>: <link runat="server" href="~/Root.master.css" media="screen" rel="stylesheet" type="text/css" />...
3
by: Ezmeralda | last post by:
Hello, currently, I have one class-library which is generated from a c++.net class library project. Into this project, I cannot include C# files. On the other hand I have some C#-Code which...
21
by: sevak316 | last post by:
I wasn't sure how what subject to put for this, but what I really want to know is how to compile code which is located outside of my Visual Studio project folder. For example if my project is...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.