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

XML Serialization error on Windows Vista using Japanese-character

P: n/a
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
Share this Question
Share on Google+
4 Replies


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

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

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.