Bug 4439 - Random CS0006 during xsp/fastcgi-mono-server run w/ metadata file could not be found
Summary: Random CS0006 during xsp/fastcgi-mono-server run w/ metadata file could not b...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-04-15 04:32 UTC by Mahmoud Al-Qudsi
Modified: 2013-05-08 03:31 UTC (History)
3 users (show)

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 for Bug 4439 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Mahmoud Al-Qudsi 2012-04-15 04:32:34 UTC
Description of Problem:

I'm trying to deploy an ASP MVC project developed on Mono to my Linux server using mono w/ fastcgi-mono-server4 (badgerports)

The webapp always starts fine, but then I start getting random CS0006 compilation errors for various URIs, and once they break, they remain broken until I restart the server application.

Example error:

    Server Error in '/' Application
    Compilation Error
    Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
    Compiler Error Message: CS0006: Metadata file `/tmp/root-temp-aspnet-0/ed68754/App_global.asax_40e709ea.dll' could not be found

Steps to reproduce the problem:

Actual Results:
fastcgi-mono-server4 attempts to compile a temp file that does not exist

Expected Results:
File is found, compilation succeeds

How often does this happen? 
Too often :( 

Additional Information:

I filed this under compilers, though it's not a bug with the compiler itself per say, at least as far as I can tell. I haven't been using Mono for 24 hours yet, so this could be way off, but it seems to me that an attempt is being made to compile a temporary file before that file is either created or closed such that the compilation fails, and then that temp file is deleted and the error persists.

I'm happy to provide any additional info.
Comment 1 Mahmoud Al-Qudsi 2012-04-25 01:03:30 UTC
I was able to work around this issue by using AOT compilation on the DLL outputs of my ASP.NET project after building with xbuild and before deploying with the mono fastcgi server:

mono --aot -O=all SystemDiscs/bin/SystemDiscs*.dll

I don't know why this worked as I do not believe this precompiles the actual ASPX pages, and going by the nature of the error (one or two ASP files wouldn't compile out of the entire project, different files each time), it wouldn't seem that the issue was the library models/controllers, but, hey, it works.