question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is WPF Supported on Windows Nano Server?

See original GitHub issue

Description

On .NET Core 3.1 it was possible to run a WPF console app on Windows Nano Server. There is no UI, only usage of the Geometry classes in System.Windows.Media.Media3D. No typeface classes are used (as in #3609).

See this post: https://blog.tonysneed.com/2020/07/04/run-wpf-in-net-core-on-nano-server-in-docker. And this repo: https://github.com/tonysneed/hello-netcore-wpf-nano

However, when attempting to port the app to .NET 6, running the app results in a DllNotFoundException for dwrite.dll.

This error is not generated when running the container on a Windows Server Core base image.

Reproduction Steps

Clone this repo: https://github.com/mpospisil/dotnet-runtime-windowsdesktop/tree/main/Examples/WpfConsole/WpfConsole

Build Windows container image: docker build -t wpf-console . Run the container: docker run -it wpf-console

Expected behavior

Able to create a Point3D object from a WPF console app running on Windows Nano Server.

Actual behavior

Executing WPF console app on Nano server produces the following error.

Unhandled exception. System.TypeInitializationException: The type initializer for '<Module>' threw an exception.
 ---> System.TypeInitializationException: The type initializer for '<Module>' threw an exception.
 ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during appdomain initialization.

 ---> System.DllNotFoundException: dwrite.dll
 ---> System.ComponentModel.Win32Exception (126): The specified module could not be found.

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
miloushcommented, Jun 21, 2023

Thank you for confirmation @tonysneed. I would still be interested in whether we could delay-load the dwrite until it is actually needed.

1reaction
miloushcommented, Jun 20, 2023

/cc @ThomasGoulet73 @rladuca

If this (= using types in PresentationCore unrelated to DWrite without DWrite) worked before I would be sympathetic to keeping it working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run WPF in .NET Core on Nano Server in Docker
NET Framework), it should be possible to run a non-visual WPF application on Nano Server in a Docker container — and to deploy...
Read more >
Does Windows Nano container support MFC, GDI based ...
In summary, Windows Nano Server is not recommended for running MFC and GDI-based applications due to its minimalistic nature and lack of GUI ......
Read more >
Install .NET on Windows
NET runtime, and supports Windows Presentation Foundation (WPF) and Windows Forms apps that are built with .NET. This isn't the same as ....
Read more >
Deploy existing .NET apps as Windows containers
Modernize existing .NET applications with Azure Cloud and Windows containers | Deploy existing .NET apps as Windows containers.
Read more >
Windows container base images
Windows Server Core and Nanoserver are the most common base images to target. The key difference between these images is that Nanoserver has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found