[Mono-aspnet-list] Running ASP.Net 4.5 MVC Application on Mono

2014-09-15 Thread Fernando Rodriguez
Hi,

I'm trying to get an Asp.Net 4.5 MVC app to run on mono and I'm getting the 
error shown bellow (also posted here). I get the same error in apache using 
mod_mono as in xsp4. I built mono, xsp, and mod_mono on the server from the 
latest tarball releases (simple ./configure && make && make install). Other 
Asp.Net applications run fine on the same server (targetting earlier runtimes). 
The server run Gentoo and I remove all mono, xsp, and mod_mono packages before 
building the source.

I found several posts that suggest a bug in xsp (don't apply since I'm using 
latest tarball and also tried earlier versions) or mono loading the wrong 
framework version stack trace and exception message suggest is loading the 
right assemblies (most assemblies on the 4.5 directory are symlinks to 4.0). I 
did tried to run xsp.exe with mono ---runtime=v4.5 and it tells me it's not 
available, same for 4.0 but it is available and the and the exception shows 
it's using it.

The application was built on Windows with Visual Studio but I also built on 
MonoDevelop (Xamarin) on Windows to target Mono. It does not use any external 
references except for PayPal's API Library but I used this same library on 
other applications that run on mono so that shouldn't be the problem. I'm 
trying to setup a parallel mono environment on a Linux desktop to compile it 
on Linux to see if it makes a difference (my distro's version are really 
outdated).


Another thing I noticed is that Visual Studio copies all the Mvc and Razor, 
etc assemblies to the bin folder, if I delete them mono wines about not finding 
them even though there's Mono's implementation on the GAC (which I believe are 
built from the same source). Also in the Visual Studio generated Web.config the 
 and other tags had a targetFramework="4.5" attribute, and I had 
to remove it cause mono wined about it (unrecognized attribute or something 
like that). Yet the same Web.config works fine in Mono under Windows.

I think that's all I got, suggestions are appreciated.

Exception caught during reading the configuration file:
System.MissingMethodException: Method not found: 
'System.Configuration.IConfigurationSectionHandler.Create'.
  at 
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection
 
(System.String configKey) [0x0] in :0 
  at System.Configuration.ConfigurationManager.GetSection (System.String 
sectionName) [0x0] in :0 
  at System.Configuration.ConfigurationManager.get_AppSettings () [0x0] in 
:0 
  at Mono.WebServer.XSP.Server.get_AppSettings () [0x0] in :0 
  at Mono.WebServer.XSP.Server+ApplicationSettings..ctor () [0x0] in 
:0 
xsp4
Listening on address: 0.0.0.0
Root directory: /var/www/stage.fernansoft.net
Listening on port: 8080 (non-secure)
Hit Return to stop the server.
Missing method 
System.Configuration.IConfigurationSectionHandler::Create(object,object,XmlNode)
 
in assembly /usr/local/lib64/mono/4.0/System.dll, referenced in assembly 
/usr/local/lib64/mono/4.0/System.Configuration.dll
Missing method System.Configuration.ConfigurationManager::get_AppSettings() in 
assembly 
/usr/local/lib64/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll,
 
referenced in assembly 
/usr/local/lib64/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll
Missing method System.Configuration.ConfigurationManager::get_AppSettings() in 
assembly 
/usr/local/lib64/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll,
 
referenced in assembly /usr/local/lib64/mono/4.0/System.Web.dll
Missing method System.Configuration.ConfigurationManager::get_AppSettings() in 
assembly 
/usr/local/lib64/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll,
 
referenced in assembly /usr/local/lib64/mono/4.0/System.Web.dll
Missing method 
System.Configuration.ConfigurationProperty::.ctor(string,Type,object,TypeConverter,ConfigurationValidatorBase,ConfigurationPropertyOptions)
 
in assembly 
/usr/local/lib64/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll,
 
referenced in assembly /usr/local/lib64/mono/4.0/System.Web.dll


-
Fernando Rodriguez
frodriguez.develo...@outlook.com
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] ASP.NET on Mono (Windows)

2014-09-18 Thread Fernando Rodriguez
What framework version does your app targets? Does the DLL targets the same 
version? How did you start xsp?

There's xsp4 for .NET 4 and xsp for .NET 2. I'm not sure if you can target 4.5 
on mono on Windows as there's no xsp.exe on the 4.5 directory. You may have to 
copy it to the 4.5 dir and change the batch file to use it, that works on 
Linux, I'm not sure about Windows.

On Wednesday 17 September 2014 5:03:42 AM kumar wrote:
> I have installed Mono 3.2.3 (Latest version) as per the download page on
> Windows 2012. I have got the XSP server running on port 8081.
> 
> I have created and ASPX application in Visual Studio Compiled it. Some of
> the features like connected to database are already developed by me for
> another project and I have just referenced the DLL. This project Runs well
> on Windows / IIS.
> 
> I have copied all the ASPX files along with the bin folder on the path
> program fils (x86)/Mono3.2.3/lib/xsp/tst/myApp folder. I then ran the XSP
> web Server and ensure that it was listening on port 8081. I then trie dto
> open my application login.aspx and it gives me n error entities .dll not
> found. Are missing assembly reference. This DLL is a part of the DLLs I
> reused from my previous project and it is available in the applications /bin
> directory.  But still the error persists.
> 
> Kindly help. This application runs fine on Windows / IIS but give the error
> on Windows /Mono-XSP.
> 
> 
> 
> --
> View this message in context: 
> http://mono.1490590.n4.nabble.com/ASP-NET-on-Mono-Windows-tp4663919.html
> Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
> ___
> Mono-aspnet-list mailing list
> Mono-aspnet-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list

