views:

5679

answers:

3

Hi,

I have developed an application using .net 3.5 and have deployed it as an .exe on a number of machines with the same environment. However, on one particular machine I get the following error.

Am puttin in the Stack Trace.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

********** Exception Text ********** System.InvalidOperationException: Unable to generate a temporary class (result=1). error CS2001: Source file 'C:\WINDOWS\TEMP\wz58eig4.0.cs' could not be found error CS2008: No inputs specified

at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() at SSOClient..ctor() at sc.tradesvc.SSOManager..ctor() at sc.tradesvc.SSOManager.get_Inst() at sc.cashflowgenerator.Controls.LoginForm.btnLogin_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.PerformClick() at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData) at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.PreProcessMessage(Message& msg) at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

********** Loaded Assemblies ********** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

CashflowGenerator Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0

CodeBase: file:///C:/DATA/DEVEL/Output/CashflowGenerator.exe

System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

System.Core Assembly Version: 3.5.0.0 Win32 Version: 3.5.21022.8 built by: RTM

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll

System.Web.Services Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll

********** JIT Debugging ********** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.


Could someone help me with this?

As I am new to .net could someone also tell me when why a temporary class needs to be created in the first place?

Thank you very much.

+2  A: 

XML Serialisation works by generating code to perform the serialisation. This is done in a temporary assembly created for that purpose the first time it is needed.

However this relies on being able to write the assembly to disk.1

Your options are either to (1) given the user account which is running the process write permission (for an ASP.NET application this is likely to be a bad idea). (2) Use the SDK tool (sgen.exe) to pre-generate (at development/compile time) the serialisation assembly, and then use (and deplot) that assembly.

1Open question: the APIs exist to create assemblies dynamically in memory: why not do that?

Richard
in VS08 I think there is even a tick box in project properties to generate it.
Grzenio
If created in memory, they need to be recreated on an AppDomain restart. Create them on disk, then they stay on disk? I don't know if that's the reason, as I wonder if they'd have the same names after the restart.
John Saunders
A: 

the APIs exist to create assemblies dynamically in memory: why not do that?

Just a wild guess: I assume this possibility did not exist yet in .NET 1.0, or at least when the XmlSerializer was created and MS doesn't like changing existing behavior...

Zidad
+3  A: 

You only have to give the List Folder Contents and Read permissions.

I found this post when trying to fix my problem, and didn't have to give my user account write access.

From Microsoft

BillRob