I am seeing the following error on a .NET Framework application hosted on IIS:
CS1647: An expression is too long or complex to compile
This problem appears to be related to the number of assemblies (~1850) but I cannot determine the exact problem: is it the number of assemblies? the length of the csc.exe
command? Something else? If I am hitting some sort of limit (such as the number of assemblies or the command length), what exactly is that limit?
I have run some experiments, such as adding/removing assemblies, shortening the file path on disk, shortening the IIS application name, renaming assemblies, etc. but I have not been able to make sense of the results. It seems that the same conditions can lead to different results. I compared the csc.exe
command that is run to no avail. I could probably fix the problem by removing/consolidating assemblies, but first I want to understand the exact nature of the problem.
Note: I reviewed other questions that reference this error message such as this and this, and while those questions mention the number of assemblies being problematic, they do not address the specific problem/limit.
2