none
Best project type to use, UWP, Windows Forms, Windows WPF RRS feed

  • Question

  • I'm in the early specification phase of my project (client side desktop app) that needs to accomplish the following:

    1.  Communicate with web services hosted on a GoDaddy windows server (most likely WCF, I'll code and deploy in a separate ASP.NET web project which will also do all the back-end SQL DB access)

    2.  Operate on a client's local files (that can be anywhere on their PC including protected folders) that are used by another client local applications including searching of folders/files in CSIDL_APPDATA, CSIDL_LOCAL_APPDATA and modifying files in those folder paths.

    3.  Provide Auto-Update support when newer versions are published

    4.  Launch applications contained in protected folders like CSIDL_PROGRAM_FILES

    5.  UI works with desktop scaling

    6.  Can operate with System.Management (i.e. ManagementObjectSearcher with Win32_xxxx parameters)

    So my question for the "Client" side application work, which platform is the best option?

    UWP works great with item #1, #3 and #5 above when deployed in Windows 10 store, however, when trying to deploy side loaded (even with a valid code signing certificate from GoDaddy) there are potential deployment road blocks and security issues.

    Windows Forms app can do item #1, #2, #4, #6 ... and #3 but that requires additional coding work or 3rd party services.  But no UI scaling built-in.

    Windows WPF app can do item #1, #2, #4, #6 ... and #3 but that requires additional coding work or 3rd party services.  But no UI scaling built-in.

    Windows Forms and WPF appear to be on life support and Microsoft seem to be moving in a direction of dropping support for those technologies (another Silverlight all over again).  UWP doesn't appear to support all the functionality I need.  So I'm once again "stuck" with limitations and no "complete" solution from Microsoft.

    Any other solutions?  I'm even willing to look at desktop solutions that aren't Microsoft based.

    Cheers, Rob.


    "For me, it is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring." - Carl Sagan

    Saturday, November 9, 2019 3:33 PM

All replies

  • Can operate with System.Management

    Do you see System.Management in the Universal Windows namespace? I think it is not.

    Windows Forms and WPF appear to be on life support and Microsoft seem to be moving in a direction of dropping support for those technologies

    Look again. There is no way Microsoft is eliminating WPF. And they certainly want to eliminate Windows Forms but they will not. So tell us where you saw something official from Microsoft you think says they are dropping either.



    Sam Hobbs
    SimpleSamples.Info


    • Edited by Simple Samples Saturday, November 9, 2019 6:01 PM correction
    Saturday, November 9, 2019 6:00 PM
  • Sam,

    I was asking for input about best project type to fit my objectives listed above, not a debate about Microsoft dropping WPF and/or Windows Forms.

    But, if you must know, Microsoft typically drop platform technologies by:

    1.  Not making them work well with new OS technologies (i.e. desktop scaling)

    2.  Don't fix bugs in the technology platform or restrict bug fixes to just "security" related items (which is the case for Windows Forms and WPF) ... you see anything "new" (in features) in regards to WPF recently?  Or Windows Forms recently?

    ANYWAY, back on topic as neither one of us has any control over when Microsoft "officially" decide to not support one of their technology platforms ... so what technology platform can accomplish all the requirements I listed above?

    Cheers, Rob.


    "For me, it is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring." - Carl Sagan

    Sunday, November 10, 2019 3:16 AM
  • I believe if vb.net is not your only language then Xamarin.Forms is an option.

    https://awwshop.wikidot.com



    • Edited by GeoFrias Sunday, November 10, 2019 4:31 AM
    Sunday, November 10, 2019 3:53 AM
  • I was asking for input about best project type to fit my objectives listed above, not a debate about Microsoft dropping WPF and/or Windows Forms.

    I will not debate. I am asking for facts, not speculation. You submitted speculation. If you have no facts then it is futile for me to continue on the subject.



    Sam Hobbs
    SimpleSamples.Info

    Sunday, November 10, 2019 4:00 AM
  • There are some application types that aren't possible with UWP because of how they run. There are quite a few things that are only possible using desktop applications. What's worse, there are so many line of business desktop applications out there that they can't drop support for them.

    If you want to look at a past product that Microsoft tried to kill, look at Visual C++. At around Visual Studio 2008, C++ was not getting much love and there were lots of signs that Microsoft was trying to deprecate it in favour of .NET. Microsoft then did a developer survay of the tools that developers use and to their horror they found that the majority of developers use Visual Studio for C++ development.

    We then immediately saw more attention being put into the compiler and tools. Visual Studio 2010 changed the C++ compiler over to MSBuild and a work went towards putting some C++11 (then C++0x) features into the compiler.

    The point of this story is that Microsoft will do nothing to the technologies that see major usage on Windows unless there are important reasons (like removing insecure cryptography libraries). So no, UWP will not cause the desktop technologies go away, in fact Microsoft are still adding to them. So just use what you want.

    Also, are you sure that neither Windows Forms and WPF don't support UI scaling? This is talking about enabling enhanced high DPI support in the .NET framework 4.7. Yes enhanced high DPI support. That implies that the .NET framework supports some form of high DPI features already.

    The Windows API (C/C++ API) has had high DPI functionality since Windows Vista. You can see this by the minimum supported client for SetProcessDPIAware. So I find it hard to believe that DPI scaling support has been in Windows since 2006 but the .NET framework just hasn't started using it.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    • Edited by Darran Rowe Sunday, November 10, 2019 6:18 AM
    Sunday, November 10, 2019 6:13 AM
  • Thanks for response Darran. 

    Like I said earlier my concern is not over the death of platform technologies ... Microsoft have killed off many technologies (Silverlight for example) at a moments notice.  Microsoft are very capable of killing of UWP also and if one does job searches, one will see that UWP rarely appears as a requirement for a job/project. 

    So I'm certainly NOT trying to push UWP or any platform towards or away from my objectives and it would be futile to attempt to second guess Microsoft whimsical changes in technology directions.  To be honest, my experience with MS is that they really don't care what developers in the "outside" world think or want but they will play the PR game and pretend they do (keep in mind I've been coding on Microsoft platforms for over 30+ years and seen a lot come and go).

    What I'm seeking is a Desktop technology from Microsoft that can accomplish the above items I listed in my original post that sadly got side tracked by Sam Hobbs rants and insecurities.

    WPF does have some library support for DPI but it's a "coded" solution rather than native.  UWP is native.  But UWP have security restrictions and I'm 97% sure it can't access AppData.

    I was hoping to stay with C# or VB and .NET 4.7.  Definitely do NOT want a web front end as those are just too support intensive and problematic and really don't work well with manipulation of local files and benchmarking hardware.

    Are there really no other desktop application solutions from Microsoft?

    Cheers, Rob.


    "For me, it is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring." - Carl Sagan

    Sunday, November 10, 2019 7:14 PM
  • Hi GeoFrais,

    I looked into Xamarin.Forms but it has probably more restrictions than UWP and I need to do hardware level specific performance testing for Windows 10 only ... I don't need the ability to publish to iOS, Android, OSX.

    UWP is very handicapped with no option for elevated rights at all:

    https://social.technet.microsoft.com/Forums/en-US/94485bfa-3937-47b3-a6b2-b04c418c246b/uwp-app-elevated-priviledges?forum=win10itprosecurity

    and 

    https://stackoverflow.com/questions/36286806/uwp-limitations-in-desktop-apps

    I also need to be able to link in 3rd party DLL and launch apps that are under Admin context.

    WPF can be wrangled into being DPI "aware" but it's more code, helper class, and lots of other issues that need to be addressed (image assets, etc. etc.)

    https://docs.microsoft.com/en-us/windows/win32/hidpi/declaring-managed-apps-dpi-aware

    So basically there is NO platform technology from Microsoft that can support my requirements "out of the box".

    Cheers, Rob.


    "For me, it is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring." - Carl Sagan

    Sunday, November 10, 2019 7:36 PM
  • I'm not entirely sure what you need in DPI, but my experience has been that I will no longer attempt to make a window full screen. To add to that, I would investigate DirectX as a possible solution for games/full-screen-things.

    If I recall correctly, WPF was touted as having a different rendering engine. Not really sure what that was about.

    I haven't used vb.net Forms. With a little more looking into Xamarin.Forms, it looks as if it is mobile only. Wondering if popularity will change that, especially with how popular C# forms is...

    I cannot say for certain you should use this or that because I have not been in your situation with that kind of a problem.

    Lastly, if restrictions are something you are worried about then you should go with forms. It's the richest in features.


    https://awwshop.wikidot.com


    • Edited by GeoFrias Sunday, November 10, 2019 7:53 PM
    Sunday, November 10, 2019 7:51 PM
  • With the now common usage of smaller 4K monitors and 4K laptops, desktop scaling is very common.  My application needs to be able to deal with that scaling so that controls look correct, fonts adjust correctly in control area, etc. etc. 

    After some research there apparently is an AutoScaleMode I can set to "DPI" in Windows Forms apps for each form. 

    There is also a setting in App.config  <add key="EnableWindowsFormsHighDpiAutoResizing" value="true"/>

    But I just found out some managed DLL's I'll need to use are .NET Framework v4.7.2 so it's most likely going to be a WinForms .NET Framework app.

    Cheers, Rob.


    &quot;For me, it is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring.&quot; - Carl Sagan

    Tuesday, November 12, 2019 12:33 AM
  • Hi Rob,

    Welcome to MSDN forum.

    According to your description, I might could not say which exactly matches your requirements very well.

    Since our forum is discussing about the usage of tools and editors in Visual Studio, I suggest you could ask this issue in Windows Forms Forum or stack overflow tagged winforms,  stack overflow tagged uwp and WPF forum or stack overflow tagged wpf separately for further and more professional help.

    BTW, I have found some documents, maybe helpful.

    Layout Considerations for the WindowsFormsHost Element

    High DPI Desktop Application Development on Windows

    Automatic scaling in Windows Forms

    I’m sorry for any inconvenience and thanks for your understanding.

    Sincerely,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 13, 2019 6:06 AM
  • The problem isn't the lack of solutions. Microsoft has a really clear idea of the future when it comes to the UI. The problem is the vision of the future is WinUI. Yes, this is the UWP XAML UI. But when developers didn't flock to using the UWP application model, Microsoft had to figure out ways to do this.

    The new version of WinUI, version 3.0, is still in alpha. The technology that it is going to use to be made available to desktop applications is around a year old. The Windows Community Toolkit is still adding features to allow controls to be used via XAML Islands. Finally Microsoft hasn't long added the ability for a desktop application to get a UWP identity to the preview builds of Windows.

    So basically what you want is so new it is still under development. The existing solutions are old enough that they date back to a time where DPI wasn't a concern and was pretty much ignored. So right now the Windows Community Toolkit and XAML Islands are probably what you are after, but don't be surprised if there is no easy integration.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Wednesday, November 13, 2019 9:13 PM