none
Which UI should I choose to migrate my C# desktop app to Azure? RRS feed

  • Question

  • I have developed my c# console app far enough that I'm ready to start on the UI portion. 

    I want to deploy this to Azure so that users on various platforms, in various locations,  can run my app . 

    Is a WinForms UI a reasonable choice to achieve this?
    I'm most familiar with Winforms development. 

    If not, what is? ASP.Net? Xamarin?
    I'd need to learn these skills to develop in them.

     Thanks,
    Hal
    Thursday, August 8, 2019 5:02 PM

Answers

  • For a new app use ASP.NET Core. That is the future from MS. It is easier to work with and faster than ASP.NET (Framework). As for the project type you can just create a regular ASP.NET Core Web Application. It provides all the details on setting it up to deploy to the cloud. However if this is your first time building a web app you should start with getting comfortable with web apps. They don't work like console/desktop apps. 

    You can get help for ASP.NET in the ASP.NET forums.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by halheinrich Saturday, August 10, 2019 12:30 AM
    Friday, August 9, 2019 11:47 PM
    Moderator

All replies

  • Although Windows Forms are relatively easy to create your better choices are either ASP.NET or Xamarin. With Xamarin there is the ability to access native functionality in IOS, Windows Phones and Android, if that is not a concern I would opt in for ASP.NET Core.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, August 8, 2019 8:04 PM
    Moderator
  • I suggest doing some reading. Microsoft has many choices. I suggest looking at all the types of projects that Visual Studio can create and then learning about each one that might apply.

    ASP.Net is quite different from the other types of projects. All the others are desktop applications. Note that there are significant differences among ASP.Net Core and non-core websites. ASP.Net Core websites can be hosted by a greater variety of hosts; non-core websites can only be hosted by IIS.

    I am not familiar with Xamarin so I cannot comment on that.

    You could make a Universal Windows Platform application. They can execute anywhere running Windows.

    Look at .Net Core. It has a greater amount of support.

    You could convert the relevant portions of the application to a Class Library. You can use that Class Library in multiple UIs.



    Sam Hobbs
    SimpleSamples.Info

    Thursday, August 8, 2019 9:55 PM
  • I want to deploy this to Azure 
    I am not sure what that means.


    Sam Hobbs
    SimpleSamples.Info

    Thursday, August 8, 2019 9:57 PM
  • I understand that ASP.net and Xamarin are better choices, but that isn't my question. Is WinForms a reasonable approach? If not, why is it unreasonable?
    Friday, August 9, 2019 2:56 AM
  • Thank you for replying.

    The Universal Windows Platform seems promising. I'll check that out. Any specific articles, books, MOOCs you can suggest/recommend?

    Using .Net Core means I'd have to go with ASP.net, right? I'd prefer something closer to what I'm familiar with.

    Friday, August 9, 2019 3:20 AM
  • I want my app to be available to people across the country/globe using devices with access to the Internet.
    Friday, August 9, 2019 3:23 AM
  • Hi halheinrich,

    Thank you for posting here.

    Since this thread is more related to Azure, I suggest that you could post it in the following forum.

    https://www.reddit.com/r/AZURE/

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Note:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Jack


    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.

    Friday, August 9, 2019 6:08 AM
    Moderator
  • Since this thread is more related to Azure, I suggest that you could post it in the following forum.

    https://www.reddit.com/r/AZURE/

    I thought that Azure is a Microsoft product. Does Microsoft not support it? It seems so if it is sending people to Reddit for help. I really doubt however that this question is an Azure question. It only mentioned Azure and it is quite possible that Azure is just a misunderstanding. I agree that the C# language forum is not the most appropriate forum.

    I am seldom as strong in my reply as I must be in the following. Reddit is horrible. Microsoft is going down real bad if they are recommending Reddit. Is that the best that Microsoft has to offer for assistance? Microsoft used to be very professional. Reddit is highly unprofessional in many ways.




    Sam Hobbs
    SimpleSamples.Info

    Friday, August 9, 2019 8:14 AM
  • Microsoft (seems to) intentionally name things to confuse us. If you read what "core" means in the Microsoft world, it has nothing to do with the center. A Microsoft core is not at the center of whatever. And (as best as I understand) ASP.Net Core has nothing to do with .Net Core. I think the word core in the name of Microsoft products means nothing; you must determine what the product actually is.

    A UWP application executes in a sandbox. It is defined to be isolated from everything else. Initially (when UWP was first designed) inter-process communication with a UWP application was difficult or impossible. If you don't need inter-process communication and/or access to anything outside of your application then it might be very useful. A big advantage of UWP applications is that it is easy to put them into the Microsoft Store.

    ASP.Net applications use .Net. The main thing you need to learn about ASP.Net is about the UI (such as HTML) and about how to handle sessions, since the HTTP protocol is stateless. An advantage of ASP.Net is that anyone with internet access and a compatible browser (Edge, IE, Chrome, Firefox and others) can use the application. It does not matter what operating system it is that the browser is executing in. However there disadvantages; for example, you probably must have user accounts for storing user configurations and such. A desktop application uses just the configuration stored locally. Except with Windows (as in a UWP application) you can have the user's configuration synchronized among all the user's Windows devices.



    Sam Hobbs
    SimpleSamples.Info

    Friday, August 9, 2019 9:20 AM
  • Azure is cloud and therefore it hosts cloud apps which are web apps. You cannot host a Windows app like Winforms or WPF in Azure. Let me rephrase that. You cannot host a Windows app and allow anybody in the world to use it. They don't have access to your Azure resources and Windows apps requires a login to a desktop which isn't available in Azure. The closest thing you have is a VM or container but neither of these would allow any user to access them. VMs you would have to remote into them. Containers don't have a UI so that doesn't apply to them.

    If you want to host an app in Azure that allows users to access it then a web app is the only option. Note that web app is a little broad in Azure. It could be an actual web app. It could be a REST API hosted in API Gateway. It could be an Azure Function that is called when a specific trigger happens (via a URL or database), etc. Note that you can have a console app running in Azure as a Azure job but nobody would be able to access it directly.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, August 9, 2019 1:46 PM
    Moderator
  • If you want to host an app in Azure that allows users to access it then a web app is the only option. Note that web app is a little broad in Azure. It could be an actual web app. It could be a REST API hosted in API Gateway. It could be an Azure Function that is called when a specific trigger happens (via a URL or database), etc. Note that you can have a console app running in Azure as a Azure job but nobody would be able to access it directly.

    I hope the following adds to that.

    A web app can be a website. If it is (or includes) a REST API then that REST API can be used in a separate website and/or in a desktop application.



    Sam Hobbs
    SimpleSamples.Info

    Friday, August 9, 2019 5:33 PM
  • Thank you for replying.

    Seems like ASP.net is the way to go for me.

    Do you have any sense of which I should prefer between ASP.NET Core Web Application and ASP.NET Web Application (.NET Framework) ?

    Friday, August 9, 2019 10:22 PM
  • I posted to the Azure Community before posting here:

    techcommunity.microsoft.com t5 Azure Which-UI-should-I-choose-to-migrate-my-C-desktop-app-to-Azure m-p 793808 thread-id 4449

    After a full day without a reply, I posted here.

    I sort of expected this to be a common, often-asked question - with a semi-standard road-map of making the migration.
    Friday, August 9, 2019 10:31 PM
  • Thank you for your reply - that helps.

    In terms of starting a new Visual Studio project, do you have a recommendation?

    In Visual Studio, after
    File | New | Project ... | Visual C# | Cloud

    Perhaps one of the two ASP.NET options shown?
    ASP.NET Core Web Application or ASP.NET Web Application (.NET Framework) ?
    Friday, August 9, 2019 10:46 PM
  • For a new app use ASP.NET Core. That is the future from MS. It is easier to work with and faster than ASP.NET (Framework). As for the project type you can just create a regular ASP.NET Core Web Application. It provides all the details on setting it up to deploy to the cloud. However if this is your first time building a web app you should start with getting comfortable with web apps. They don't work like console/desktop apps. 

    You can get help for ASP.NET in the ASP.NET forums.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by halheinrich Saturday, August 10, 2019 12:30 AM
    Friday, August 9, 2019 11:47 PM
    Moderator
  • Thanks for answering my question. I found an edX MOOC that seems promising:

    MVC Application Design using .NET Core 2.0
    Saturday, August 10, 2019 12:40 AM
  • In VS when we create a project (solution) in Web we have ASP.Net Core Web Application and we have ASP.Net Web Application. Note that the Core version can be hosted by Windows (IIS) or Linux (Apache). The core versions work in a strange way that I do not understand. Under Web is "Previous Versions" with Web Sites. The terms Web App and Web Site can be confusing. They have specific meaning within ASP.Net. Generally a Web App is a website (are you getting confused? blame Microsoft) but Web Apps are not VS Web Sites.

    In a Web Application Project, only files that are explicitly referenced in the project file are part of the project and all code-behind class files and stand-alone class files in the project are compiled into a single assembly.

    Web Site Projects use the folder structure to define the contents of the project and they are only built to test them; pages and classes are usually compiled on demand. Each time you open a Web Site Project, VS puts every file (unless excluded explicitly) in every sub-folder in the Solution Explorer.

    If you search the asp.net forums hoping to get a clear answer to the question of which is best, you will not get a clear answer. I believe however that Microsoft has stated they will not continue to enhance Web Site Projects but there are many of them and they will continue to work for many years.

    To create a Web Site you can either create an empty web site or a Forms web site. Here is another place where Microsoft is confusing. An empty web site supports web forms but if you create a Web Forms Site then you will get a complete web site for a sample store. It will likely have too much of what you do not need.

    For Web App projects you have a choice of using Razor Pages, MVC, Web API, Single Page Applications or none of those. Again, there is no easy answer to the question of which is best.



    Sam Hobbs
    SimpleSamples.Info

    Saturday, August 10, 2019 12:45 AM
  • I apologize for not posting my response sooner but I was busy and it took time to write. Evidently it was a waste of time.


    Sam Hobbs
    SimpleSamples.Info

    Saturday, August 10, 2019 12:55 AM
  • Thank you for effort and thoughtfulness you put into your replies. It was a big help and much appreciated!
    Saturday, August 10, 2019 5:18 AM