Is WPF Supported on Windows Nano Server?
See original GitHub issueDescription
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:
- Created 3 months ago
- Comments:10 (7 by maintainers)
Thank you for confirmation @tonysneed. I would still be interested in whether we could delay-load the dwrite until it is actually needed.
/cc @ThomasGoulet73 @rladuca
If this (= using types in PresentationCore unrelated to DWrite without DWrite) worked before I would be sympathetic to keeping it working.