We continue our previous work studying critical exponent semilinear elliptic
(and subelliptic) problems which generalize the classical Yamabe problem. In
[3] the focus was on metric-measure spaces with an `almost smooth' structure,
with stratified spaces furnishing the key examples. The criterion for
solvability there is phrased in terms of a strict inequality of the global
Yamabe invariant with a `local Yamabe invariant', which captures information
about the local singular structure. All of this is generalized here to the
setting of Dirichlet spaces which admit a Sobolev inequality and satisfy a few
other mild hypotheses. Applications include a new approach to the nonspherical
part of the CR Yamabe problem.Comment: 25 page