C
C#7mo ago
Beast

How to avoid error 'MessageBox' is an ambiguous reference between 'System.Windows.Forms.MessageBox'

So basically I wanted to use Folder Open Dialog in wpf so I had to add reference to windows forms but now im getting this error message
11 Replies
Beast
BeastOP7mo ago
No description
Beast
BeastOP7mo ago
is there any way to not have to add that extra stuff
Buddy
Buddy7mo ago
Do you use WPF? or what do you use?
Beast
BeastOP7mo ago
Normally no but I want to make something that looks modern in wpf
Buddy
Buddy7mo ago
the framework that is Yeah, WPF comes with its own MessageBox, please use that. https://learn.microsoft.com/en-us/dotnet/desktop/wpf/windows/how-to-open-message-box and if you have a modern project (.NET), you can edit it to not include Windows Forms https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props-desktop#usewindowsforms Just remove this property if it exists
Beast
BeastOP7mo ago
I see, it seems I had tried to use OpenFileDialog from winforms and its causing issues I missed the fact that theres already a wpf version of it Thanks
Buddy
Buddy7mo ago
Anytime.
Beast
BeastOP7mo ago
Ill have to upgrade my .NET version tho
Buddy
Buddy7mo ago
Microsoft
Upgrade Assistant | .NET
Upgrade your projects from .NET Framework to .NET.
Buddy
Buddy7mo ago
Microsoft has an assistant to upgrade a project from .NET Framework to .NET if you use that. It's not bug-free so make sure you have a backup!
Beast
BeastOP7mo ago
Gotcha

Did you find this page helpful?