Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to resolve the XML Error

How to resolve the XML Error

Scheduled Pinned Locked Moved C#
helpcsharpvisual-studioxmltutorial
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    meeram395
    wrote on last edited by
    #1

    I have a C# mobile application class. In that, there is a functionality which I use XmlTextWriter class. While compiling I am getting the following error:

    The type 'System.Xml.XmlTextWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    I have added reference of System.Xml through Add Reference and also use the namespace by the keyword 'using...'. Still I am getting the same error. Any Idea how to resolve this? I am using Visual Studio 2005 SP2. Is this belong to some setup issue? Please help. Thanks meeram395.

    Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

    P L 2 Replies Last reply
    0
    • M meeram395

      I have a C# mobile application class. In that, there is a functionality which I use XmlTextWriter class. While compiling I am getting the following error:

      The type 'System.Xml.XmlTextWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

      I have added reference of System.Xml through Add Reference and also use the namespace by the keyword 'using...'. Still I am getting the same error. Any Idea how to resolve this? I am using Visual Studio 2005 SP2. Is this belong to some setup issue? Please help. Thanks meeram395.

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Click on System.Xml in the references section. Click properties, and see what the version number is. Make sure you are using the correct version.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        Click on System.Xml in the references section. Click properties, and see what the version number is. Make sure you are using the correct version.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        M Offline
        M Offline
        meeram395
        wrote on last edited by
        #3

        The version and runtime version is 2.0.0.0 only. Is there any other settings need to change?

        Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

        P 1 Reply Last reply
        0
        • M meeram395

          I have a C# mobile application class. In that, there is a functionality which I use XmlTextWriter class. While compiling I am getting the following error:

          The type 'System.Xml.XmlTextWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

          I have added reference of System.Xml through Add Reference and also use the namespace by the keyword 'using...'. Still I am getting the same error. Any Idea how to resolve this? I am using Visual Studio 2005 SP2. Is this belong to some setup issue? Please help. Thanks meeram395.

          Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          meeram395 wrote:

          I have a C# mobile application class.

          Looks like it may not be available for mobile;

          MSDN[^] states:

          Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

          I are Troll :suss:

          M 1 Reply Last reply
          0
          • M meeram395

            The version and runtime version is 2.0.0.0 only. Is there any other settings need to change?

            Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            The only thing I've got to wonder is if this is the mobile version or the desktop version, and whether you have multiple projects in your solution (in which case you'd have the ensure the same was present in all projects this particular project was referenced in).

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            1 Reply Last reply
            0
            • L Lost User

              meeram395 wrote:

              I have a C# mobile application class.

              Looks like it may not be available for mobile;

              MSDN[^] states:

              Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

              I are Troll :suss:

              M Offline
              M Offline
              meeram395
              wrote on last edited by
              #6

              Ok. The error doesn't have any relation with mobile development. The error occurs in a simple class which is having XMLTextWriting functionality

              Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

              L 1 Reply Last reply
              0
              • M meeram395

                Ok. The error doesn't have any relation with mobile development. The error occurs in a simple class which is having XMLTextWriting functionality

                Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                meeram395 wrote:

                The error doesn't have any relation with mobile development.

                It depends. Are you trying to use the class from the Compact Framework? Seems it is not part of that framework, and I doubt that you can simply reference libraries that where meant to run on a real desktop.

                I are Troll :suss:

                M 1 Reply Last reply
                0
                • L Lost User

                  meeram395 wrote:

                  The error doesn't have any relation with mobile development.

                  It depends. Are you trying to use the class from the Compact Framework? Seems it is not part of that framework, and I doubt that you can simply reference libraries that where meant to run on a real desktop.

                  I are Troll :suss:

                  M Offline
                  M Offline
                  meeram395
                  wrote on last edited by
                  #8

                  Ok. That makes sense. Thanks very much. I tried to view the reference in object properties and I can see two xml references, one is without Compact Framework and one is with it. So I believe that it is referencing from Compact Framework. Let me try to resolve this. Would be great if you can have some inputs. Thanks once again :)

                  Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups