Bug 43449 - NUnit tests creating HttpWebResponse via new fail with "Missing or incorrect header for method .ctor"
Summary: NUnit tests creating HttpWebResponse via new fail with "Missing or incorrect ...
Status: RESOLVED DUPLICATE of bug 42584
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.4.2 (C7SR1)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-08-17 06:16 UTC by sven.hennessen
Modified: 2016-10-06 16:07 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

repro solution (52.28 KB, application/zip)
2016-08-17 06:16 UTC, sven.hennessen

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description sven.hennessen 2016-08-17 06:16:29 UTC

I am running NUnit 2.6.4, Xamarin Studio Enterprise 6.0.2 (build 73), Mono 4.4.2 (from Xamarin Installer), Microsoft.Net.Http Nuget package 2.2.29 on Mac OS 10.11.6

When running NUnit tests for a PCL library, in which an instance of HttpWebResponse is created via new, the NUnit runtime aborts without any visible error or an "Internal Error" --> AggregateException. When running the same test via "Debug Test" without any breakpoints set, it will throw a "System.InvalidProgramException : Missing or incorrect header for method .ctor".

Running the same test via NUnit 2.6.4 from command line, I can see this error:

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
NUnit-Console version
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
   OS Version: Unix
  CLR Version: 4.0.30319.42000 ( Mono 4.0 ( 4.4.2 (mono-4.4.0-branch-c7sr1/f72fe45 Wed Jul 27 16:20:13 EDT 2016) ) )

ProcessModel: Default    DomainUsage: Single
Execution Runtime: mono-4.0
.* Assertion at metadata.c:3643, condition `ptr' not met

Repro attached.

Kind Regards,
Comment 1 sven.hennessen 2016-08-17 06:16:50 UTC
Created attachment 17069 [details]
repro solution
Comment 2 Marek Safar 2016-08-18 22:05:50 UTC
That's another example of runtime ignoring ReferenceAssembly attribute
Comment 3 Marek Safar 2016-10-06 16:07:41 UTC

*** This bug has been marked as a duplicate of bug 42584 ***