views:

1456

answers:

3

I have a winform app that calls a web service to check for updates. This works in dev and it also works everywhere else I've tried it, just not on the installed copy on my machine (which happens to be the same in dev).

The error is:

Cannot execute a program. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\Documents and Settings\Giovanni.DOUBLE-AFSSZ043\Local Settings\Temp\squ8oock.cmdline".

The firewall is disabled and I've looked for "C:\Documents and Settings\Giovanni.DOUBLE-AFSSZ043\Local Settings\Temp\squ8oock.cmdline" and it is not there. Note that every time I try to use the web service the ".cmdline" file is different, for example the second time I ran it it was "dae8rgen.cmdline." No matter what name it has, I can never find the file.

Any suggestions?

+1  A: 

The ".cmdline" file is an autogenerated file produced by the .NET framework. The application is attempting to real-time compile an XML Serializer used to parse the data from the web service.

Have you verified that you can execute "csc.exe" from a command-line window? Even just typing "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /?" should get you a list of compiler options (or should give you an error if you don't have permissions to execute it).

What user account are you running this under, and does it have permissions to execute .exe files in the windows directory? Similarly, I know you said this happens with the installed copy on your machine, but is it possible it's executing off a network share and receiving limited Code Access Security permissions which would prevent it from running local executables?

For reference, here is a KB article showing a similar error that can occur in ASP.NET when the user account doesn't have enough permissions. http://support.microsoft.com/kb/315904

Aaron Lerch
A: 

@Aaron Lerch

I won't be able to test this until I get home later today.... but my dev machine is XP running as admin so I don't think the issue is permissions.

Still, you've offered me some insight on what the cmdline thing is... thanks!

Giovanni Galbo
+2  A: 

Hi,

I had the same problem and discovered that i ran out of memory of sorts.

After checking Redhats "ANTS Memory Profiler" i found that i had a large amount of memory in the COM+ of the GC roots. A quick google and i found myself here: msdn XmlSerializers

I then read the following:

If you use any of the other constructors, multiple versions of the same assembly are generated and never unloaded, which results in a memory leak and poor performance. The easiest solution is to use one of the previously mentioned two constructors. Otherwise, you must cache the assemblies in a Hashtable...

After creating a hashtable for the serializers my problem of a memory leak (and poor performance) and the resulting error message like yours, was gone.

Hope this helps anyone else experiencing a similiar problem.

Cheers,