[Mono-aspnet-list] Puzzle with compilation of default.aspx.cs under Ubuntu 16.04 failing upon http://127.0.0.1/default.aspx

Frank Chang frankchang91 at gmail.com
Sun Jun 19 14:18:45 UTC 2016


I would like to know why compilation of default.aspx.cs under Ubuntu Linux
16.04 with a code behind pointing to default.aspx.cs fails when I enter
http://127.0.0.1/default.aspx at the web browser. Also, there is a
default.aspx.designer.cs file in MyLinuxTest.csproj which is auto generated
by Visual Studio and acts like scaffolding for the code one write within
the asps and asp.cs files. Because these are auto generated one never
should touch or change this file.

I read today on www.monoproject.com FAQ that default.aspx.cs is always
compiled . A few days ago I read that default.aspx.cs is compiled only once
when it has changed. I read also there is an aspx CompilationMode server
side script option, Always, Auto and Never. What is the correct compilation
behavior for the mod_mono_server4 process? Please correct my use of
terminology.

Here is what I did yesterday. Because of the C# rule which says that
classes beginning with @ can only be followed by a C# keyword. As a result,
compilation failed even with MonoDevelop Xamarin Studio 5.5 when I used a
C# class named @default. To rectify that error I was directed to change the
class name @default to abcdef in two places, default.aspx and
default.aspx.designer.cs.

When I finished those changes, I built MyLinuxTest.csproj using MonoDevelop
Tamarin Studio 5.5 and generated a MyLinuxTest.dll which I tested with Run
With Firefox browser so as to launch xsp4 and it functioned correctly at
this point in time.

Next I copied MyLinuxTest.dll and MyLinuxTest.dll.mdb to our production
environment's bin folder. [EDIT I read in the mono-project.com FAQ document
today that these files need to be installed using rm MyLinuxTest.dll
followed by cp
/home/frankc/Downloads/MyLinuxTest/MyLinuxTest/bin/MyLinuxTest*.* ..

At this time, When I used my Chrome web browser and apache2's
mod_mono_server4 like this http://127.0.0.1/default.aspx, so I got the C#
compiler error temporary aspx.cs could not compile because there was an ASP
class method default_aspx already defined. How could I fix this baffling C#
compiler error so that http://127.0.0.1/default.aspx delivers the correct
Web content? I can supply the ASP.NET code if requested. Should
default.aspx and default.aspx.cs be renamed to Default.aspx and
Defalt.aspx.cs which I used successfully in HelloWorld.csproj? Also, what
should I do to recover or remove default.aspx.designer.cs from the
compilation process?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20160619/865bb335/attachment.html>


More information about the Mono-aspnet-list mailing list