This is a migrated thread and some comments may be shown as answers.

System.InvalidOperationException in LoadXml

4 Answers 73 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kevin Cauchi
Top achievements
Rank 1
Kevin Cauchi asked on 28 Oct 2011, 04:03 PM
Hi there, 

I have a problem on one of my machines when loading the xml in the treeview. 

This error is being thrown:

System.InvalidOperationException: Unable to generate a temporary class (result=1).
;error CS2001: Source file 'C:\Windows\TEMP\duyigyoo.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.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
;   at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
;   at Telerik.Web.UI.ControlItemContainer.LoadXml(String xml)
;   at GF.Common.Web.FEViews.Pages.Default.Page_Load(Object sender, EventArgs e)"


Any ideas?

Thanks

4 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 02 Nov 2011, 08:36 AM
Hi Kevin,

Could you, please, post a sample that will reproduce this?

Regards,
Nikolay Tsenkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Kevin Cauchi
Top achievements
Rank 1
answered on 04 Nov 2011, 10:01 AM
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("config.xml"));
 
using (StringWriter sw = new StringWriter())
{
                using (XmlTextWriter tx = new XmlTextWriter(sw))
                {
                    doc.WriteTo(tx);
                    RadTreeView1.LoadXml(sw.ToString());
                }
}
0
Clifton
Top achievements
Rank 1
answered on 07 Nov 2011, 05:14 PM
Hi there,
This is more information about the problem that Kevin have posted.

Here are my system settings of the problematic machine: 

Windows server 2008 Enterprise 64Bit

Application pool on IIs 7: ASP.Net 4 Classic

Identity: Network Service

It looks like the treeview is trying to save inside c:\Windows\temp
why it is trying to save in temp? on other machines the code is working? Can I set the temp folder location manually?

0
Accepted
Nikolay Tsenkov
Telerik team
answered on 08 Nov 2011, 02:13 PM
Hello Clifton,

In RadTreeView we use the default .NET mechanism for XML Serialization. If a file is indeed created, I am affraid we don't posses control on that.

Please, check this article for further information and methods of resolution: http://support.microsoft.com/kb/908158

It seems that the account running the application doesn't have permissions on the %windir%/Temp directory.


Regards,
Nikolay Tsenkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
Kevin Cauchi
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Kevin Cauchi
Top achievements
Rank 1
Clifton
Top achievements
Rank 1
Share this question
or