Martin Thwaites | 25 Oct 21:22 2014
Picon

NUnit version for mono source tests

Hi all,

I've been writing some unit tests recently and I've noticed (the hard way, by using things that don't exist like Assert.Throws and having to re-write them) that we're using an old version of NUnit (2.4.8).  Is there a reason for not upgrading to something more current?

The current version is 2.6.3 (and I believe it's mono compliant), however, very soon there will be an amazing new version that will enable tests to run in parallel out of the box (by amending some of the unit tests).

Thanks,
Martin
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Martin Thwaites | 25 Oct 21:13 2014
Picon

Mono and vNext, What is microsoft supporting

This has just come up in another discussion and I thought I'd separate it out so it doesn't dirty the PR discussion...

Alex, some questions on your response.

"CoreCLR is intended to be Windows-only too from what I've heard, as it doesn't make much sense for Mono (you can already do side-by-side deployment of Mono)."

Where have you seen this, do you have a link you can send?  This is a major missing piece of the puzzle for me.  I've been hoping that with vNext, applications would be truely cross platform, but it seems we are still very much reliant on Mono's class implementations.

I've read an article[1] that says the CoreCLR ("Cloud Optimized") is to be "Cross Platform".  If that is the case, and there are no plans to make a linux compatible version and just use mono, they could easily say the same about the .NET 4.5 class libraries as they are available in mono.

So either, when Microsoft refer to "Cross platform", they are only referring to applications that rely on no class libraries and only corlib (is that a thing can an application be purely reliant on no class libraries?).  Alternatively, they are relying on Mono to create a CoreCLR (I wouldn't be surprised if they've ask for Xamarin's help in doing that).

I am aware that you can side-by-side in mono, however, I thought that one of the other big benefits of vNext was the reduction in footprint, specifically around the memory footprint per request.  So you can opt-in/out of specific features.

I'd appreciate anybody chiming in with they thoughts.  I'd absolutely love someone "in the know" to give us something definitive though.

Thanks,
Martin

[1] http://blogs.msdn.com/b/cesardelatorre/archive/2014/05/12/the-future-of-net-in-the-server-asp-net-vnext-optimized-for-cloud-and-server-workloads.aspx
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Kei Nakazawa | 25 Oct 16:38 2014
Picon

Support 2-args Socket ctor added in .NET 4.5

Hello,

I noticed some test code of Kestrel (web server for ASP.NET vNext) fails to compile on Linux hosts.

/kestrel/test/Microsoft.AspNet.Server.KestrelTests/EngineTests.cs(325,34): error CS1729: 'Socket' does not contain a constructor that takes 2 arguments
ref: https://github.com/aspnet/KestrelHttpServer/blob/dev/test/Microsoft.AspNet.Server.KestrelTests/EngineTests.cs#L325

It's because 2 args ctor is a new one introduced in .NET 4.5 and not currently exist on Mono. I found a bugzilla entry mentioning this issue: https://bugzilla.xamarin.com/show_bug.cgi?id=20048 and dug Mono code for finding solutions.

After couple of minutes of investigation, I gave up to write a "clean" dual stack (IPv4/v6) support and wrote a simple proxy ctor:
https://github.com/mono/mono/pull/1364/files (Thanks <at> martinjt for reviewing my pull-req.)

As I don't see any demands for IPv4/v6 dual stack support around ASP.NET vNext community, I believe hard-coding protocol version to v4 is just enough and better than nothing at least for now (of course, full support of dual stack would be great).

Any comments/feedback are welcomed.

Regards, Kei.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Martin Thwaites | 24 Oct 23:49 2014
Picon

Review of PR1363: MembershipPasswordAttribute

Hi All,

This is part of the ongoing work for the aspnetwebstack.  The only thing it's missing is tests around the PasswordStrength regex, however, I'm no good with regex so maybe someone can give me some to add to the test and valid/invalid strings to test against?

I'm also hoping that the approach to testing this is ok.

Finally, I've done some changes in the formatting a few times, but it's getting to the point where I can't see anything as I've looked at it too much.

Please can someone give it a quick look over?

Tests pass on Windows and Linux, I don't have a Mac to test it on but it doesn't do anything special.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Edward Ned Harvey (mono | 24 Oct 23:23 2014

InvalidCastException - which makes no sense

This is a fun one.  I'd love it if anyone could explain this to me.

 

using (var command = new SqliteCommand( <at> "SELECT COUNT(*) FROM someTable WHERE someColumn = <at> someValue ", dbConn))

{

    command.Parameters.Add(new SqliteParameter("someValue", "foobar"));

    object scalar = command.ExecuteScalar();        // object returned has type Int64

    Int64 count64 = (Int64)(scalar);                              // works fine.  Value is 0

    Int32 count32 = (Int32)(Int64)(scalar);                // works fine.  Value is 0

    Int32 count = (Int32)(scalar);                   // throws InvalidCastException

    ...

}

 

In the above, scalar is obviously an object, but the object returned by ExecuteScalar() is of type Int64.  The value is 0.

 

This works fine:

Int64 count64 = (Int64)(scalar);

 

This works fine:

Int32 count32 = (Int32)(Int64)(scalar);

 

This throws InvalidCastException:

Int32 count = (Int32)(scalar);

 

The best I can gather, the object needs to be cast to Int64 before it can be cast to Int32.  Which makes no sense to me, but that's the way it is.

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Vardar Sahin | 24 Oct 16:56 2014
Picon

Memleak in mono_domain_unload

Hello to all,

I noticed that mono_domain_unload is leaking memory. I wrote a small test in my application
where I create a domain, load an assembly into it, execute the C# main which does nothing and then call mono_domain_unload. The assembly and all its references are loaded with mono_image_open_from_data. It seems like Unity somehow solved this problem. 

Is there any work to fix this? Or any hint for me?

Best regards
Sahin 


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Etienne Champetier | 24 Oct 16:32 2014
Picon

PR 1362: Webapp stuck with "Key duplication when adding: httpModules"

Hi,

4 commits in this PR, 1 that should fix the race condition that lead to the exception, 3 improvements.

https://github.com/mono/mono/pull/1362

Etienne
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Etienne Champetier | 24 Oct 14:25 2014
Picon

Re: PR 1359: System.Web.HttpApplication: set StatusCode = 500 when we send an exception to the client



2014-10-24 13:53 GMT+02:00 Etienne Champetier <champetier.etienne <at> gmail.com>:
I know nothing about customerrors,
but we are in the init so we may have fail to parse the config,
so using customerror here is dangerous


Exception e = initialization_exception;
HttpException exc = HttpException.NewWithCode (String.Empty, e, WebEventCodes.RuntimeErrorRequestAbort);
+ context.Response.StatusCode = 500;
FinalErrorWrite (context.Response, exc.GetHtmlErrorMessage ());
PipelineDone ();
return;


static void FinalErrorWrite (HttpResponse response, string error)
{
try {
response.Write (error);
response.Flush (true);
} catch {
response.Close ();
}
}


The only think that i'm sure of is that we are sending an exception with http 200 :)

I can replace 500 with exc.GetHttpCode() if you prefer?

Forget about this, this will send 501 Not Implemented, i prefer 500
 


2014-10-24 13:33 GMT+02:00 Martin Thwaites <martin <at> my2cents.co.uk>:

Does this need to take into account the customerrors setting in the Web.config or is that handled further down the pipeline?

On 24 Oct 2014 09:57, "Etienne Champetier" <champetier.etienne <at> gmail.com> wrote:
Hi,

when we get an exception in InitOnce (in HttpApplication), we send this exception to the browser, without changing StatusCode so we get a wonderful http 200.

I've checked and it's the only place where we call FinalErrorWrite and we didn't set StatusCode.

https://github.com/mono/mono/pull/1359

Bye
Etienne




_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Etienne Champetier | 24 Oct 13:55 2014
Picon

Re: elimination of TARGET_J2EE/TARGET_JVM ?


2014-10-24 13:32 GMT+02:00 Martin Thwaites <martin <at> my2cents.co.uk>:

I think I remember seeing a load of ifdefs for j2ee in Httpapplication.

That's exactly where i am

 
On 24 Oct 2014 11:58, "Etienne Champetier" <champetier.etienne <at> gmail.com> wrote:
Hi

2014-10-24 12:37 GMT+02:00 akoeplinger <alex.koeplinger <at> outlook.com>:
I removed TARGET_JVM with https://github.com/mono/mono/pull/1200, do you
still see it somewhere?
No (except in changelogs). Writing about TARGET_J2EE i remembered that there was also a TARGET_JVM,
so I asked about it in my email without checking
 
TARGET_J2EE should be removed too I guess.
I'm reading horrible code right now because TARGET_J2EE doesn't support volatile or synchronised hashtable or ....


-- Alex

Etienne



_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Alex J Lennon | 24 Oct 13:27 2014
Picon

Replacing missing monolite 110 archive ?

Hi,

I'm nearly at the point where I can build mono win32 under Appeyor CI.

I'm trying to understand why there appears to be no mono.exe installed,
as a prelude to packaging up the build.

To do this I am trying to build the latest official release 3.2.3 but
this fails without monolite and I cannot get-monolite-latest as the 110 
archive for corlib 110 has been removed.

Would it be possible to replace the missing monolite-110-latest.tar.gz
on the Xamarin site to facilite building of older Mono versions?

Thanks,

Alex
Etienne Champetier | 24 Oct 11:10 2014
Picon

elimination of TARGET_J2EE/TARGET_JVM ?

Hi,

Is TARGET_J2EE still in use (and TARGET_JVM), because it really complicate some class?

Thanks in advance
Etienne
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Gmane