I am asked to solve
$$ E\left[ \int_0^\infty \exp(-rt)A\exp(S_t) dt \mid S_0 = s \right]\\ dS_t = \mu d_t + \sigma \, dW_t$$
where $E$ denotes the expectations operator, and $A$ is some constant. I thought it would be clever to define
$$ Z_t = \exp(-rt)A \exp(S_t)$$
and then apply Ito to get
$$ d Z_t = \exp(-rt)\exp(S_t)A [\mu d_t + \sigma \, d W_t] + 0.5 \exp(-rt)A\exp(S_t) \sigma^2 \, dt$$ $$ d E[Z_t] = \exp(-rt)\exp(S_t)A \mu \, d_t + 0.5 \exp(-rt)A\exp(S_t) \sigma^2 \, dt$$
Then, finally, I would have to solve
$$\int_0^\infty E[Z_t] dt$$
but I don't know how to integrate $\exp(-rt\cdot S_t)$
You know that $S_t$ is a Brownian motion + drift starting at $S_0 = s$. $$S_t = \mu t + \sigma W_t, \quad W_0 = \frac{s}{\sigma}.$$ The integral you are taking the expectation of is a regular Riemann-Stieltjes integral, so you can apply Tonelli and Fubini to switch the order of integration. That is, $$\mathbb{E}^s\left[\int_0^\infty Ae^{-rt+S_t}\ dt\right] = \int_0^\infty Ae^{-rt}\mathbb{E}^s[e^{S_t}]\ dt.$$ Of course, $S_t \sim N(\mu t, \sigma^2 t).$ To evaluate this expectation you simply need to complete a square: $$\mathbb{E}[e^{S_t}] = \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi \sigma^2 t}}e^{-\frac{(x-\mu t)^2}{2t\sigma^2}}e^{x} dx.$$ The expression will be a function of $t$, so hopefully you can then proceed normally. Don't forget to account for starting at $s$.