Cannot execute a program. (C# Web app error)

C

Chris

I posted this in the C# language group, then thought it
might be more appropriate in this group. I would not
cross-post except I want the answer so badly.

I built small C# Web and Web Service applications in a
training class last week. The applications worked in the
class, but when I tried to run them again over the
weekend, they both bombed. Instead of getting my Web
page, or the Web Service page, I get a page full of error
text (below).

I am hoping the anwser will be obvious to someone.

I've tried a few things to address the problem, including
adding an "impersonator" identity to machine.config, and
web.config, and trying to figure out how the
PublicKeyToken works. Neither has led to success.

Thanks for any suggestions.

Error text:

Server Error in '/Order System Web CSharp' Application.
----------------------------------------------------------
----------------------

Cannot execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".
Description: An unhandled exception occurred during
compilation using the
CodeDomProvider 'Microsoft.CSharp.CSharpCodeProvider'.
Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details:
System.Runtime.InteropServices.ExternalException: Cannot
execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".

Source Error:

An unhandled exception was generated during the execution
of the current web request. Information regarding the
origin and location of the exception can be identified
using the exception stack trace below.

Stack Trace:


[ExternalException (0x5): Cannot execute a program. The
command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpe
rsonated(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +2050
System.CodeDom.Compiler.Executor.ExecWaitWithCapture
(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +260
System.CodeDom.Compiler.CodeCompiler.Compile
(CompilerParameters options, String compilerDirectory,
String compilerExe, String arguments, String& outputFile,
Int32& nativeReturnValue, String trueArgs) +383
System.CodeDom.Compiler.CodeCompiler.FromFileBatch
(CompilerParameters options, String[] fileNames) +548
System.CodeDom.Compiler.CodeCompiler.FromDomBatch
(CompilerParameters options, CodeCompileUnit[] ea) +428
System.CodeDom.Compiler.CodeCompiler.FromDom
(CompilerParameters options, CodeCompileUnit e) +90
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compil
er.ICodeCompiler.CompileAssemblyFromDom
(CompilerParameters options, CodeCompileUnit e) +37
System.Web.Compilation.BaseCompiler.GetCompiledType() +227
 
A

Alvin Bruney

Is your compiler functioning correctly? write a small test app and compile
it, see if that works first.

--
Regards,
Alvin Bruney
Got DotNet? Get it here
www.networkip.net/tidbits
Chris said:
I posted this in the C# language group, then thought it
might be more appropriate in this group. I would not
cross-post except I want the answer so badly.

I built small C# Web and Web Service applications in a
training class last week. The applications worked in the
class, but when I tried to run them again over the
weekend, they both bombed. Instead of getting my Web
page, or the Web Service page, I get a page full of error
text (below).

I am hoping the anwser will be obvious to someone.

I've tried a few things to address the problem, including
adding an "impersonator" identity to machine.config, and
web.config, and trying to figure out how the
PublicKeyToken works. Neither has led to success.

Thanks for any suggestions.

Error text:

Server Error in '/Order System Web CSharp' Application.
----------------------------------------------------------
----------------------

Cannot execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".
Description: An unhandled exception occurred during
compilation using the
CodeDomProvider 'Microsoft.CSharp.CSharpCodeProvider'.
Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details:
System.Runtime.InteropServices.ExternalException: Cannot
execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".

Source Error:

An unhandled exception was generated during the execution
of the current web request. Information regarding the
origin and location of the exception can be identified
using the exception stack trace below.

Stack Trace:


[ExternalException (0x5): Cannot execute a program. The
command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpe
rsonated(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +2050
System.CodeDom.Compiler.Executor.ExecWaitWithCapture
(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +260
System.CodeDom.Compiler.CodeCompiler.Compile
(CompilerParameters options, String compilerDirectory,
String compilerExe, String arguments, String& outputFile,
Int32& nativeReturnValue, String trueArgs) +383
System.CodeDom.Compiler.CodeCompiler.FromFileBatch
(CompilerParameters options, String[] fileNames) +548
System.CodeDom.Compiler.CodeCompiler.FromDomBatch
(CompilerParameters options, CodeCompileUnit[] ea) +428
System.CodeDom.Compiler.CodeCompiler.FromDom
(CompilerParameters options, CodeCompileUnit e) +90
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compil
er.ICodeCompiler.CompileAssemblyFromDom
(CompilerParameters options, CodeCompileUnit e) +37
System.Web.Compilation.BaseCompiler.GetCompiledType() +227

----------------------------------------------------------
 
G

Guest

I believe that the compiler is functioning correctly. It
returns no errors when building either the Web apps or
the Windows Forms apps. However, the Windows Forms apps
still work on my system.

Thanks for your reply,
Chris
-----Original Message-----
Is your compiler functioning correctly? write a small test app and compile
it, see if that works first.

--
Regards,
Alvin Bruney
Got DotNet? Get it here
www.networkip.net/tidbits
Chris said:
I posted this in the C# language group, then thought it
might be more appropriate in this group. I would not
cross-post except I want the answer so badly.

I built small C# Web and Web Service applications in a
training class last week. The applications worked in the
class, but when I tried to run them again over the
weekend, they both bombed. Instead of getting my Web
page, or the Web Service page, I get a page full of error
text (below).

I am hoping the anwser will be obvious to someone.

I've tried a few things to address the problem, including
adding an "impersonator" identity to machine.config, and
web.config, and trying to figure out how the
PublicKeyToken works. Neither has led to success.

Thanks for any suggestions.

Error text:

Server Error in '/Order System Web CSharp' Application.
------------------------------------------------------- ---
----------------------

Cannot execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".
Description: An unhandled exception occurred during
compilation using the
CodeDomProvider 'Microsoft.CSharp.CSharpCodeProvider'.
Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details:
System.Runtime.InteropServices.ExternalException: Cannot
execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".

Source Error:

An unhandled exception was generated during the execution
of the current web request. Information regarding the
origin and location of the exception can be identified
using the exception stack trace below.

Stack Trace:


[ExternalException (0x5): Cannot execute a program. The
command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpe
rsonated(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +2050
System.CodeDom.Compiler.Executor.ExecWaitWithCapture
(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +260
System.CodeDom.Compiler.CodeCompiler.Compile
(CompilerParameters options, String compilerDirectory,
String compilerExe, String arguments, String& outputFile,
Int32& nativeReturnValue, String trueArgs) +383
System.CodeDom.Compiler.CodeCompiler.FromFileBatch
(CompilerParameters options, String[] fileNames) +548
System.CodeDom.Compiler.CodeCompiler.FromDomBatch
(CompilerParameters options, CodeCompileUnit[] ea) +428
System.CodeDom.Compiler.CodeCompiler.FromDom
(CompilerParameters options, CodeCompileUnit e) +90
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compil
er.ICodeCompiler.CompileAssemblyFromDom
(CompilerParameters options, CodeCompileUnit e) +37
System.Web.Compilation.BaseCompiler.GetCompiledType() +227

------------------------------------------------------- ---


.
 
G

George Birbilis

you have to add execution rights to the ASPNET account on the .exe you want
to execute from your application (right click the .exe [if using NTFS
filesystem] and select "Security" tab, add ASPNET user and give Execute
right to him on that file)

btw, since a web service or website is running as a service, make sure your
..exe doesn't try to popup dialogs etc. (can use a command-line/console app
instead and even override its output/error streams to send them to some log
of yours)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <[email protected]>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.........................................................................
I believe that the compiler is functioning correctly. It
returns no errors when building either the Web apps or
the Windows Forms apps. However, the Windows Forms apps
still work on my system.

Thanks for your reply,
Chris
-----Original Message-----
Is your compiler functioning correctly? write a small test app and compile
it, see if that works first.

--
Regards,
Alvin Bruney
Got DotNet? Get it here
www.networkip.net/tidbits
Chris said:
I posted this in the C# language group, then thought it
might be more appropriate in this group. I would not
cross-post except I want the answer so badly.

I built small C# Web and Web Service applications in a
training class last week. The applications worked in the
class, but when I tried to run them again over the
weekend, they both bombed. Instead of getting my Web
page, or the Web Service page, I get a page full of error
text (below).

I am hoping the anwser will be obvious to someone.

I've tried a few things to address the problem, including
adding an "impersonator" identity to machine.config, and
web.config, and trying to figure out how the
PublicKeyToken works. Neither has led to success.

Thanks for any suggestions.

Error text:

Server Error in '/Order System Web CSharp' Application.
------------------------------------------------------- ---
----------------------

Cannot execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".
Description: An unhandled exception occurred during
compilation using the
CodeDomProvider 'Microsoft.CSharp.CSharpCodeProvider'.
Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details:
System.Runtime.InteropServices.ExternalException: Cannot
execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".

Source Error:

An unhandled exception was generated during the execution
of the current web request. Information regarding the
origin and location of the exception can be identified
using the exception stack trace below.

Stack Trace:


[ExternalException (0x5): Cannot execute a program. The
command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6\8a7b6687
\bjwjj_c0.cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpe
rsonated(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +2050
System.CodeDom.Compiler.Executor.ExecWaitWithCapture
(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +260
System.CodeDom.Compiler.CodeCompiler.Compile
(CompilerParameters options, String compilerDirectory,
String compilerExe, String arguments, String& outputFile,
Int32& nativeReturnValue, String trueArgs) +383
System.CodeDom.Compiler.CodeCompiler.FromFileBatch
(CompilerParameters options, String[] fileNames) +548
System.CodeDom.Compiler.CodeCompiler.FromDomBatch
(CompilerParameters options, CodeCompileUnit[] ea) +428
System.CodeDom.Compiler.CodeCompiler.FromDom
(CompilerParameters options, CodeCompileUnit e) +90
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compil
er.ICodeCompiler.CompileAssemblyFromDom
(CompilerParameters options, CodeCompileUnit e) +37
System.Web.Compilation.BaseCompiler.GetCompiledType() +227

------------------------------------------------------- ---


.
 
C

Chris

Right. It was a question of permissions. There wan't only
one exe file involve though, I had to give read, write,
and execute permissions to ASPNET throughout the
Microsoft.Net\Framework directory.

However, I still wonder how the application could have
worked and then stopped working. I know I did not change
these permissions before it started to fail.

Thanks,
Chris
-----Original Message-----
you have to add execution rights to the ASPNET account on the .exe you want
to execute from your application (right click the .exe [if using NTFS
filesystem] and select "Security" tab, add ASPNET user and give Execute
right to him on that file)

btw, since a web service or website is running as a service, make sure your
..exe doesn't try to popup dialogs etc. (can use a command-line/console app
instead and even override its output/error streams to send them to some log
of yours)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <[email protected]>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
......................................................... .................
I believe that the compiler is functioning correctly. It
returns no errors when building either the Web apps or
the Windows Forms apps. However, the Windows Forms apps
still work on my system.

Thanks for your reply,
Chris
-----Original Message-----
Is your compiler functioning correctly? write a small test app and compile
it, see if that works first.

--
Regards,
Alvin Bruney
Got DotNet? Get it here
www.networkip.net/tidbits
I posted this in the C# language group, then thought it
might be more appropriate in this group. I would not
cross-post except I want the answer so badly.

I built small C# Web and Web Service applications in a
training class last week. The applications worked in the
class, but when I tried to run them again over the
weekend, they both bombed. Instead of getting my Web
page, or the Web Service page, I get a page full of error
text (below).

I am hoping the anwser will be obvious to someone.

I've tried a few things to address the problem, including
adding an "impersonator" identity to machine.config, and
web.config, and trying to figure out how the
PublicKeyToken works. Neither has led to success.

Thanks for any suggestions.

Error text:

Server Error in '/Order System Web CSharp' Application.
----------------------------------------------------
---
---
----------------------

Cannot execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6 \8a7b6687
\bjwjj_c0.cmdline".
Description: An unhandled exception occurred during
compilation using the
CodeDomProvider 'Microsoft.CSharp.CSharpCodeProvider'.
Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details:
System.Runtime.InteropServices.ExternalException: Cannot
execute a program. The command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6 \8a7b6687
\bjwjj_c0.cmdline".

Source Error:

An unhandled exception was generated during the execution
of the current web request. Information regarding the
origin and location of the exception can be identified
using the exception stack trace below.

Stack Trace:


[ExternalException (0x5): Cannot execute a program. The
command being executed
was "c:\windows\microsoft.net\framework\v1.1.4322
\csc.exe" /noconfig
@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary
ASP.NET Files\order system web csharp\8ca5eae6 \8a7b6687
\bjwjj_c0.cmdline".]
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpe
rsonated(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +2050
System.CodeDom.Compiler.Executor.ExecWaitWithCapture
(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +260
System.CodeDom.Compiler.CodeCompiler.Compile
(CompilerParameters options, String compilerDirectory,
String compilerExe, String arguments, String& outputFile,
Int32& nativeReturnValue, String trueArgs) +383
System.CodeDom.Compiler.CodeCompiler.FromFileBatch
(CompilerParameters options, String[] fileNames) +548
System.CodeDom.Compiler.CodeCompiler.FromDomBatch
(CompilerParameters options, CodeCompileUnit[] ea) +428
System.CodeDom.Compiler.CodeCompiler.FromDom
(CompilerParameters options, CodeCompileUnit e) +90
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compil
er.ICodeCompiler.CompileAssemblyFromDom
(CompilerParameters options, CodeCompileUnit e) +37
System.Web.Compilation.BaseCompiler.GetCompiledType
()
+227
----------------------------------------------------
---
---
----------------------
Version Information: Microsoft .NET Framework
Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
.




.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top