【发布时间】:2022-01-11 06:23:21
【问题描述】:
我需要选择json文件。
public void LoadChartData()
{
var ofDialog = new System.Windows.Forms.OpenFileDialog { Filter = @"json (*.json)|*.json" };
if (ofDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{ }
}
不幸的是,此代码的编译返回错误(两次,每个 System.Windows.Forms ):
Error CS0234 The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)
如何处理这个错误?
【问题讨论】:
标签: c# .net compiler-errors .net-4.5.2