i'm trying to run one of my WPF application in a Hyper-V Server 2008 r2 sp1 but it crashes on startup.
I created my application with .net 4.0 and looks like it crashes before my first line of code is executed, the only helpful hint from the crash is System.TypeInitialization
, a vague 54608d47
and CLR20r3
on EventType
So, i tried doing all the windows update and creating a new totally empty application with WPF .net 4.0 (it only display an empty window), but it has the very same error.
I installed .net 4 framework for Windows Core edition (from THIS link) but still have the same error.
I enabled framework 2 and 3 using from powershell those commands
DISM.exe /online /enable-feature /featurename:NetFx2-ServerCore
DISM.exe /online /enable-feature /featurename:NetFx2-ServerCore-WOW64
DISM.exe /online /enable-feature /featurename:NetFx3-ServerCore
DISM.exe /online /enable-feature /featurename:NetFx3-ServerCore-WOW64
but still same error.
I tried to update .net framework with
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\ngen.exe update
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\ngen.exe update
without any good result (i got lots of file not found errors with those commands, but i think its normal in a Windows Core installation
I found out that after manually enabling the .net 2 and 3 i could run WinForms application (before those commands i had a 0xc0000135
error) and re-writing my app in WinForms is my only solution for now, even if i don't like it.
What can i try?