The framework 'Microsoft.WindowsDesktop.App', version '5.0.0' was not found

The framework 'Microsoft.WindowsDesktop.App', version '5.0.0' was not found

This condition is caused by the fact that your other machine may not have the required .NET 5.0.7 Desktop runtime to run your .NET 5.0 WPF app.

On the official page to download .NET 5.0, each SDK and related runtime version has its own notes. If you only install .NET 5.0 runtime, it won't install the related .NET 5.0 Desktop runtime to support WPF and Windows Forms.

For example:

 

That picture shows that you still have to install .NET 5.0.7 Desktop Runtime manually after you install .NET 5.0.7 runtime.

Therefore to fix your problem, you have to install .NET 5.0.7 Desktop Runtime, not just installing .NET 5.0.7 Runtime.

原文地址:https://www.cnblogs.com/chucklu/p/15036303.html