Last post Aug 27, 2009 06:50 AM by jagadeesh_sanapala
Apr 15, 2009 03:00 PM|Dejan Palezevic|LINK
I need help about deploying my asp.net web application on Linux using Mono (i was install Mono, mod_mono and configure entire environment under CentOS and test .aspx pages like "Hello World" working). Now, i need to run pages with real functionality and
many web controls on it. I realize that i cannot simply copy my project into some location on Linux, before that, i must compile my project. There is a few options: compile with mcs - Mono CSharp Compiler, gmcs, Nant....But i saw that i can simply Publish
my application and publishing will create dll-s for it.
Problem is that i am using Visual Web Developer Express, which doesn't have option to Publish web application like Visual Studio does.
Can anybody tell me a way to compile my entire project and deploy it on Linux?
Thanks in advance!
Apr 15, 2009 07:34 PM|tmpuzer|LINK
I don't have experience with mono, but if you can run dll's compiled on windows then you can compile your project using these two command line tools:
csc.exe (for any class libraries)
aspnet_compiler.exe (for your ASP.NET site)
both located in the Microsoft.NET Framework directory. Once you've compiled your project you can copy it to where ever you want.
Apr 15, 2009 08:38 PM|jhill|LINK
If this is a C# based ASP.NET application, you should be able to compile the project in the normal way with Visual Studio Express (i.e., pre-compilation / publishing is not required) and just copy the web site to the target machine. You'll just need to
make sure you have Apache configured with mod_mono (or whatever web server your going to use). If you don't have that yet, you can download a preconfigured VM or Live CD directly from the mono-project website.
Apr 16, 2009 11:52 AM|Dejan Palezevic|LINK
Thank you for reply!
I have considered your advices and tried to precompile web application with aspnet_compiler and csc.
When run compile with aspnet_compiler, it creates bin folder with dll-s. It seems that everthing going fine, but when i moved this folder to CentOS, change Apache conf file (httpd.conf), create alias, and try to open that location on localhost i got message
"This is a marker file generated by the precompilation tool, and should not be deleted!" in browser.
In other case, when try to compile project with csc, i got same error like when i try to compile same project under CentOS with Mono C# compiler (gmcs command). Error is CS0103: The name "Name of my control" does not exist in the current context. It appears
for all controls on pages. I found some articles which relate this to duplicate class name (in case you make a backup of some pages in project), but i check my project and i dont see some duplicate class name. Same project run correct when i build it and open
with ASP.NET Development server.
Apr 16, 2009 02:31 PM|jhill|LINK
With the aspnet_compiler command, you have created a fully precompiled website, and precompiled sites are only supported as of the latest release of Mono (Mono 2.4), so first make sure that you are running that version.
If you have the correct version, then you need to make sure that when you used the aspnet_compiler command, you specified the virtual directory you where the applications would reside with the -v command. For instance, if you want to build and server BlogEngine.NET
from localhost/blog, you would need to make sure you use the -v /blog switch:
aspnet_compiler -f -p c:\test\MyBlogProject -v /blog c:\test\output
I would need much more information to try to diagnose the problems you are seeing trying to compile the application with gmcs. Still, I don't think you need to compile the application with gmcs. Just build it in Visual Studio, and then copy the project
to the target machine.
Hope that helps
Apr 16, 2009 02:49 PM|Dejan Palezevic|LINK
Thanks a lot Joseph!
I have Mono 2.2 installed, but i will install 2.4 version right now, configure it and try to use aspnet_compile command and deploy precompiled site.
I realy appreciate your help.
I will post here a comment if this resolve my problem. I hope it will!
Apr 16, 2009 06:15 PM|Dejan Palezevic|LINK
I have installed Mono 2.4 like you said, setup and configure all like before (CentOS, Mono, mod_mono and Apache), and when use aspnet_compile and copy precompiled application on CentOS in predefined virtual folder, IT WORKS.
I'm realy happy for this! :)
Thank you so much for your help! You saved me!
Aug 27, 2009 06:50 AM|jagadeesh_sanapala|LINK
Hello Dejan, I have installed Mono 220.127.116.11 version on Linux Redhat OS.
I m still facing the error "This is a marker file generated by the precompilation tool, and should not be deleted!"
Earlier I had 18.104.22.168 version in which it was working fine. For some other bug fix, i had installed the latest version.
Any thoughts on this? Pl. revert and save me too:)