Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is an error in XML document (2, 2).What does this mean?

Tags:

I am trying to read XML document. My XML:

<?xml version="1.0" encoding="utf-8"?> <SplashScreen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">   <Path>SplashScreen/Image-King</Path> </SplashScreen> 

My code which is reading XML:

XmlGameScreen = new XmlManager<GameScreen>(); XmlGameScreen.Type = currentscreen.Type; currentscreen = XmlGameScreen.Load("LoadXML/SplashScreen.xml"); 

And

public Type Type; public T Load(string path) {     T instance;     using (TextReader textreader = new StreamReader(path))     {          XmlSerializer xml = new XmlSerializer(Type);         instance = (T)xml.Deserialize(textreader);     }     return instance;  } 

I am getting error on instance = (T)xml.Deserialize(textreader); Is my XML document wrong? I am trying to read <Path>. Update : My Internal Exception: Cannot serialize member 'MyRPGgame.SplashScreen._image' of type 'Microsoft.Xna.Framework.Graphics.Texture2D'

like image 231
Losser Bad Avatar asked Jan 12 '15 15:01

Losser Bad


People also ask

What does error in XML document mean?

An error was detected while trying to load an XML schema file. This normally means that there was a problem locating the document (either the document does not exist or there is a problem with permissions) or that the schema itself is in error.

What is XML serialization and Deserialization in C#?

Serialization is a process by which an object's state is transformed in some serial data format, such as XML or binary format. Deserialization, on the other hand, is used to convert the byte of data, such as XML or binary data, to object type.


1 Answers

In my case it appears one of the Visual Studio 2017 version 15.5 updates caused this error when trying to open SSRS projects. The solution is to delete the *.rptproj.rsuser file from the project folder and try again.

like image 167
user875318 Avatar answered Sep 20 '22 11:09

user875318