0

I have a WPF application that needs .NET 6 Desktop Runtime installed on user's device. And I use TFM to use Windows SDK like

<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>

However, when I don't have .net 6 desktop runtime installed, I got this message without showing the specific runtime information(.NET 6 Desktop Runtime). enter image description here

Is there any method to customize the initialization error message to let users know which framework they need? My requirement is similar with this question 11 years ago and hope there's an answer now : How to customize ".NET FrameworkInitialization Error"?

Xin Ding
  • 1
  • 1
  • there should be some message saying net core desktop runtime required. – Lei Yang Mar 31 '22 at 11:49
  • A customized setup experience comes normally with an installer and not with the actual application. – Ralf Mar 31 '22 at 12:33
  • @Ralf agree but unfortunately we don't have a installer. – Xin Ding Apr 01 '22 at 04:46
  • @LeiYang Yes and I doubt if it's related to the use of TFM but just difficult to find a way to replace it. – Xin Ding Apr 01 '22 at 04:48
  • what is TFM? i think os version is also a difference. say in xp, if you run .net app without framework installed, it will prompt some strange errors with hex numbers. in win7, it will tell you need install .net. – Lei Yang Apr 01 '22 at 04:56
  • @LeiYang it's target framework moniker(https://learn.microsoft.com/en-us/dotnet/standard/frameworks), the version number behind the .net6 in csproj file. I'm not sure if it confuses the os to recognize the framework info. Yeah maybe wpf team knows something about the os's behavior. – Xin Ding Apr 01 '22 at 05:55
  • @LeiYang I tried and seemed nothing to do with TFM. I wonder if there's somewhere to configure the framewok info to tell the OS. – Xin Ding Apr 01 '22 at 06:20
  • as @Ralf said, using some installer may be better solution, since installer is native machine code. – Lei Yang Apr 01 '22 at 06:21

0 Answers0