can't run program

  • Thread starter Thread starter An Ony
  • Start date Start date
A

An Ony

Hi,

I made a console program in C# and it works for me. Now I sent it to someone
else and he can't run it. Program error or something. His OS is in Swedish.
What could this be? Does he have to have the .NET FrameWork installed to run
..NET programs? I sent it to him once as exe and another time as an ace, so I
don't think it got messed up during transfer. Any thoughts?
 
An,

..NET programs aren't compiled into binaries that can be directly loaded and
run. .NET programs are compiled into MSIL (Microsoft Intermediate Language)
which is a soft of machine code for the .NET CLR (Common Language Runtime).
In short, your friend is going to need to install the .NET Framework Runtime
(not SDK) before he/she can use your program.

-Mark
 
I was hoping that the framework was only needed to run .NET code on internet
websites and not to run .NET C++, C# and VB code! I wanted to stop
developing Java programs because clients always needed the virtual machine
and now it's just the same with .NET ?!
Are there papers on how fast this .NET code is then? Java was too slow for
me, mainly because of the code that had to be recompiled before you could
run it. Is this happening with .NET code too?
 
An Ony said:
I was hoping that the framework was only needed to run .NET code on internet
websites and not to run .NET C++, C# and VB code! I wanted to stop
developing Java programs because clients always needed the virtual machine
and now it's just the same with .NET ?!
Your clients will need the .NET runtime. This is already packaged in
windows server 2003, and Microsoft says it will be integrated into
future versions of windows, but in the meantime, your friends will
need to specifically download the runtime (or you can give it to them
on CD!).
Are there papers on how fast this .NET code is then?
You can search through this and comp.lang.java.advocacy newgroups and
find many people who have tried to compare the two, always with an app
that shows just one aspect of a language. Technically, Microsoft
restricts people from publishing any such papers comparing the two, so
there aren't many (any) out there that are really balanced (IMO).
There are a lot of people on the NG who also use / used Java so their
opinions may be quite valid here.
Java was too slow for
me, mainly because of the code that had to be recompiled before you could
run it. Is this happening with .NET code too?


..NET, like Java, uses a Just-In-Time compiler. Here's an article that
talks some about the JIT compiler in .NET and why it may not hurt you
as much as you think.
http://www.wintellect.com/resources...w.codeguru.com/net_general/Insights_NGen.html

I guess I'm curious what part of Java was too slow for you? Was it
really the re-compiling that was slowing it down (how do you know)?
Not the garbage collection? Or other aspects of a having a "runtime"
or "virutal machine". I personally felt that Java GUI's (especially
swing) felt slow, but I think that's more to do with the number of
APIs and classes being used. I haven't experienced that with .NET
(probably because it's more closely integrated with the windows APIs).
As for pure number crunching, I doubt you'd find much difference at
all.
(
http://weblogs.cs.cornell.edu/AllThingsDistributed/archives/000052.html
shows very little difference for what it's worth). Another ng post
showed java's regular expressions compiled faster than .NETs. So
there's also just the efficiency of the classes that you use (java.*
vs. System.*)

I guess you could give up managed code and write in C++. But what a
pain!

Oh, and C# does provide for "unsafe" code that can use C++ style
pointers when you have some really intense algorithms that can benefit
from direct array access.

Just my two-cents.
Mike
 
okay, I'll check all those sites...
but my program still isn't running. Someone has the Server edition 2003,
gives an error. My other contacts went to windowsupdate and that didn't say
that they could install .NET so it probably is installed already and my
program still doesn't run over there.
What now?
 
An Ony said:
okay, I'll check all those sites...
but my program still isn't running. Someone has the Server edition 2003,
gives an error. My other contacts went to windowsupdate and that didn't say
that they could install .NET so it probably is installed already and my
program still doesn't run over there.
What now?

I assume it still runs on your pc? You originally said that it was
bombing on a swedish windows os. Have you tried on other PC's of your
same culture?
What's the error message?
Can you narrow it down to a short-but complete program that reproduces
the problem?
http://www.pobox.com/~skeet/csharp/complete.html

More details would help us out here.

Mike
 
Back
Top