Compiler executable file c:\..\v1.1.4322\csc.exe cannot be found.

M

mudge

Hi,

I'm getting some very strange problems with some C# code. We're running
an ASP.NET application on a local server in a DMZ. If I access it using
the internal address, the application works fine, every time. But, if I
access on it's public IP, from my office workstation, from home, over
the VPN, a test machine on ADSL, or whatever else you please, it fails.
But only about 60% of the time.

I have tried everything to pin this down. I'm fairly sure it's not the
software, because I've rolled back to earlier versions, installed the
same thing of different machines, etc. We've examined the network
interfaces (which seems to be the key to causing the problem) but we
just cannot find anything that apparently causes it.

If anyone has any ideas, I'd be extremely grateful. On the off chance I
find a solution, I'll post it here. No one else would seem to have had
the same error that I can find. The nearest is about user impersonation
through anonymous login, but I've covered that one already.

At the point at which it fails in my code, it is calling generated code
from a WSDL file to make a SOAP transaction against a web service...
Using Lutz Roeder's .Net Reflector, I'd say the framework is doing
something it's supposed to do:

(Top of the stack trace...)
if (!File.Exists(text2))
{
throw new InvalidOperationException(
SR.GetString("CompilerNotFound", new object[] { text2 })
);
}

But as the compiler _IS_ there, I don't see why it does this
specifically, and regularly from a particular entry point...

Any ideas world? Cheers,

mudge.

===============================================================

Compiler executable file
c:\windows\microsoft.net\framework\v1.1.4322\csc.exe cannot be found.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Compiler
executable file c:\windows\microsoft.net\framework\v1.1.4322\csc.exe
cannot be found.

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:

[InvalidOperationException: Compiler executable file
c:\windows\microsoft.net\framework\v1.1.4322\csc.exe cannot be found.]

System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters
options, String compilerDirectory, String compilerExe, String
arguments, String& outputFile, Int32& nativeReturnValue, String
trueArgs) +470

System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
options, String[] fileNames) +548

System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
options, String[] sources) +433

System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
options, String source) +90

System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters
options, String source) +37

System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns,
CompilerParameters parameters, Evidence evidence) +478

System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
+2143

System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings,
Type[] types, String defaultNamespace, String location, Evidence
evidence) +137

System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings, Type type) +193

System.Web.Services.Protocols.SoapClientType..ctor(Type type) +312

System.Web.Services.Protocols.SoapHttpClientProtocol

{my call is here, from generated code, from initParams from Page
Load...}
 
B

bruce barker \(sqlwork.com\)

most likely you are using default serialization code and impersonation. the
first time you serialize, or deserialize an object, .net uses reflection to
determine the member to serizalize, generates code (so early binding instead
of late binding can be used), compile the code, and load the module.

this means the thread that first calls serialization must have the proper
permissions to the temp dirs used to compile (as only javascript supports in
memory compiles, all other compiler write to disk first).

you have three choices,

1) give everone permission to the temp folders (not the best)
2) before calling serialzation revert to the asp.net account, then restore
impersonation after serialzation.
3) do a dummy serialization of your objects in the application onload.

-- bruce (sqlwork.com)



mudge said:
Hi,

I'm getting some very strange problems with some C# code. We're running
an ASP.NET application on a local server in a DMZ. If I access it using
the internal address, the application works fine, every time. But, if I
access on it's public IP, from my office workstation, from home, over
the VPN, a test machine on ADSL, or whatever else you please, it fails.
But only about 60% of the time.

I have tried everything to pin this down. I'm fairly sure it's not the
software, because I've rolled back to earlier versions, installed the
same thing of different machines, etc. We've examined the network
interfaces (which seems to be the key to causing the problem) but we
just cannot find anything that apparently causes it.

If anyone has any ideas, I'd be extremely grateful. On the off chance I
find a solution, I'll post it here. No one else would seem to have had
the same error that I can find. The nearest is about user impersonation
through anonymous login, but I've covered that one already.

At the point at which it fails in my code, it is calling generated code
from a WSDL file to make a SOAP transaction against a web service...
Using Lutz Roeder's .Net Reflector, I'd say the framework is doing
something it's supposed to do:

(Top of the stack trace...)
if (!File.Exists(text2))
{
throw new InvalidOperationException(
SR.GetString("CompilerNotFound", new object[] { text2 })
);
}

But as the compiler _IS_ there, I don't see why it does this
specifically, and regularly from a particular entry point...

Any ideas world? Cheers,

mudge.

===============================================================

Compiler executable file
c:\windows\microsoft.net\framework\v1.1.4322\csc.exe cannot be found.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Compiler
executable file c:\windows\microsoft.net\framework\v1.1.4322\csc.exe
cannot be found.

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:

[InvalidOperationException: Compiler executable file
c:\windows\microsoft.net\framework\v1.1.4322\csc.exe cannot be found.]

System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters
options, String compilerDirectory, String compilerExe, String
arguments, String& outputFile, Int32& nativeReturnValue, String
trueArgs) +470

System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
options, String[] fileNames) +548

System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
options, String[] sources) +433

System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
options, String source) +90

System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters
options, String source) +37

System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns,
CompilerParameters parameters, Evidence evidence) +478

System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
+2143

System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings,
Type[] types, String defaultNamespace, String location, Evidence
evidence) +137

System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings, Type type) +193

System.Web.Services.Protocols.SoapClientType..ctor(Type type) +312

System.Web.Services.Protocols.SoapHttpClientProtocol

{my call is here, from generated code, from initParams from Page
Load...}
 
M

mudge

Hi Bruce,

Thanks for that. This does sort of make sense. But the one thing that
is still bugging me is why this doesn't consistently fail. From what
you say here, I would expect the system to fail each and every time,
whereas it has about a 40/60 successs/failure rate...

I'm afraid I've not had a chance to try out what you suggest yet, but I
will do as soon as I get a free moment.

Cheers,

mudge
 

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

Top