We have an old asp application that instantiates a .NET com visible class. In this class, we do some serialization to store our object in the session.
When I call the following line of code in my test class, it works fine.
var cereal = new XmlSerializer(couponApplicator.GetType());
However, when it gets called in the website and I am debugging, it throws the following error:
{"Cannot execute a program. The command being executed was \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe\" /noconfig /fullpaths @\"C:\\WINDOWS\\TEMP\\rwot-yx9.cmdline\"."} System.SystemException {System.Runtime.InteropServices.ExternalException}
I thought maybe it was permissions related so I tried giving ‘EVERYONE’ full control to the windows/microsoft.net folder as well as the windows/temp folder. For reference, I am running this on a Windows XP machine. Any ideas?
Figured it out.
The IIS Lockdown tool had set deny permissions to all *.exe executables in the windir directory. I therefore had to remove the deny access privileges on these two files in the windows/microsoft.net/framework/v2.0/ folder
cvtres.exe
csc.exe
Then, I gave the IUSR and IWAM accounts read and execute permissions on both those files as well as the windows temp directory.
Here is a great post explaining more details: http://www.evilrob.org/journal/archives/2005/05/16/iusriwam-accoun.html