WPF Applications Size Vs Winforms App Size
Does WPF compiled code is bigger or smaller than Winform compiled code? Does WPF generates more code behind that Winform does? I have a Winform App and I want to make a new version on WPF. Customers get the updates of this app by dowloading it. So my question is, If I make the application now on WPF just using the same screens how bigger can it be the compiled solution compared to the WinForm version.
( I'm not asking about performance, advantages or disadvantages, let's make is simpler. So far I have seen with small tests that WPF app are some kb bigger so the question is are those Kb added becuase of a different shell or wrapper that the WPF application embeds or will each of the WPF control embeds overhead MSIL code to the final .exe and .dlls files of t开发者_开发技巧he solution.)
I did two projects with some controls...
compiled wpf = 52.3 KB
compiled winforms= 44.3 KB
so it looks like it will be heavier, but it is hard to say how much heavier. It could depend on your project.
It really depends on how you write your WPF application. Data binding, styles, and triggers can take you a long way with WPF; it's often possible to implement functionality that in WinForms would require a lot of code with close to none in WPF. If you just do a straight port of WinForms functionality, with lots of event handlers and code-behind and the like, you're not going to see this happen. If you use WPF properly, you might.
I have two applications that are roughly equivalent, the WinForms version having slightly more functionaility. The sizes are:
WinForms: 1085Kb WPF: 1039Kb
So they're roughly equal. But like the other answerers have said: this depends on many factors, and shouldn't be the reason you're choosing WPF (I however would definitely choose WPF for new projects btw)
How often is it being downloaded?
Is the exe size the only concern? Wouldn't performance speed be of greater value. Yeah it might take you an extra 20 minutes to download upfront, but if you save a minute a day in performance your customers recoup the cost long term. Comparatively bandwidth is cheaper than the cost of slower performance over the course of time.
EDIT: Why was this voted down, it was a perfectly legit Q and predated the edit to the original question that added "I'm not asking about performance, advantages or disadvantages...".
精彩评论