473,320 Members | 1,839 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.

Curiosity: C# and C++ in one assembly

Hi all,

Just from a pure curiosity standpoint, would it be possible to have an
assembly with both c++ and c#? Google searches seem to hint at a "yes"
but I'm not so sure.

thanks,
HC
Nov 21 '08 #1
3 1654
On Nov 21, 10:06 am, Henri.Chinas...@googlemail.com wrote:
Hi all,

Just from a pure curiosity standpoint, would it be possible to have an
assembly with both c++ and c#? Google searches seem to hint at a "yes"
but I'm not so sure.

thanks,
HC
You cannot do it from VS, I'm not 100% sure than you cannot do it from
the command line. If yes it will not be trivial.

BTW, I assume you are talking about managed C++ right?
Nov 21 '08 #2
It should be noted that Jeremy's response is incorrect.

Assuming managed C++, you can compile one of your projects into a
netmodule (let's assume the C++ one to start). When compiling the C# code,
on the command line, you would use the /addmodule switch and reference the
C++ module, and it will be included in the assembly and its manifest.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<He*************@googlemail.comwrote in message
news:b4**********************************@c36g2000 prc.googlegroups.com...
Hi all,

Just from a pure curiosity standpoint, would it be possible to have an
assembly with both c++ and c#? Google searches seem to hint at a "yes"
but I'm not so sure.

thanks,
HC

Nov 21 '08 #3


"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:#G**************@TK2MSFTNGP03.phx.gbl...
It should be noted that Jeremy's response is incorrect.

Assuming managed C++, you can compile one of your projects into a
netmodule (let's assume the C++ one to start). When compiling the C#
code, on the command line, you would use the /addmodule switch and
reference the C++ module, and it will be included in the assembly and its
manifest.
Also note that while they are then part of the same assembly for security
purposes, I believe they are still separate files (multiple-file assembly).

There is an ILMerge utility around somewhere that would generate a single
file, not sure if it is updated to support the latest .NET assembly format.
>
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<He*************@googlemail.comwrote in message
news:b4**********************************@c36g2000 prc.googlegroups.com...
>Hi all,

Just from a pure curiosity standpoint, would it be possible to have an
assembly with both c++ and c#? Google searches seem to hint at a "yes"
but I'm not so sure.

thanks,
HC

Nov 21 '08 #4

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

Similar topics

26
by: nospam | last post by:
Just wondering, What do you think the difference in performance would be between (1.) Compiled C# (2.) Compiled C++ (3.) and Assembly Language And how would the mix be if some if any of...
2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
11
by: Sensei | last post by:
Hi again! I have still curiosity about the reason of some C constructs/keywords... The first is about static functions. What was the reason of restricting a function to be visible just in a...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
3
by: alainpoint | last post by:
I know Google are using Python for testing purposes. But for the rest ? is it PHP or Java or .NET? Which technology is rendering the google main page? And of course th obvious question, why not...
1
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been...
2
by: Paul | last post by:
Hi, I have experience in Java and C++ but I am rather new to C# and just started learning it. I am using Visual C# 2005 Express Edition and I found that there is a file called "AssemblyInfo.cs",...
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
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.