views:

161

answers:

4

Would it be better to transpose a Microsoft .NET program to standalone by modifying the existing code, or to just use the existing code as a reference? By standalone, I mean that the .NET framework (nor any other) would not have to be installed on the machine. Preferably, I'd prefer the option which would take the least time, even if it is slightly buggy.

A: 

What about using the Native Image Generator?

http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx

wonderchook
That won't make a .NET app run without the .NET framework
Marc Gravell
I don't think it deserved a downvote, though (fixed) - it is a simple-enough and common confusion.
Marc Gravell
+2  A: 

If you mean "run without the .NET framework"... it isn't a good idea, and isn't really supported. But you can try the options that Jon lists here: Does the framework have to be installed to run my .NET application?

Marc Gravell
Well, I want to rewrite the program so it's an independent C++ program. I just don't know if I should do it from scratch or take the existing code and rewrite from that.
waiwai933
+3  A: 

It depends how extensive the use of .NET is in the existing code. Some managed C++ looks very similar to native C++ -- in this case you'll be better off replacing the .NET parts with equivalent native C++ libraries. On the other hand, some managed C++ uses a lot of .NET-isms such as ^ references throughout the code, in which case a re-write is probably in order.

kdt
A: 

I know you mentioned not using any framework, but, for the sake of your sanity I'd suggest something like what used to be Borland's VCL (I haven't used it in a while so I'm not sure what it's called now). To not use a well-designed framework, when there are options available ... well, it's just hard not to call that a huge waste of resources. At least for a standard Windows program.

overslacked
I believe what the OP meant was that he didn't want to require something else to be installed (a *runtime*) for his app to work, not that he wanted to code to the bare metal. I think any number of libraries or library-like frameworks would be fine by him. While the .NET class library is extensive, surely one could find most of that functionality elsewhere, no?
Matt J
I sure hope so Matt! There were compiler options for C++Builder that would link the VCL runtime into the exe ... I really dislike making alternate suggestions, rather than answering the OP's question, but in this case I was compelled to speak up.
overslacked