By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.e xe 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.e xe
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.e xe cannot be found.]

System.CodeDom.Compiler.CodeCompiler.Compile(Compi lerParameters
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.FromSourceBat ch(CompilerParameters
options, String[] sources) +433

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

System.CodeDom.Compiler.CodeCompiler.System.CodeDo m.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.GenerateAsse mbly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
+2143

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

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

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

System.Web.Services.Protocols.SoapHttpClientProtoc ol

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

May 22 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <mw****@hotmail.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
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.e xe 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.e xe
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.e xe cannot be found.]

System.CodeDom.Compiler.CodeCompiler.Compile(Compi lerParameters
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.FromSourceBat ch(CompilerParameters
options, String[] sources) +433

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

System.CodeDom.Compiler.CodeCompiler.System.CodeDo m.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.GenerateAsse mbly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
+2143

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

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

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

System.Web.Services.Protocols.SoapHttpClientProtoc ol

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

May 22 '06 #2

P: n/a
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

May 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.