Will a c# program run on any PC?

M

Martin M

Hello,

I am new to C# and think that it is a very interesting tool. But there is
one question I couldn't find an answer til now:
Any C# program needs a .NET framework to run to translate the intermediate
language to the systems machine language. But will this framework be
available everywhere? Is it generaly on any Windows-PC? And how about
Linux-PCs? How large is the dependency of a C# program from the version of
the framework? Say I develop for framework A, will it run on framework B (B
younger than A)? And vice versa? Can there be several framework versions
installed on one PC?

Thank you very much for any answer that will bring light into the dark
(inside of my head ;-)
Any link to further basic information on C#, also compared to C++ is also
greatly welcome.

Martin
 
M

Magus

Hello,

I am new to C# and think that it is a very interesting tool. But there is
one question I couldn't find an answer til now:
Any C# program needs a .NET framework to run to translate the intermediate
language to the systems machine language. But will this framework be
available everywhere? Is it generaly on any Windows-PC? And how about
Linux-PCs? How large is the dependency of a C# program from the version of
the framework? Say I develop for framework A, will it run on framework B (B
younger than A)? And vice versa? Can there be several framework versions
installed on one PC?

Thank you very much for any answer that will bring light into the dark
(inside of my head ;-)  
Any link to further basic information on C#, also compared to C++ is also
greatly welcome.

Martin

Windows executables will not natively run on linux. You'd need to
install WINE under linux to run windows programs. .NET is compatible
under WINE. The wine homepage has a nice compatibility list. There is
also a linux program called Crossover you can check out.
 
F

Futu Ranon

Any C# program needs a .NET framework to run to translate the
intermediate
language to the systems machine language. But will this framework be
available everywhere? Is it generaly on any Windows-PC? And how about
Linux-PCs? How large is the dependency of a C# program from the version
of
the framework? Say I develop for framework A, will it run on framework B
(B
younger than A)? And vice versa? Can there be several framework versions
installed on one PC?

See http://www.mono-project.com as a non-Windows possibility.
 
A

Arne Vajhøj

I am new to C# and think that it is a very interesting tool. But there is
one question I couldn't find an answer til now:
Any C# program needs a .NET framework to run to translate the intermediate
language to the systems machine language. But will this framework be
available everywhere? Is it generaly on any Windows-PC? And how about
Linux-PCs? How large is the dependency of a C# program from the version of
the framework? Say I develop for framework A, will it run on framework B (B
younger than A)? And vice versa? Can there be several framework versions
installed on one PC?

Thank you very much for any answer that will bring light into the dark
(inside of my head ;-)
Any link to further basic information on C#, also compared to C++ is also
greatly welcome.

Your app will need the .NET version you build for and a Windows
version that supports that .NET version.

If you test with Mono, then it will also run on some of the
more popular *nix flavors including Linux.

In general you should expect something build with version N to run on
version M >= N but not on version M < N.

You can have multiple versions of .NET (and Mono) installed on
the same PC.

C# is very different from C++.

Arne
 
M

Martin M

Hello,

thank you for the answers.

Magus said:
Windows executables will not natively run on linux.

As much as I have learned til now C# does not produce a native executable
but MSIL code for the reason that it "shall" run on other platforms eg linux.
But this is dependent on the support of the .NET framework present on that
system. Right so far?
My question was how reliable is this support if I only distribute the
MSIL-exe. But from Konrads post I take that this must be carefully tested If
I go to a non-Windows platform.
You'd need to install WINE under linux to run windows programs.
What do you mean here with windows program? An exe like the one produced eg
by Visual C++? Or also the ones Visual C# produces?

Any clearifying comment is still welcome

Martin
 
K

Konrad Neitzel

Hi Martin!

As much as I have learned til now C# does not produce a native executable
but MSIL code for the reason that it "shall" run on other platforms eg
linux.
But this is dependent on the support of the .NET framework present on that
system. Right so far?
That is correct.
My question was how reliable is this support if I only distribute the
MSIL-exe. But from Konrads post I take that this must be carefully tested
If
I go to a non-Windows platform.

That is my opinion. Or at least you should make sure, that you only use
functions, that are implemented on all plattforms you want to support.
What do you mean here with windows program? An exe like the one produced
eg
by Visual C++? Or also the ones Visual C# produces?

I understood him, that you can install the .Net Framework in WINE. If that
is true, you should be able to run all application.

WINE is a Windows Emulator to run windows applications on i386 Linux
systems. I just know it from friends, who managed to run their games on
their Linux systems. And the other product mentioned is a commercial version
of WINE if I am correct. It supports some more around it and makes it easy
to install / start / manage your windows software on the linux system (and
you have to pay a monthly fee if i remember correctly).
(And in my eyes it has a workaround touch. The application supports Windows
and people simply manage to also run it on Linux. So if you want to write a
product, where you want to say: Supports Linux, MacOs, Windows, ... you
should check out Mono ....)

If you are interested in these things, you should simply go and check the
products out.
http://www.mono-project.com/Main_Page could be a good point to start
reading.

Maybe someone else in here has some experience with mono, but I fear that
most people (including me) are simply fixed on the Windows Plattform and was
never interested in the open source implementations.

With kind regards,

Konrad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top