Testing Mono's compatibility

Joseph Sinclair plug-discussion at stcaz.net
Wed Sep 13 23:27:06 MST 2006


FoulDragon at aol.com wrote:
> In a message dated 13.Sep.2006 17.24.14 US Mountain Standard Time, 
> plug-discussion at stcaz.net writes:
> 
>> The entire structure of ASP code changed with ASP.NET, but you're feeding it 
> escaped >VBScript code that's not even ASP.Net, it's old-style ASP, which 
> simply won't work.  What >it's actually doing is copying the escaped code into a 
> C# file, then trying to compile that, >and failing because your code is 
> VBScript, not C#.
> 
> I understand this now.  Thank you.
> 
>> Try something more like the following (borrowed from W3Schools example 
> pages):
> 
> I was trying to follow the W3Schools examples, but it seemed like the ASP.NET 
> tutorial is one of their weaker ones... like it seems to skip a lot of stuff. 
>  I was fooled by the claims that most ASP would work at least somewhat, and 
> since my objective is extremely shallow-- basically, read one paramater being 
> passed in a GET and then plonk it in the right place of the resultant HTML... I 
> didn't think I'd be reaching in the forbidden zone.
> 
> Okay, I tried that example, and get
> 
> Error message: /tmp/apache-temp-aspnet-0/bbce3785/91530.0.cs(33,22) : error 
> CS1041: Identifier expected 
> /tmp/apache-temp-aspnet-0/bbce3785/91530.0.cs(33,35) : error CS1041: Identifier expected
> 
> "Line 33: Sub submit(sender As Object, e As EventArgs)" is highlighted red, 
> in a listing which includes the code sent up and a buncha other stuff beginning 
> with a comment about not editing the auto-generated code and 'Namespace ASP'.

It's still trying to compile the ASP code with the C# compiler.  I don't know the specific configuration parameters for Mono, but you would need to tell it to compile the pages with the VB compiler by default, or mark the test page specifically for VB compilation.

Note the temporary file ends in .cs, that's the C# compiler temporary file (the ASP.Net interpreter transforms the ASP page into a C# or VB file (much like Java transforms JSP pages into servlet Java files), then compiles that to a IL class, then compiles that down to native code.
What you need to do (unless you have a C#-based ASP.Net file from a client to test) is tell the ASP.Net runtime that your page is using VB code.
Try putting the following at the top of your page:
  <%@Page Language="VB"%>

That should instruct the runtime to use the VB compiler for that page.


More information about the PLUG-discuss mailing list