1

I am developing an application using Visual Studio for Windows. I am very new to Visual Studio and C# so I don't know much of what could be called basics. While developing using a external DLL I tried to implement a MessageBox from Windows.Forms and when I ran the program this error appeared in the error list,

Cannot find type System.Resources.ResourceSet in module CommonLanguageRuntimeLibrary

And this appeared in the outputs

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(354,5): Xaml Internal Error error WMC9999: Cannot find type System.Resources.ResourceSet in module CommonLanguageRuntimeLibrary.

I tried to search for similar problems but I couldn't understand the answers at all. How can I resolve this kind of error? Thank you to all help that could be provided.

1 Answers1

0

The error message means that you try to execute code that does not exist at runtime. You say that you tried to show a Windows Forms message box. Even though the Windows Forms code is available when you develop your app (you're on Windows Desktop, so it's there), the target where you run your application doesn't have access to the Windows Forms code. This can happen if you're writing a UWP application (for the Windows Store, Windows Phone, XBox, Windows Mixed Reality etc.).

Most platforms have similar functionality. It you're in fact developing for UWP, check out this question: Universal Apps MessageBox: "The name 'MessageBox' does not exist in the current context"

Pepor
  • 1,042
  • 1
  • 8
  • 27
  • the problem is still there. Would changing to a Windows Form App be better and solve the issue since I am developing for Windows only? – André Filipe Ferreira Mar 21 '18 at 12:22
  • That depends on what kind of application you want to create. The Universal Windows Platform is the most-modern Windows application framework. Windows Forms is actually a wrapper around User32, the old Windows UI framework that has been present since time immemorial. Both are fine. And switching out one method call for another shouldn't be that difficult. :-) – Pepor Mar 22 '18 at 09:43
  • 1
    thank you. I switched to Form Apps and it went fine with no problems. :) – André Filipe Ferreira Mar 22 '18 at 11:36