Reputation: 6883
Our website compiles custom c# code loaded from the database depending on configuration. On one of our developer machines we're getting a file not found error when compiling. This code works fine on other developer machines. It also works fine when run under the Visual Studio development server on the developers machine. It does not work when run under IIS on this specific machine. It was previously working when the website was installed under a sub directory of the default website but it hasn't worked since moving to a separate site in IIS.
CompilerResults results = compiler.CompileAssemblyFromSource(
compilerParameters, source);
if (results != null && results.Errors.HasErrors)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (CompilerError error in results.Errors)
{
stringBuilder.AppendLine(error.ErrorText);
}
throw new StoreTechException(
String.Format("Unable to generate KPI calculation assembly:{0}{1}",
Environment.NewLine, stringBuilder.ToString()),
StoreTechExceptionTypes.Error);
}
return results;
The error messages generated are:
CS2001: Source file 'C:\\Windows\\TEMP\\zyxl54ci.0.cs' could not be found
CS2008: No inputs specified
As it's working under the Visual Studio development server but not IIS we're wondering if it's a permissions issue.
Upvotes: 3
Views: 1507
Reputation: 158
The application pool identity needs write access on the temp dir (C:\Windows\TEMP).
Upvotes: 4