It is possible that I’m missing something very obvious but now I can not see now. I have the reference to System.Windows.Forms and I have the next using classes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
using System.Windows.Forms;
using System.Windows.Forms.FolderBrowserDialog;
But the compiler always give to me the next error:
error CS0138: A using namespace directive can only be applied to
namespaces; ‘System.Windows.Forms.FolderBrowserDialog’ is a type not a
namespace
You cannot do
as it is a type and not a namespace. The namespace it belongs to is
System.Windows.Forms. Remove this line and if you want to instantiate aFolderBrowserDialogand just make sure you have the lineand make a
FolderBrowserDialoglike so:All this is in contrast to Java, where you import types not use namespaces, which is where you may be going wrong – in Java you would do something like:
and then be able to use it.