Today’s film noir fans are a sad, desperate lot. With the announcement of every new noir project, they breathlessly hope for the gritty brilliance of “Devil in a Blue Dress” or the whiplash twists and turns of “L.A. Confidential,” but usually find themselves sighing through the muddled likes of a “Mulholland Falls” or the overheated operatics of “Romeo Is Bleeding.” So when it was announced that Brian De Palma was attached to direct one of the most beloved books in the noir canon, James Elroy’s “The Black Dahlia,” fans cheered. Surely, the director of stylish cocktails like “Body Double,” “Blow Out” and the inscrutable but dreamily affecting “Femme Fatale” would know just what to do with Elroy’s Byzantine procedural.

Gentle reader, this reviewer takes no pleasure in saying that “The Black Dahlia” is a languid mess. But it’s not De Palma’s fault. The film is visually arresting; his camera floats over and around the moodily lit action with a confident grace. And no director working today stages a murder with the same gusto as De Palma (with the possible exception of Dario Argento). A murder scene that takes place on a staircase harkens back to the haunting intensity of the staircase shootout in De Palma’s “The Untouchables.”

No, the blame for this morass lies squarely with the screenwriter, Josh Friedman, who seems oddly uninterested in delving into the murder from which the film gets its title. Set in post-war Los Angeles, the story concerns two homicide detectives Dwight Bleichert (Josh Hartnett) and Lee Blanchard (Aaron Eckhart) who set out to solve the grisly murder of aspiring actress Elizabeth Short (Mia Kershner), later dubbed “The Black Dahlia” by the tabloids. Or rather, the story should have concerned that investigation. However, for the first half of the film, it does not, instead focusing on a love triangle between the two detectives and Blanchard’s lovely live-in girlfriend Kay Lake (Scarlett Johansson). To further lower the dramatic stakes, we are told that Blanchard and Lake are not really that into each other. Lake confides in Bleichert that she and Blanchard do not actually sleep together. The couple’s frigidity is never explained and leaves the viewer wondering why Blanchard would care whether his “roommate” took up with his partner. Most frustratingly of all, the romantic entanglements of the three main characters do not even connect back to the Black Dahlia.

About forty minutes into the film, the detectives finally do stumble across the case. At which point, Blanchard becomes suddenly and inexplicably obsessed with solving the crime. As Blanchard’s obsession devolves into madness, Bleichert seems less concerned about the murder and more worried about the effect that his partner’s increasingly disturbing behavior might have on Lake. Placing the murder investigation in the background leaves the viewer feeling both cheated, especially since the most moving sequences of the film revolve around brief flashbacks of Elizabeth Short when she was still alive. Appearing in studio screen tests, we come to know Elizabeth Short as a brittle, tragic figure, a young, talentless wannabe who believes in the Hollywood dream with all the faith and fervor of a Southern Evangelical. Short is a woman who deserved to be saved, but since that is not possible, she at the very least deserves to be avenged.

When Bleichert finally does dive head-first into the investigation, he makes the ill-advised decision to begin an affair with one of the prime suspects, Madeleine Linscott (Hilary Swank), a sexually-adventurous spitfire and the daughter of a Los Angeles real estate magnate. While detectives have been falling for the “femme fatale” in every noir from “The Maltese Falcon” to “Sea of Love,” Hartnett and Swank have zero chemistry, and the writer fails to provide either character with motivation to pursue the other. Bleichert seems to fall into bed with Linscott for no other reason than that’s what detectives are supposed to do in this kind of movie.

While the film’s story is lacking, the film’s casting is strong for the most part. Eckhart does well enough, projecting a bluster which is both charming and, at times, ferocious. Johansen’s Lake is sweetly sexual, a ripe peach begging to be plucked, though I wish the writer had given her more to do than simply be an object of desire. Swank shines, playing the carnivorous Linscott with a mixture of leering physicality and intelligence, reminiscent of Kathleen Turner in “Body Heat.” Even the usually insufferable Rose McGowan is put to good use in a cameo as a young starlet who once roomed with Short. But the real discovery here is Kershner. Her performance is fearless and vulnerable, yet somehow effortless, like Amy Adams’ turn in last year’s “Junebug.” K-E-R-S-H-N-E-R. Write it down.

Which brings us to the leaden balloon that is Josh Hartnett.

One of the secrets to a good noir is having a lead character who is a bit of a bastard. Take the three protagonists of Elroy’s last adaptation, “L.A. Confidential.” Detective Ed Exley, a conniving, twitchy careerist, loyal only to his own ambition. Detective Jack Vincennes, a slick, unrepentant glad hander who sees his job not as an opportunity to clean up the streets, but as a chance to rub elbows with the stars of a “Dragnet” style TV show. And finally Officer Bud White, a simple-minded, feral beast who plants evidence and joyfully beats suspects into submission. These characters’ sharp edges make them not only more fascinating to watch, but also allow them to better navigate society’s dark underbelly. Here, Hartnett projects little more than bland affability, a kid from Simi Valley dressed up for a community theater production of “Millers Crossing.” What’s worse, Hartnett’s Bleichert, as written and performed, seems to be, for lack of a better word, stupid, wholly lacking the deductive skills necessary to solve a crime as complex as “The Black Dahlia” proves to be. Lucky for him (and unfortunately for us), the whole mystery is resolved without the need for any such police work. In the end, a wild-eyed loon (who seems to be channeling Molly Shannon’s Catholic School Girl character from Saturday Night Live) gives a long, unprompted monologue during which she explains whodunnit and why, thus allowing both him and the audience to finally close the book on “The Black Dahlia.”