# Error using XeLaTeX and Biber to cite sources

I am using Biber to cite my sources with biblatex-apa, with the package apa6 on OS X. Everything was going smoothly until I added a certain source which caused xelatex to stop compiling with the error:

(./test.bbl
! Illegal parameter number in definition of \NewValue.
}
l.36 ...{Introduction to Neural Networks for {C#}}

?


I will provide an MWE that produces the error (to reproduce, run xelatex test, biber test, then xelatex test again):

test.tex

\documentclass[man, 12pt]{apa6}
\usepackage{fontspec}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa, sorting=nty]{biblatex}
\DeclareLanguageMapping{british}{british-apa}
\setmainfont{Times New Roman}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}

\begin{document}
\title{My Title}
\author{My Name}
\affiliation{Chemistry I H, 4th hour, Ms. Kris Clements}
\note{October 15, 2013}
\shorttitle{Algorithms for protein sequence alignment}

\maketitle
Hello world \parencite{heatonresearch}.
\printbibliography
\end{document}


test.bib

@book{heatonresearch,
Author = {Heaton, Jeff},
Publisher = {Heaton Research},
Title = {Introduction to Neural Networks for {C#}},
Year = {2008}}


A strange thing happens with this setup: If I rerun biber test, an error pops up:

Entity: line 2063: parser error : Extra content at the end of the document
<bcf:section number="0">


Could someone please explain what the errors mean, and how I can fix this? My paper is due tomorrow, and it's worked fine up until now.

Thanks!

@book{heatonresearch,

• I got the same error, but what was your clue to find out that it was the unescaped #? – doctorate Jun 9 '14 at 8:45