I think I found why this is happening. I'm not 100% sure, but I can't recompile system.web.dll to prove it. I found this code in system.web.dll:
namespace System.Web.Compilation
{
/// <summary>Provides a container for building an assembly from one or more virtual paths within an ASP.NET project.</summary>
public class AssemblyBuilder
......
}
Line 381:
internal CompilerParameters GetCompilerParameters()
{
CompilerParameters compilerParameters = this._compilerType.CompilerParameters;
string text = this._tempFiles.TempDir;
if (this.CultureName != null)
{
text = Path.Combine(text, this.CultureName);
Directory.CreateDirectory(text);
compilerParameters.OutputAssembly = Path.Combine(text, this.OutputAssemblyName + ".resources.dll");
}
else
{
compilerParameters.OutputAssembly = Path.Combine(text, this.OutputAssemblyName + ".dll");
}
As you can see, it takes only dlls:
compilerParameters.OutputAssembly = Path.Combine(text, this.OutputAssemblyName + ".dll");