Bugzilla – Bug 313255
mcs does not compile System.Windows.Forms.MessageBox.Show
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by fgenolini@hotmail.com 2003-11-30 14:21:37 MST ---- Description of Problem: mcs does not compile System.Windows.Forms.MessageBox.Show() but mono runs it if compiled with Microsoft csc.exe (with warnings) Steps to reproduce the problem: 1. Install cygwin on Windows XP SP1 2. download and compile latest mcs and mono 3. type in attached C# source code and compile with mcs, then csc, then run with mono Actual Results: mcs fails to compile the attached c# source code: Book.cs(17) error CS0103: The name `System.Windows.Forms.MessageBox.Show' could not be found in `Book' Compilation failed: 1 error(s), 0 warnings mono runs the code if compiled with Microsoft csc.exe, but there are warnings: ** (Book.exe:2944): WARNING **: Failed to load library .\libwinnt.dll.so.dll (libwinnt.dll.so): The specified module could not be found. ** (Book.exe:2944): WARNING **: Failed to load library .\libwinnt.dll.so.dll (libwinnt.dll.so): The specified module could not be found. Expected Results: mcs should compile anything from System.Windows.Forms.MessageBox as the status page of Mono says that this class is fully supported How often does this happen? always Additional Information: I am running through the .Net c# examples in ms- help://MS.MSDNQTR.2003FEB.1033/cscon/html/vclrfcodereadingclassdatafromxml filevisualc.htm which is the MSDN Library, Visual Studio .Net 2003 | Visual Basic and Visual C# | Samples | Visual C# Code Example Topics | General Language Example Topics | Code: Reading Class Data from an XML File (Visual C#) Here is the code from the MSDN: public class Book { public string title; static void Main() { Book introToVCS = new Book(); System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(introToVCS.GetType()); // Read the XML file. System.IO.StreamReader file= new System.IO.StreamReader("c:\\IntroToVCS.xml"); // Deserialize the content of the file into a Book object. introToVCS = (Book) reader.Deserialize(file); System.Windows.Forms.MessageBox.Show(introToVCS.title, "Book Title"); } } ---- Additional Comments From fgenolini@hotmail.com 2003-11-30 14:27:04 MST ---- the workaround for me is not to use MessageBox and only output to console ---- Additional Comments From bmaurer@users.sf.net 2003-12-24 10:11:14 MST ---- You forgot to /r: the dll. MCS does not load SWF by default. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>cygwin under Windows XP SP1</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".