views:

176

answers:

3

Using C#, XmlDocument.Load is throwing this exception: "hexadecimal value 0x3C, is an invalid attribute character".

What's confusing me is it works find in development. What differences should I be looking for on the remote server vs my development environment?

A: 

The odd are that the content its trying to parse is the source of the error - i.e. your local dev/test data isn't the same as the live data and its the live data that's causing the problem.

You need to run exactly the data that's causing the problem on the live system through a local instance of the app - if you still don't get the error then the next question will be how are the two different.

Murph
+1  A: 

The first thing I'd look at is: are they running exactly the same version of .NET? If your server is running 2.0 SP1, and your "devenv" is VS2008 SP1 (i.e. .NET 3.5 SP1), then they are not 100% the same, and there can be subtle differences even when just using the 2.0 dlls (i.e. the things that have been fixed / changed in service-packs).

The second thing I'd look at is: are they processing the same input data?

The third thing I'd look at is "culture"; is your dev machine set to French, and your server to Russian? (or something). Unlikely in this case, but in the general case different cultures and default-encodings / codesets can make a difference.

Marc Gravell
+1  A: 

It looks to me like a data issue. Specifically that there is an unescaped < in the file

A < can be escaped as &lt;

AJM