XML Serialization error on Windows Vista using Japanese-character

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Q3JhaWdo?=

    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.MyStrin g = "Hello World!";

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

    MessageBox.Show ("Serializat ion 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.InvalidO perationExcepti on: 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
  • Martin Honnen

    #2
    Re: XML Serialization error on Windows Vista using Japanese-character

    Craigh wrote:
    When Serialize() is called, the following exception is reported:
    >
    System.InvalidO perationExcepti on:
    Check whether the problems and solutions under

    apply to your case.

    --

    Martin Honnen --- MVP XML

    Comment

    • =?Utf-8?B?Q3JhaWdo?=

      #3
      Re: XML Serialization error on Windows Vista using Japanese-charac

      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.InvalidO perationExcepti on:
      >
      Check whether the problems and solutions under

      apply to your case.
      >
      --
      >
      Martin Honnen --- MVP XML

      >

      Comment

      • =?Utf-8?B?Q3JhaWdo?=

        #4
        Re: XML Serialization error on Windows Vista using Japanese-charac

        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.InvalidO perationExcepti on:
        >
        Check whether the problems and solutions under

        apply to your case.
        >
        --
        >
        Martin Honnen --- MVP XML

        >

        Comment

        • Joe Fawcett

          #5
          Re: XML Serialization error on Windows Vista using Japanese-character

          Does the 'c:\Users\<user name>\' folder exist as expected?

          --

          Joe Fawcett (MVP - XML)



          "Craigh" <Craigh@discuss ions.microsoft. comwrote in message
          news:C91DAC53-BDA8-4A37-BBD5-2F0ADEE25361@mi crosoft.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.MyStrin g = "Hello World!";
          >
          using (MemoryStream stream = new MemoryStream())
          {
          XmlSerializer serializer = new XmlSerializer(
          typeof (TestClass));
          serializer.Seri alize(stream, myClass);
          }
          >
          MessageBox.Show ("Serializat ion 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.InvalidO perationExcepti on: 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

          Comment

          Working...