.NETFrameworkなしで.NETプログラムを配布したいと思います。.NETプログラムをマシンコードにコンパイルすることは可能ですか?
12 に答える
Yes, you can precompile using Ngen.exe, however this does not remove the CLR dependence.
You must still ship the IL assemblies as well, the only benefit of Ngen is that your application can start without invoking the JIT, so you get a real fast startup time.
According to CLR Via C#:
Also, assemblies precompiled using Ngen are usually slower than JIT'ed assemblies because the JIT compiler can optimize to the targets machine (32-bit? 64-bit? Special registers? etc), while NGEN will just produce a baseline compilation.
EDIT:
There is some debate on the above info from CLR Via C#, as some say that you are required to run Ngen on the target machine only as part of the install process.
Remotesoft には Salamander .NET Linkerがあります。
私はそれについての経験はありません。
これを行うサードパーティのツールがいくつかあります。
これを行うことができる別の (高価でプロプライエタリな、ライセンスは $1599 から) 製品はXenocode Postbuildです。アフリカの小さな国の国民総生産に匹敵する費用がかかるため、私自身は使用していません...
はい、できます!最近、Microsoft は.NET Nativeを発表しました。これは、アプリケーションを .NET Native ランタイム (彼らは MRT と呼んでいます) で 1 つのバイナリ (実際には 1 つの実行可能ファイルと 1 つの動的ライブラリ) にコンパイルするテクノロジです。
リンクを参照してください: http://blogs.msdn.com/b/dotnet/archive/2014/04/02/announce-net-native-preview.aspx http://blogs.msdn.com/b/dotnet/archive/ 2014/04/24/dotnetnative-performance.aspx
.NET ILコードをマシンコードにコンパイルすることは可能ですか?
はい。ただし、.NET Frameworkは、実行時(デフォルト)またはインストール時(ngen)にそれを実行します。他の理由の中でも、このIL->マシンコードは各インストールマシンで個別に実行されるため、その特定のマシン用に最適化できます。
.NETFrameworkなしで.NETプログラムを配布したいと思います。.NETプログラムをマシンコードにコンパイルすることは可能ですか?
いいえ、すべての意図と目的のために、これを行うことはできません。サードパーティの回避策は一部のシナリオで機能する可能性がありますが、それまでは「マネージコード」または「.NET」とは見なされなくなりました。
コンパイル部分にはIL2CPUがあります。
それは不可能だと思います。事前に設定されたアセンブリを作成できますが、それでもフレームワークが必要です。
I think you should not: That's the task of the JIT compiler.
However, you could use ClickOnce or Windows Installer to deploy it so that the missing framework isn't such a big problem: you could tell the installer to download the Framework and install it.
フレームワークをデプロイするサイズだけが気になる場合は、このを読んでください。
私はいつも、CLR に依存せずに C# を直接マシン コードにコンパイルするのはクールだと思っていましたが....