Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

Error CS0234: The type or namespace name 'Forms' does not exist in the namespace 'System.Windows'
 
Error message CS0234:
The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)
 
Reason:
I want to create a folder dialog under WPF. For this I need System.Windows.Forms
 
Subject: WPF programming, use of folder dialogs
 
Error code in the debugger in Visual STudio:

Severity

Code

Description

Error

CS0234

The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)

 
Screenshot of the error:
System.Windows.Forms as errors in the compiler

 
Solution:
You must add a reference to the Windows.System.Forms under Project-> References

 
If the Dialog: Reference Manager is open, then under the Search box, type: Forms, and at the Reference: System.Windows.Forms, the Options check box is set to ON.
Name: System.Windows.Forms
File Version: 4.6.81.0 build by NETFXREL2

 
 
After appending the reference: System.Windows.Forms, the error is no longer displayed

 
 
 
WPF Code:
Open a directory dialog with which you can select a folder.

private void button_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.FolderBrowserDialog dlg = new System.Windows.Forms.FolderBrowserDialog();
dlg.ShowNewFolderButton = false;
dlg.ShowDialog();
 
}

 
Mobile
»
WPF: Explorer with path open
»
WPF: Open a Window at a position
»
WPF: Selection enter open and well take over with Button Elements
»
WPF: Select Folder with Startup Directory
»
WPF: FolderDialog and GetFiles
»
Error CS0234: The type or namespace name Forms does not exist in the namespace
»
WPF: Filedialog, OpenFileDialog

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de