What are differences between Portable and win-x64 when deploying?

Edit – Short Answer

If you choose portable, every time the app starts up it will need to go through JIT compilation on the parts of the application that actually execute. If your application is large, the performance can be impacted.

If you choose x64, the application will not slow down from compilation, because that is already done by the publish process on the build machine (your laptop).


Original Answer

When you choose the Portable publish option, you’ll get a package that is capable of running on either x86 (32-bit) machines and x64 (64-bit) machines. With the portable option selected, on application launch you’ll get JIT compiled code for the target machine (either x64 or x86) as the application stays running. However, if the application closes, all the code that was JIT compiled would be lost. The compiled code sits in memory until the application process ends. The next run would have to JIT compile the application again as it is used. The advantage here is that you’d only need to distribute one package, and it’ll run on both x86/x64 machines.

The alternative is generating multiple packages, one for each target platform you intend to distribute your application on though. In this case, you’ll get machine-specific packages that are already compiled, and do not require recompilation even after the application process ends and is restarted later. In this case your application will appear to run faster since the compilation is done once and only once, on the build server / machine. However it does impact your deployment style.

More information on .NET runtime identifiers can be found here: https://learn.microsoft.com/en-us/dotnet/core/rid-catalog

And a good document on JIT compiled code is here: https://www.telerik.com/blogs/understanding-net-just-in-time-compilation

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)