[Mono-list] System.NullReferenceException: Object reference not set to an instance of an object

Sascha Manns Sascha.Manns at mailbox.org
Tue Feb 7 16:15:42 UTC 2017


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20170207/25daaa5d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20170207/25daaa5d/attachment.sig>


More information about the Mono-list mailing list