473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

XML Serialization error on Windows Vista using Japanese-character

We are having a problem whenever our application makes use of the XML
Serializer, when we are logged in as a user who has a username containing
Japanese characters.

We have prepared a sample application that tests the serializer on its own:
TestClass myClass = new TestClass();
myClass.MyString = "Hello World!";

using (MemoryStream stream = new MemoryStream())
{
XmlSerializer serializer = new XmlSerializer(
typeof (TestClass));
serializer.Serialize(stream, myClass);
}

MessageBox.Show("Serialization Complete!");

Where TestClass is defined as:

[Serializable]
public class TestClass
{
public string MyString { get; set; }
}

When Serialize() is called, the following exception is reported:

System.InvalidOperationException: Unable to generate a temporary class
(result=1).
error CS0016: Could not write to output file
'c:\Users\??????\AppData\Local\Temp\qas_8hjs.dll' -- 'The directory name is
invalid. '
Note the '?????' where the user name should be displayed.

We have tested this using a user with an English character-set based name,
and it is fine.
Is there something we have neglected to set up (for example any environment
or AppDomain settings?) or is this a bug in the XML serializer?

Thanks
Nov 11 '08 #1
4 2838
Craigh wrote:
When Serialize() is called, the following exception is reported:

System.InvalidOperationException:
Check whether the problems and solutions under
http://support.microsoft.com/search/...ception&mode=r
apply to your case.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 11 '08 #2
Thanks, but sadly none of these issues are related to my case.

As I say, the serialization works as expected using a Latin-based username,
but fails when attempting to serialize under a user who has a
Japanese-character set based username.

It would be interesting to see if you could replicate the issue? I imagine
that you would be able to.

Thanks again

"Martin Honnen" wrote:
Craigh wrote:
When Serialize() is called, the following exception is reported:

System.InvalidOperationException:

Check whether the problems and solutions under
http://support.microsoft.com/search/...ception&mode=r
apply to your case.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 11 '08 #3
I should mention, the reason for performing this particular test is to ensure
the application will comply with the Microsoft Windows Server 2008
Certification requirements prior to submission to VeriTest.

"Martin Honnen" wrote:
Craigh wrote:
When Serialize() is called, the following exception is reported:

System.InvalidOperationException:

Check whether the problems and solutions under
http://support.microsoft.com/search/...ception&mode=r
apply to your case.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '08 #4
Does the 'c:\Users\<username>\' folder exist as expected?

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Craigh" <Cr****@discussions.microsoft.comwrote in message
news:C9**********************************@microsof t.com...
We are having a problem whenever our application makes use of the XML
Serializer, when we are logged in as a user who has a username containing
Japanese characters.

We have prepared a sample application that tests the serializer on its
own:
TestClass myClass = new TestClass();
myClass.MyString = "Hello World!";

using (MemoryStream stream = new MemoryStream())
{
XmlSerializer serializer = new XmlSerializer(
typeof (TestClass));
serializer.Serialize(stream, myClass);
}

MessageBox.Show("Serialization Complete!");

Where TestClass is defined as:

[Serializable]
public class TestClass
{
public string MyString { get; set; }
}

When Serialize() is called, the following exception is reported:

System.InvalidOperationException: Unable to generate a temporary class
(result=1).
error CS0016: Could not write to output file
'c:\Users\??????\AppData\Local\Temp\qas_8hjs.dll' -- 'The directory name
is
invalid. '
Note the '?????' where the user name should be displayed.

We have tested this using a user with an English character-set based name,
and it is fine.
Is there something we have neglected to set up (for example any
environment
or AppDomain settings?) or is this a bug in the XML serializer?

Thanks

Nov 13 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: HakonB | last post by:
Hi all I get an exception when trying to deserialize a simple configuration file using XML Serialization. The very long stacktrace can be seen at the bottom of this message. I've see other...
1
by: andrewcw | last post by:
There is an error in XML document (1, 2). I used XML spy to create the XML and XSD. When I asked to have the XML validated it said it was OK. I used the .net SDK to generate the class. I have...
2
by: Mike | last post by:
Hello. I am using C# in .NET v1.1. I am trying to serialize an object to disk and read it back again. The serialization seems to work OK (at least, it completes without error). However, I get...
2
by: Maximus | last post by:
Hi Everyone, I was using Inprocess session objects, but incase of aspnet process crashes the session objects were lost as a result I decided to shift to out of porocess session objects. For this...
4
by: Tran Hong Quang | last post by:
Hi, I'm using Windows 2000, English version, Microsoft Visual Studio.Net 2003. I compile a project developed for Japanese client, on which there are some Japanese messages. I have error "End of...
18
by: =?Utf-8?B?RGF2aWQ=?= | last post by:
I have a VC++ / .NET 2.0 solution built using VS 2005 SP1 under XP. Everything has been working well there over the past year. I have recently starting porting the app to Windows Vista (since it...
1
mathewphilipp
by: mathewphilipp | last post by:
Dear all, I have a VB 6 application (VB 6.0 with MS Access) working well in all other Windows versions like Windows XP, 2000 etc. But it shows the error "Run-time error '713': Application-defined or...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
by: compurhythms | last post by:
I have a .NET Windows Service that needs to run without interruption for long periods of time (weeks or months). Everything works great except that every once in a great while I get the following...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.