我是第一次尝试 WPF .NET Core,在新的 WPF .NET Framework 项目中我总是做的一件事就是打开控制台,但当我尝试在 .NET 中执行此操作时收到错误核。
在传统的 WPF 中,针对 .NET Framework,这相当简单;
我在 WPF .NET Core 中复制了这些步骤,但当我尝试更改 App.xaml 的构建操作时出现错误
错误(在“属性”窗口的下拉列表中选择“页面”后立即发生):
An error has occurred while saving the edited properties listed below:
Build Action
One or more values are invalid.
Cannot add 'App.xaml' to the project, because the path is explicitly excluded from the project
(C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.targets (45,5)).
Run Code Online (Sandbox Code Playgroud)
有谁知道解决这个问题的方法,或者在 WPF .NET Core 中启用控制台的其他方法?