Can I run a . NET Native image directly?

Asked

Viewed 48 times

1

I built my executable in C# for an image. NET Native using ngen.exe, I have the file location, but when I run Windows says the executable is invalid.

My goal was to make my application written in C# independent of the . NET Framework and/or store the . NET in a DLL next to the output executable. The input executable is a simple "Hello World" without any dependency.

If you cannot run the image, I can decompile your code to recompile to C++ and compile in Windows32?

1 answer

2


The ngen and . NET Native are completely different things, what you used can only run with the . NET Framework.

You won’t reach the goal with him, no matter what you do.

Assuming by Windows32 you’re talking about the API Win32, if you do in . NET does not access it directly. Native code has nothing to do with the API you access.

And it seems to me you wish to use the .NET Core. There is a possibility to try Mono. If you do not solve and the current limitations of . NET Native do not meet your problem, I see no solution at the moment.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.