Bug 39772 - ASMX web services return error 500: System.ArgumentNullException in latest mono-complete package
Summary: ASMX web services return error 500: System.ArgumentNullException in latest mo...
Status: RESOLVED DUPLICATE of bug 37137
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web.Services ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-18 17:34 UTC by Colin Laws
Modified: 2016-04-04 15:54 UTC (History)
3 users (show)

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

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:
Status:
RESOLVED DUPLICATE of bug 37137

Description Colin Laws 2016-03-18 17:34:57 UTC
With the latest version of mono-complete accessible via Ubuntu through sudo apt-get install mono-complete, web services using asmx files no longer process properly on fastcgi-mono-server4. After testing with a previous version of mono built in February (4.3.2.467), this bug was confirmed to exist in the latest release. 

This bug was previously reported on in December of 2015, fixed in February of 2016, and just recently re-introduced in March of 2016. You may find the previously reported bug here:
https://github.com/openpetra/openpetra/issues/110

The error returned by the fastcgi-mono-server4 instance when making requests to an XML based web service (asmx):

----------------------------------------------------------------------------------------------------------------

System.ArgumentNullException
Value cannot be null.
Parameter name: path1

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
  at System.IO.Path.Combine (System.String path1, System.String path2) <0x40784ec0 + 0x001c3> in <filename unknown>:0 
  at System.Web.Services.Configuration.WsdlHelpGeneratorElement.get_HelpGeneratorPath () <0x40f908b0 + 0x00034> in <filename unknown>:0 
  at System.Web.Services.Protocols.DocumentationServerProtocol.Initialize () <0x406332e0 + 0x00663> in <filename unknown>:0 
  at System.Web.Services.Protocols.ServerProtocol.SetContext (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response) <0x40631ea0 + 0x000fb> in <filename unknown>:0 
  at System.Web.Services.Protocols.ServerProtocolFactory.Create (System.Type type, System.Web.HttpContext context, System.Web.HttpRequest request, System.Web.HttpResponse response, System.Boolean& abortProcessing) <0x40631aa0 + 0x000bb> in <filename unknown>:0 

----------------------------------------------------------------------------------------------------------------

Configuration:

Ubuntu 14.0.4 LTS (server, fresh install)
fastcgi-mono-server4
nginx
Comment 1 Timotheus Pokorra 2016-03-18 17:58:55 UTC
the original bug was reported here: to https://bugzilla.xamarin.com/show_bug.cgi?id=37137
Comment 2 Timotheus Pokorra 2016-03-18 18:01:48 UTC
did you try with the latest Alpha? 4.4.0.40
4.3 might be too old.

I don't know if it has been fixed in the 4.2 branch. I don't think so.
Comment 3 Colin Laws 2016-03-18 18:10:58 UTC
Mono version 4.2.3.4/832de4b is currently giving the internal server error, however, simply installing fastcgi-mono-server4 and not mono-complete allows for the web service to run properly. 

Using mono --version, we see 3.2.8.

We also compiled and installed mono version 4.3.2.467, and the web service ran properly.
Comment 4 Colin Laws 2016-03-18 18:12:08 UTC
Does fastcgi-mono-server4 pull down an older version of the mono runtime?
Comment 5 Timotheus Pokorra 2016-03-19 13:42:20 UTC
I did investigate this a little more.

The problem has been fixed in the Reference Source:
https://github.com/mono/referencesource/commit/78dccece97d38f6e771ce039001c84fa8435349a
The fix has not been reverted since:
https://github.com/mono/referencesource/commits/mono/mscorlib/system/AppContext/AppContext.cs

But when I check the latest mono tarball, http://download.mono-project.com/sources/mono/mono-4.4.0.40.tar.bz2, the file mono-4.4.0/external/referencesource/mscorlib/system/AppContext/AppContext.cs
 does not contain the fix yet.

ok, the reference source has also several branches:
https://github.com/mono/referencesource/commits/mono-4.4.0-branch

The fix did not go into that branch, see the history of the file:
https://github.com/mono/referencesource/commits/mono-4.4.0-branch/mscorlib/system/AppContext/AppContext.cs

So the fix would be to cherry pick the commit https://github.com/mono/referencesource/commit/78dccece97d38f6e771ce039001c84fa8435349a to https://github.com/mono/referencesource/commits/mono-4.4.0-branch
Comment 6 Timotheus Pokorra 2016-03-24 17:39:31 UTC
see https://bugzilla.xamarin.com/show_bug.cgi?id=37137#c13

the fix has now been added to the Mono 4.4 branch, and should be part of the next Alpha or Beta of Mono 4.4

I cannot close this bug. I suggest to mark it as duplicate of bug 37137
Comment 7 Andi McClure 2016-04-04 15:54:48 UTC

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