Can I run my .NET program in a container? - rhel.net

I’m just starting out with containers and was wondering if I can run my .NET program in a container. What’s the recommended way to do this?

If you are talking about a Web application, you could use .Net Core, that runs on Windows and Linux (Desktop, VM, Docker).
Some useful links:
What is .Net Core?
Official page - install guide
Official .Net core docker images

Yes, you can containerize .NET Framework apps and run them in windows containers: https://www.docker.com/products/windows-containers
I would recommend using .NET Core if your codebase isn't huge (either a small app or a greenfield project) and you don't need any .NET Framework/Windows specific libraries.

Related

How to use Docker to deploy WPF applications?

I know from the documentation here that I cannot use Docker to run WPF applications. However I have the use case that I would essentially like to create containers that can easily be shared to then deploy my WPF application onto another Windows computer or VM.
The purpose of this is to be able to quickly deploy new test versions of the WPF application without having to provide testers access to the full code base and expect them to rebuild or have to develop and maintain a full installer at an early stage of development.
The application is MVVM based WPF with Prism, with a target framework of .Net Core 3.1 and a SQLite database.
The bolded text below implies this is possible:
Docker is for server applications—Web sites, APIs, messaging solutions and other components that run in the background. You can’t run desktop apps in Docker because there’s no UI integration between the Docker platform and the Windows host. That rules out running Windows Forms or Windows Presentation Foundation (WPF) apps in containers (although you could use Docker to package and distribute those desktop apps), but Windows Communication Foundation (WCF), .NET console apps and all flavors of ASP.NET are great candidates.
However I have struggled to find clear documentation for how to do this. Is this possible and if so where can I find the appropriate documentation? If I have misunderstood this please let me know, I am also unsure if this question belongs here or on the Software Engineering stack and am happy to move it if necessary.
Thanks!

Can Blazor Hybrid apps be cross-platform?

I trying to find the most suitable Framework to port my legacy WinForms applications to the new technology. But the best way for me is cross-platform app.
I can build a Blazor Hybrid Windows Forms app. But can it be built as a cross-platform: for Windows, OSX, Linux ?
If no what can I use?
I believe that Blazor Hybrid apps can be cross-platform if the app is a .Net MAUI Blazor App.
The Microsoft documentation here shows how to create this type of app using Visual Studio 2022 (Preview edition at the time of writing in early June 2022). The application is shown running as both a Windows desktop app and an Android app.
You can see in the image above that Visual Studio says that the .Net MAUI Blazor App targets macOS as well as other platforms. But, there does not seem to be support for Linux. Further, the MAUI documentation states that a Mac is required to build for iOS and macOS.
Blazor Hybrid can be implemented in different containers, so you could have Uno Blazor Hybrid. There is already a COM+ Blazor Hybrid.
So - Yes. That's the point of it. Write once, run everywhere (assuming a shared Razor library).

.NET Framework Winforms App on Windows IOT

I have a Winforms application built on .NET Framework 4.7 running on client's desktops. Client would like to run it on a tablet running Windows IOT. Is this possible?
I've found a couple of articles indicating it should run on Windows IOT Enterprise, but not Windows IOT. However, I haven't been able to find much specific official documentation.
Can anyone enlighten me and/or point me to some official documentation?

Setup project for wpf application

I am trying to build a setup-msi using visual studio for my wpf application.
The issue i am facing is that i force primary output from wpf project to the setup project
and the dependencies are calcaluted automatically.
I run the msi locally (on the machine i built the wpf app) and everything works fine.
The problems start when i try to install it on different machines.
On other machines i run the installation process and it finishes justfine
but when i try to run the application i get exceptions about assemblies that could not be found.(e.g System.Web , Version=4,0,0,0 could not be found etc)
I really suck building setup projects but can anybody give a hand?
P.S.: I also tried installShield... same results.
I would guess that the target machine only had .NET Framework 4.0 Client Profile installed. System.Web is in .NET Framework 4.0 Extended, which is installed with the full 4.0 Framework but not with the Client Profile.
Are you bootstrapping .NET 4 in your setup?
Check for the presence of "Microsoft .NET Framework 4 Client Profile" and "Microsoft .NET Framework 4 Extended" in Add/Remove Programs (XP) or Programs and Features (Vista/7) on the machines where the application ran fine and those where it gave that error.
Edit: .NET Framework Deployment Guide for Developers. That should help you figure out how best to deploy it.

What package of .Net framework is required on target client machine in order to run .Net winforms application?

I'm Trying to deploy my winforms project using installshield in order to make is available to be installed on other computers. My project is written under .net framework 3.5.
My question is : What version of .net package should be installed on the target machine in order to be able to run my project?
One thing to notice is that target machine is not connected to internet so I have to embed a standalone offline installer for .net framework.
Surely, with .Net framework 3.5 full redistributable package installed, my project runs fine. But it's ~200MB. Should I really install 200MB in order to run my ~10MB project on target machine?
one other option would be installing client redistributable package which I heard ~30MB. But I couldn't find any official release and am not sure if that's gonna work.
Any help would be appreciated.
You should deploy with the web installer so that it can determine what your client needs and download only those components. The full install is that big because it contains all variants of the framework for all possible systems (x86, x64, etc.).
This site from Scott Hanselman is an excellent resource on the matter of deploying .NET.
http://www.hanselman.com/smallestdotnet/
As it states on that site:
If you look for .NET Downloads on
Microsoft's site, it might look like
the .NET Framework is 200+ megs. It's
not. Those big downloads are the
Complete Offline Versions of every
version of the .NET Framework for
every kind of machine possible. The
big .NET download includes x86, x64,
and ia64. It includes .NET 2.0, 3.0,
and 3.5 code for all systems all in
one super-archive.

Resources