Can you compile C# so it doesn't need the .NET Framework at runtime?

前端 未结 8 1521
暖寄归人
暖寄归人 2020-11-28 08:53

Is it possible to force the C# compiler to pull all the referenced calls out of the framework and pack them into dlls or even a single executable?

I like writing qu

8条回答
  •  醉话见心
    2020-11-28 09:21

    It is now possible to compile C# to native code using Microsoft .NET Native: https://msdn.microsoft.com/en-us/library/dn584397(v=vs.110).aspx

    It automatically compiles the release version of apps that are written in managed code (C# or Visual Basic) and that target the .NET Framework and Windows 10 to native code.

    ...

    For users of your apps, .NET Native offers these advantages:

    •Fast execution times

    •Consistently speedy startup times

    •Low deployment and update costs

    •Optimized app memory usage

    This only works with Visual Studio .NET 2015.

提交回复
热议问题