473,385 Members | 1,356 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 to native

How can I compile my VS2005 c# code to not be dependent on CLR to run?

I want people that install my software to be able to run it without
having to bother with CLR's and "Windows installers".
I would like to generate a binary for lets say Windows XP.

How do I do this?

Oct 24 '06 #1
6 1920
Marcus wrote:
How can I compile my VS2005 c# code to not be dependent on CLR to run?

I want people that install my software to be able to run it without
having to bother with CLR's and "Windows installers".
I would like to generate a binary for lets say Windows XP.

How do I do this?
Hi Marcus,

I've heard of something called NGen, something to do with native generation
I think. It may be what you're looking for, but be warned: C# isn't
designed for this. It's /supposed/ to be dependant on the CLR. That's
it's whole purpose, in fact.

--
Hope this helps,
Tom Spink

Google first, ask later.
Oct 24 '06 #2

"Marcus" <ma************@koping.netwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
How can I compile my VS2005 c# code to not be dependent on CLR to run?

I want people that install my software to be able to run it without
having to bother with CLR's and "Windows installers".
I would like to generate a binary for lets say Windows XP.

How do I do this?
To add to Tom's admonition. The language *designed* for what you want
(available in Visual Studio) is C++.
Oct 24 '06 #3
Marcus,

I'm sure this has some limitations, but here's the answer to how to run
..NET code without the CLR installed:

http://www.xenocode.com/
Tom,

NGen simply optimizes code for a particular local machine/platform. For
instance, if you're running an AMD processor, NGen will give you code
that may take advantage of some AMD-specific function calls. Something
like that. You still need the CLR.
Stephan

Tom Spink wrote:
Marcus wrote:
How can I compile my VS2005 c# code to not be dependent on CLR to run?

I want people that install my software to be able to run it without
having to bother with CLR's and "Windows installers".
I would like to generate a binary for lets say Windows XP.

How do I do this?

Hi Marcus,

I've heard of something called NGen, something to do with native generation
I think. It may be what you're looking for, but be warned: C# isn't
designed for this. It's /supposed/ to be dependant on the CLR. That's
it's whole purpose, in fact.

--
Hope this helps,
Tom Spink

Google first, ask later.
Oct 24 '06 #4
ssamuel wrote:
Marcus,

I'm sure this has some limitations, but here's the answer to how to run
.NET code without the CLR installed:

http://www.xenocode.com/
Tom,

NGen simply optimizes code for a particular local machine/platform. For
instance, if you're running an AMD processor, NGen will give you code
that may take advantage of some AMD-specific function calls. Something
like that. You still need the CLR.
Stephan

Tom Spink wrote:
>Marcus wrote:
How can I compile my VS2005 c# code to not be dependent on CLR to run?

I want people that install my software to be able to run it without
having to bother with CLR's and "Windows installers".
I would like to generate a binary for lets say Windows XP.

How do I do this?

Hi Marcus,

I've heard of something called NGen, something to do with native
generation
I think. It may be what you're looking for, but be warned: C# isn't
designed for this. It's /supposed/ to be dependant on the CLR. That's
it's whole purpose, in fact.

--
Hope this helps,
Tom Spink

Google first, ask later.
Cool. Cheers, Stephan.

--
Hope this helps,
Tom Spink

Google first, ask later.
Oct 24 '06 #5
ssamuel wrote:
NGen simply optimizes code for a particular local machine/platform. For
instance, if you're running an AMD processor, NGen will give you code
that may take advantage of some AMD-specific function calls. Something
like that. You still need the CLR.
You might be able to make specifically targeted builds, but normally you
would make a build targeted at any processor. That disables any specific
optimizations.

The JIT compiler on the other hand can always use specific
optimizations, as it always knows what processor the code will be run
on. So in practice it's the other way around; NGen creates an
un-optimized build.
Oct 24 '06 #6
Göran Andersson <gu***@guffa.comwrote:
ssamuel wrote:
NGen simply optimizes code for a particular local machine/platform. For
instance, if you're running an AMD processor, NGen will give you code
that may take advantage of some AMD-specific function calls. Something
like that. You still need the CLR.
You might be able to make specifically targeted builds, but normally you
would make a build targeted at any processor. That disables any specific
optimizations.

The JIT compiler on the other hand can always use specific
optimizations, as it always knows what processor the code will be run
on. So in practice it's the other way around; NGen creates an
un-optimized build.
While NGen doesn't perform all the optimisations (for reasons I'm not
clear on) it *does* know which processor it will be run on - if you
change processor, the NGen'd code won't be used any more.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 25 '06 #7

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

Similar topics

7
by: kecebong | last post by:
I tried to compile php 4.3.3 with gd but it doesn't work, it wasnt show in phpinfo(). My system is redhat 9 and apache 2.0.47 webserver.
2
by: Charles | last post by:
Dear sirs, I'm doing some investigations on the Python language. I'd like to know if it is possible to compile Python code made for the web (an online database for instance), and to run it using...
2
by: os2 | last post by:
hi i tried to improve performance on for some trigonometry calcule i read http://www.javaworld.com/javatips/jw-javatip141.html? i do tmp@linux:~/bench> echo $CLASSPATH
2
by: bonk | last post by:
Hello, I am currently trying to wrap my head around what actually happens when I compile a normal (native) c++ class with the /CLR Flag in Visual C++ 2005 (C++/CLI). Suppose I have the...
13
by: Genady Beryozkin | last post by:
Hi, I've read the article at http://msdn2.microsoft.com/en-us/library/ms235211.aspx about how to compile MFC/ATL code, but I still have one question unanswered: Should I have the CComModule...
15
by: steve yee | last post by:
i want to detect if the compile is 32 bits or 64 bits in the source code itself. so different code are compiled respectively. how to do this?
3
by: mario | last post by:
Hi! First of all, sorry for my English, it's not my native tongue. Anyway, here we go: suppose I create a class that handles my own custom text strings. No, suppose I create TWO such classes,...
6
by: Marcus | last post by:
How can I compile my VS2005 c# code to not be dependent on CLR to run? I want people that install my software to be able to run it without having to bother with CLR's and "Windows installers". ...
2
myusernotyours
by: myusernotyours | last post by:
Hi All, Am working on a Java application in which I have to use the JNI to Interface with some native code for both windows and unix. Am using netbeans IDE with the C/C++ pack installed. Am also...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.