-- 
--
Fernando Rodriguez
frodriguez.develo...@outlook.com
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] Running ASP.Net 4.5 MVC Application on Mono

2014-09-18 Thread Fernando Rodriguez
On Tuesday 16 September 2014 9:07:35 AM chrisfcarroll wrote:
> It wouldn't be the same as this
> http://stackoverflow.com/questions/16583114/mono-3-0-debian-asp-net-method-not-found-system-configuration-iconfiguration
> issue -- that some symlinks are missing in the 4.5 directory?
> 
> I suspect -- I may be wrong -- that mono build process puts incorrect
> symlinks in lib/mono/4.5/ for dlls -- System.Web.Routing was the one
> affecting me -- where the 4.5 version is different to the 4.0 version.
> 
> 
> 
> --
> View this message in context: 
> http://mono.1490590.n4.nabble.com/Running-ASP-Net-4-5-MVC-Application-on-Mono-tp4663885p4663902.html
> Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
> ___
> Mono-aspnet-list mailing list
> Mono-aspnet-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list

Thanks for the reply and sorry it took so long. The symlinks where right for 
me with the XSP from git. I did run into this at some point when I downgraded 
to the tarball xsp. I finally got it partially working last night. I tried so 
much stuff I'm not sure what did it. I'm about to start from scratch to figure 
out what exactly was the problem.

-- 
--
Fernando Rodriguez
frodriguez.develo...@outlook.com
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] ASP.NET on Mono (Windows)

2014-09-25 Thread Fernando Rodriguez
On Thursday 25 September 2014 12:12:38 AM kumar wrote:
> I am running framework 4.0
> 
> I am starting XSP from XSP.exe in 4.0
> 
> What batch file are you referring to?
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://mono.1490590.n4.nabble.com/ASP-NET-on-Mono-Windows-tp4663919p4664019.html
> Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
> ___
> Mono-aspnet-list mailing list
> Mono-aspnet-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list

-- 
--
Fernando Rodriguez
frodriguez.develo...@outlook.com
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] ASP.NET on Mono (Windows)

2014-09-25 Thread Fernando Rodriguez
On Thursday 25 September 2014 12:12:38 AM kumar wrote:
> I am running framework 4.0
> 
> I am starting XSP from XSP.exe in 4.0
> 
> What batch file are you referring to?
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://mono.1490590.n4.nabble.com/ASP-NET-on-Mono-Windows-tp4663919p4664019.html
> Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
> ___
> Mono-aspnet-list mailing list
> Mono-aspnet-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list

You should have batch files for xsp and xsp4 on the bin folder of your mono 
installation. If you just run xsp4.exe on windows it will run under the .NET 
runtime. You need to load it with mono (ie. mono xsp.exe), that is what the 
batch file does.

-- 
--
Fernando Rodriguez
frodriguez.develo...@outlook.com
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] Mono ASP.NET vs MS VS

2014-09-28 Thread Fernando Rodriguez
On Friday 26 September 2014 3:34:50 PM Chris Rogus wrote:
> 1) If there is something easy and obvious that I am missing in my config,
> please let me know.  (e.g. the global or Views web.config files are
> different between MS VS and Mono, for sure, but I am not an expert with
> these files to know exactly what is needs to be changed in the MS VS one,
> if anything, to fix this situation)
>
> 2) Otherwise, any advice on how I could figure out exactly where this error
> is coming from?  What dll is missing or what line in my config xml is not
> right, etc?  How can I debug an ASP.NET application in Mono -- using xsp4
> or monodevelop anything else?

I could never get MVC5 to work on Mono but if you don't use any of the new 
features in MVC5 you can just rebuild your app on MonoDevelop referencing the 
System.Web.Mvc.dll version 4 from Microsoft and it should work, here's what I 
did to get it working:

1. Download and install MVC4 if you haven't already.\

2. Open your VS2013 project in MonoDevelop on Linux and change the 
System.Web.Mvc reference to the one that ships with MS MVC4. Make sure the 
copy local checkbox it ticked.

3. Change the System.Web.WebPages.* references to the version 3.0.0 that comes 
with mono. I copied them from the GAC to a directory on my solution tree and 
added the reference from there checking copy local. On the latest version of 
MonoDevelop if you add it from the GAC or the framework directory and tick 
copy local it will copy a lot of stuff that will break your app.

4. Change both Web.config files so that all references to System.Web.Mvc use 
version 4.0.0.0 and all references to System.Web.WebPages use version 3.0.0.0.

5. Build and run the solutiion on MonoDevelop. It should work.

When you scaffold an edit view with VS2013 it will add the css classes to the 
Html.EditorFor, MVC4 ignores it so the form controls are not formatted for 
bootstrap, my solution was to use jQuery to set the css class. Also VS2013 mvc 
template references site.css but the file is called Site.css, you need to fix 
this so it works right on XSP.

The Web.config files that VS created for me are called Web, not web so you'll 
probably have to rename yours.

> 
> 3) What do I need to do to get an ASP.NET solution created in MonoDevelop
> to open in MS VS?  (Hopefully this is the same solution as getting my MS VS
> ASP.NET site to work in Mono/xsp4.)

I created my solution in Visual Studio and it opens in both. I've been mostly 
working on Linux but if I need to work on VS I need to change the assembly 
references back.

> 4) Any advice on where Mono might already have a Publish feature like MS VS
> has in MonoDevelop?  Or else where I should go add one if no such feature
> yet exists, if it acceptable to the team in charge of this product (I don't
> want to do it, submit a pull request and be told it is an undesired
> feature).  Such a feature would very helpful for me.

Project > Deploy to Web... (on Version 5.0.1). It can only deploy to a local 
directory or network share.

-- 
--
Fernando Rodriguez
frodriguez.develo...@outlook.com
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list