Even though xpert has already accepted the (frequently given) "use semiverbatim" answer by Herbert, I would like to present my listings-only solution here as well – for those like Tobi, who do not want to give up on syntax coloring and all the other cool features of the listings package.
The first thing to do (similar to Herbert's solution) is to not use beamer's \defverbatim, but to embed the listings inside the frame using the [fragile] option. (The whole point of \defverbatim is that the content is expanded before \begin{frame}, hence overlay specifications just don't work.)
The trick is then to use the moredelim style option of listings to inject the overlay-command into the listing:
\documentclass[dvipsnames,cmyk]{beamer}
\usepackage{listings}
\lstloadlanguages{[Sharp]{C}}
\lstdefinestyle{base}{
language=[Sharp]{C},
moredelim=**[is][\only<+>{\color{red}}]{@}{@},
}
\begin{document}
\begin{frame}[fragile]{MyListing 1}
\begin{lstlisting}[style=base, gobble=4]
using System;
public delegate void Foo(object o);
@public class Foo@
@{@
@ public static void Main()@
@}@
\end{lstlisting}
\end{frame}
\end{document}
Note that I'am using \only instead of \uncover, as the formatting given by \moredelim** is applied additionally to all other formattings of the current line, which means that \uncover has basically no effect here.
To achive not only highlighting of the current line, but also "dimming" of the remaining parts (as in Tobi's solution), we have to play a bit more around with listing styles. The idea is to have one style (base) that renders the listing "dimmed" and another one (highlight) that is applied on top of it in the \moredelim command (using \lstset) to remove the "dimming" for the current line. This works for all style elements, but basicstyle, so we apply the "nondimmed"-version of basicstyle (which here is \color{black}) manually in the moredelim command:
\lstdefinestyle{highlight}{
keywordstyle=\color{red},
commentstyle=\color{green},
}
\lstdefinestyle{base}{
language=[Sharp]{C},
basicstyle=\color{black!40},
keywordstyle=\color{red!40},
commentstyle=\color{green!40},
moredelim=**[is][\only<+>{\color{black}\lstset{style=highlight}}]{@}{@},
}
\begin{frame}[fragile]{MyListing 2}
\begin{lstlisting}[style=base, gobble=4]
using System;
public delegate void Foo(object o);
@public class Foo@
@{@
@ public static void Main()@
@}@
\end{lstlisting}
\end{frame}