1
votes

I'm suddenly not able to publish my dot net core project, having made no known changes, so this seems mysteriously frustrating atm... (compounded by consistent troubles with project build issues for months now, while using dot net core for my back end server).

When I go to publish, it fails and gives me the error message:

"Publishing failed."

Inspecting the logs, I see every single razor view has a warning or error ending with the same message:

"*.cshtml (-1): Targeted tag name cannot be null or whitespace."

And finally, the commandline error:

"C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.0\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(60,5): Error MSB3073: The command ""dotnet" exec --runtimeconfig"

is spat out, leaving me without even enough of a hint to the problem to even know where to look.

Any ideas what kind of steps I can take to trouble shoot this sort of thing?

If I don't solve this soon I think it's the final straw with dot net core for me... I wanted to to like it... I really did... I've spent more time trying to make it simply build, (following everything by the book too!) than I've spent coding! The biggest headache was definitely the upgrade to dotnetcore 2.0... even with Microsofts instructions.

2
@omajid Yep, unfortunately creating a new project from scratch and copying my sourcecode and other assets/configs over isn't really the kind of solution I'm looking for. - David van Dugteren
OMG. Absolutely the same thing just start happening for me. I guess it's after I upgraded VS to 15.3. Everything worked fine and now publishing is broken. Rebuild in cli/VS works fine. Did you upgrade VS? - Shrike
Also I should say that it has nothing to do with upgrading from 1.1. - Shrike
@Shrike Yep I had upgraded come to think of it... I'll try your suggestion now! - David van Dugteren

2 Answers

4
votes

As I noted in commets I had the same issue as you. I didn't do any significat changes in codebase but suddenly encountered that msdeploy package is failing to built. At the same time rebuilding project in vs and via cli works fine.
It may sound very silly but I just removed obj and bin folders in my project and after then dotnet publish started working fine as before.

1
votes

I had <Private>false</Private> under one of my References. Simply removing it fixed my issue. I got the idea from here: https://stackoverflow.com/a/46066976/1777780

If deleting bin and obj and restoring then publishing/running do not work for you, try removing anything that appears to be unneeded from your proj.