ASP.NET MVC : ‘Publish failed’ but build succeeded?

Updated on     Kisan Patel

When using Visual Studio, when I “Publish Web Site”, the application builds correctly, but then I get a “Publish failed” message:

Solution :

Just remove the Microsoft.Net.Compilers package and publish it again.

Note: This problem occurs on VS 2008, 2012 and 2015 but does not occur on 2017.


Leave a Reply