Getting starred entries in BibLaTeX

I can't get the solution to work from this previous question and answer: Is it possible to mark designated entries in a bibliography with an asterisk?

Here is my example code:

\documentclass{article}

\usepackage[sorting=none, backend=biber]{biblatex} % load the package

\begin{filecontents}{biblatex-dm.cfg}
\DeclareBibliographyCategory{asterisk}
\end{filecontents}

\begin{document}
\cite{key1}
\bibliography{bibfilename.bib}
\end{document}


And I get this error message:

What am I doing wrong?

• Welcome to TeX SX! Could you post a .bib file? – Bernard Dec 30 '16 at 16:57

Use it this way:

\documentclass{article}

\DeclareBibliographyCategory{asterisk}

\begin{document}
\cite{key1}
\printbibliography
\end{document}


The datamodel config file biblatex-dm.cfg is read before biblatex defines all its macros. As an alternative use the default config file biblatex.cfg

\RequirePackage{filecontents}% allows overwriting
\begin{filecontents*}{biblatex.cfg}
\DeclareBibliographyCategory{asterisk}
\end{filecontents*}
\documentclass{article}


That file is read after loading biblatex