System.NullReferenceException: Object reference not set to an instance of an object

Sascha Manns <[email protected]> Tue, 07 Feb 2017 17:15:42 +0100
Newsgroups gmane.comp.gnome.mono.general
Message-ID <[email protected]>
Hello list,

i have a DocBook file with that content:

<info version="5.0" xml:id="info-Documentation-Test-Test" xmlns="http:/
/docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
...
  <productnumber>0.1</productnumber>
...
</info>

My goal now is to replace that number with another. I tried:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(info);
xmlDoc.SelectSingleNode("//productnumber").InnerText = revnumber;
xmlDoc.Save(info);

The info variable targets to the mentioned file above.

If i'm running my code i'm getting:

Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object
  at PublicanCreators.Core.RevUpd.ChangeRevision (System.String
revnumber, System.String articleInfo, System.String bookInfo) [0x0003e]
in
/home/sascha/RiderProjects/PublicanCreators/src/PublicanCreators.Core/R
evUpd.cs:85 

Maybe anyone knows how to fix that?

Greetings
Sascha

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.dot.net/mailman/listinfo/mono-list
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAABCAAGBQJYmfKuAAoJEHUnY+i/qDoshxYQAJ4aJoBgvMhEQxE89srEw2IY
YVc+DEPt9XSvB78CL5sEy64icH7XPqsRzgTluvOut6pBgyAIyfk7s/yx2sRx1PTw
QgrFkI+Qe0sL+qZE9n7dxjl4/QBz3qW3tF8kthm043Z1w4Qo1idrFfWWKdx1UaQM
evCBK0mJmkevRpKHb0z4O5c3qDWao5hNXwYXRSog9qrISVYNTEqVENgLpGTXQ/Hy
4UY/011aDoLPBj9BIBZLlM9vodU/nFU1I7U2UPOSgfRrleaJlY5BL3606AR6C6bn
Mq4dK/9MzYOYIvfB17SMbWUMArXEFP30DhdYi+YZYpu5A0utCO1ukbvC3+zlM8Qe
FPPd3QRu8/lgJ/Onx1l8f1WqsVRcrOYqoKFZS6i7Zfl9XdfhrS5g+japQJewxYhH
YQ3AMcEtyJQYFmD/zXBTF6XugqgUkVmmfP+cLM7CY1ZM299Paw3FjgVE2bvCbNKi
cpIpLW+5x7VdmP8vV71RG+/FKbaYjn85BS0CP1PWKzpyE+nqAIt6DQl8G2EpthpZ
0PL3AVPsoO32J8RtCuWW7JPQGXSEndI1aSwUyqNMARer94FD8+rnj9YzJEkTWseW
x0VM8Fx90ygi6Dn/CqHaU3SFymkBzO64VmuAdT+PhT8ImDnUEVU8SthXfi5IY1jd
LBy06eyOi0liMwjqIYz+
=3nly
-----END PGP SIGNATURE-----