CodingC# broken source + phantom exe

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  ALL
35772.1 
So a while ago I was looking at making an app that did browsery stuff, and using the C# WebBrowser control seemed the simplest option.

That was back in early December, and I've just got back to looking at it now, and I'm trying to figure out what I've done. :/

I have Mono installed, and inside the install directory I have a projects folder which has an inventively named "simple_browse_1" containing browser.cs and a browser.exe

Running the executable results in a customised browser with my initial experiments, and the behaviour of this mirrors what the C# code suggests it should do.

However, attempting to compile the C# source doesn't work...
quote:
C:\Program Files\Mono-2.0.1\bin>mcs ../projects/simple_browse_1/browser.cs
../projects/simple_browse_1/browser.cs(2,14): error CS0234: The type or namespac
e name `Windows' does not exist in the namespace `System'. Are you missing an as
sembly reference?
Compilation failed: 1 error(s), 0 warnings


That is pointing at the second line, using System.Windows.Forms;

I have also downloaded and installed SharpDevelop, and get a similar error about Windows not existing.

And yet, I haven't changed the source since creating the EXE - not according to Windows' last modified values which shows the executable being modified four seconds after the source.


To (hopefully) prove I'm not crazy, there is a second pair of files in the directory, created a full fifteen minutes later, and again with the source being modified earlier than it's working executable, which has the exact same error.


Which all makes me rather confused - the source must have been working when it was last touched, which means either the system has changed or I'm using the wrong command to compile?

Googling about definitely suggests mcs to be the compiler I need, and can't think what might have changed on the system.... unless SharpDevelop has hijacked and broken something when I installed it?

How do I figure out what has gone wrong?
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ALL
35772.2 
I found a forum post suggesting I need to do this:
code:
mcs Program.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll -v2


But the -v2 argument doesn't work, and without it I get 28 errors relating to other missing namespaces.

:/
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ALL
35772.3 
The solution is to use gmcs:

quote:
gmcs Program.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll
0/0
 Reply   Quote More 

 From:  Rowan  
 To:  Peter (BOUGHTONP)     
35772.4 In reply to 35772.3 
The solution is to use gmcs: an IDE that allows you deal with references as part of the project configuration, rather than making you fuck around with the command line just to build a trivial proof-of-concept app.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Rowan     
35772.5 In reply to 35772.4 
IDEs are for wimps.

SharpDevelop is still not working even after adding those two references and telling it I want Mono 2.0 not Mono 1.1

So I'm going to use it to throw together the interface, and then stick to jEdit for writing the code with the simple batch file I created for compiling. :P
0/0
 Reply   Quote More 

Reply to All    
 

1–5

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats