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 (show other bugs)
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)

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


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.

Note You need to log in before you can comment on or make changes to this bug.