This is a follow-up. Thanks all for the help.
We have a web application where users will be adding compiled user
controls into the site. (Ascx + *.dll)
I need to be able to catch AND DISPLAY compiler errors in the main web
project.
But I need more. After catching
the compiler error, I need
the message from the
results.Error[].errortext property
I can't get to it.
I keep trying stuff like this:
foreach (System.CodeDom.Compiler.CompilerError err in
System.CodeDom.Compiler.CompilerResults)
{
strErrors += err.errortext() + "\n";
}
and I get "System.CodeDom.Compiler.CompilerResults is a class
when system expects a variable."
In short, I need the errortext from the error object
in the System.CodeDom.Compiler.CompilerErrors collection.
code(the foreach fails):
void Application_OnError()
{
Exception error = Server.GetLastError();
error = error.InnerException;
string errors;
if (error is System.Web.HttpCompileException)
{
foreach (System.CodeDom.Compiler.CompilerError err in
System.CodeDom.Compiler.CompilerResults)
{
errors += err.ToString() + "\n";
}
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.