asp.net.netiiscsc

How can I find the exact csc.exe command that is run by IIS/ASP.NET?


How can I find the exact csc.exe command that is executed when I start up my ASP.NET application in IIS? When there is a compilation error, I see the full csc.exe command on the error page in my browser. But what about when the application compiles without error? Is there a log file somewhere?


Solution

  • Here is how to find the full csc.exe command using Windows Task Manager.

    Open Task Manager > Details tab. Right-click a column header and click "Select columns". Select the "Command line" column to make it appear in the grid.

    Restart IIS and load your application.

    While the application is loading, find csc.exe on the Details tab in Task Manager. Copy the row to a text editor. The command will look something like this:

    "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" /noconfig /fullpaths @"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\my-app\aaa\bbb\ccc.cmdline"
    

    Find that *.cmdline file. It will contain the rest of the full command. The final command, as far as I can tell, will be something like this:

    "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" <content-from-*.cmdline-file>
    

    NOTE: During my testing I observed two *.cmdline files which I guess means there were multiple commands executed. When I forced an error and reviewed the full csc.exe command on the error page, it matched the latter of the two *.cmdline files.