How to find reason of failed Build without any error or warning

164,898

Solution 1

I just ran into a similar situation. In my case, a custom action (from the MSBuildVersioning package available on Nuget.org - http://www.nuget.org/packages/MSBuildVersioning/) which appeared in the csproj file's BeforeBuild target was failing without triggering any error message in the normal place.

I was able to determine this by setting the "MSBuild project build output verbosity" (in the latest Visual Studio's Tools tab [Path: Tools > Options > Build and Run]) to "Diagnostic" as shown below. This then showed that the custom action (in my case HgVersionFile) was what had failed.

Screen capture from Visual Studio showing the modified setting.

Solution 2

Build + Intellisense swallowed the error messages. Selecting Build Only displayed them.

Screenshot

Solution 3

  • If solution contains more than one project, try building them one at a time.
  • Try restart Visual Studio.
  • Try restart Computer.
  • Try "Rebuild all"
  • Try "Clean Solution" then remove your "vspscc" files and "vssscc" files and then restart Visual Studio and then "Rebuild All".

Solution 4

VS (2013 Pro, Win 8.1) restart did it for me.

Solution 5

Delete .vs folder & restart VS, worked for me

enter image description here

Share:
164,898

Related videos on Youtube

Abhijeet
Author by

Abhijeet

Updated on July 08, 2022

Comments

  • Abhijeet
    Abhijeet almost 2 years

    I have a WebApplication which contains reference to WCF services.

    While building using Visual Studio 2010, Build fails without any error or warning. However building the .csproj using MsBuild is successful.

    Can't figure out what should I try in Visual Studio, to resolve / diagnose the issue. Can you please help out?

    EDIT:

    I find out that the build has been failing,

    1. From text displayed in status Bar.
      enter image description here

    2. From output window :

      ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
      
    • Sam I am says Reinstate Monica
      Sam I am says Reinstate Monica over 11 years
      how do you know that your build is failing?
    • Abhijeet
      Abhijeet over 11 years
      @SamIam Updated question to indicate this.
    • Malice
      Malice over 11 years
      Is there anything in the output tab?
    • Abhijeet
      Abhijeet over 11 years
      @Malice It includes configuration details. ------ Build started: Project: <projectName here> Configuration: Debug Any CPU ------
    • Maxim Kornilov
      Maxim Kornilov over 11 years
      Try to increase verbosity of the Output Window in Visual Studio. It can help to determine the problem. How to increase verbosity level: blogs.msdn.com/b/saraford/archive/2008/10/07/…
    • comecme
      comecme over 11 years
      Have you tried restarting VS2010 or even rebooting your PC?
    • Malice
      Malice over 11 years
      @autrevo: There might be something in your computer's event log. See neovolve.com/post/2010/09/10/… for more information.
    • DJ Burb
      DJ Burb over 11 years
      Or try to clean you solution and rebuild all, then run it.
    • Abhijeet
      Abhijeet over 11 years
      @MaximKornilov I did increase verbosity to Diagnostic mode. But couldn't find much useful info.
    • Nahuel Ianni
      Nahuel Ianni about 10 years
      It's been two years since the original post, given that you modified the question 3 minutes ago, do you still have the problem?
    • Abhijeet
      Abhijeet about 10 years
      @NahuelI. I got similar problem once again in another project, when I searched stackoverflow I got my own question back :-)
    • Abhijeet
      Abhijeet about 10 years
      @NahuelI. Last time there was an issue in .csproj which we had to edit manually to fix the issue. As suggested in comments I have tried to change msbuild verbosity to diagnostics but I don't see an error.
    • Nahuel Ianni
      Nahuel Ianni about 10 years
      @Abhijeet Just to try stuff, did you try closing VS, deleting the bin and obj folder, opening VS and compiling again?
    • Moby Disk
      Moby Disk almost 10 years
      Post the result from the output window. The problem can't be solved without more information because at this point, the community has no code, no error message, and no output.
    • f470071
      f470071 over 8 years
      @Abhijeet Did you find the solution and if - what is it?
    • alelom
      alelom about 2 years
      In my case, compiling the projects one at a time helped. I didn't get any error when doing Rebuild All (even cleaning/reopening/etc), except when I went singularly and did Build on every single project. One of the projects in the chain had errors that popped up only like this. Fixing the errors allowed me to compile the solution. The verbosity option wasn't useful to me, just too many lines to parse.
  • Dovydas Navickas
    Dovydas Navickas about 8 years
    Well, building a project at a time might not be necessary, but one thing is for sure: carefully look at the output window (of better yet copy/paste it to notepad and use Ctrl + F find) for a word "missing". It'not showing up in the errors list, but it sure as hell breaks your solution. -.-
  • Alex Zhukovskiy
    Alex Zhukovskiy over 7 years
    And when it doesn't help should I just find a new job?
  • Jmaurier
    Jmaurier over 7 years
    Just restarting VS2013 helped me. I was working on a VM with limited resources but I'm not sure if that had anything to do with it.
  • Fijjit
    Fijjit over 7 years
    Turns out I'd added a new project and it had a different .Net target framework version - I fixed that and, although the build still failed, I was then able to see the error that was breaking the build. Thanks.
  • sirdank
    sirdank over 7 years
    For anyone who is clueless like me: to use this method you may have to search the contents of the output window. My build errors were being hidden by #pragma warning disable statements and were only visible when I searched 'error' in the output window.
  • TxRegex
    TxRegex over 7 years
    After setting my verbosity to diagnostic, I discovered I was getting a System.OutOfMemoryException. I was using 98% of my computer's available memory. This is a great answer!
  • maplemale
    maplemale over 7 years
    VS 2015 Community Win 7 with a single MVC Project. Same resolution.
  • niico
    niico about 7 years
    also select 'build only' not 'build + intellisense' in errors filter.
  • Renat Khabibulin
    Renat Khabibulin almost 7 years
    In my case it was a project with .Net 4.5 references project with 4.5.2. Detailed diagnostic helper to find it out
  • H. Aydin
    H. Aydin over 6 years
    You cannot clean the solution if you are having this issue.
  • DreamTeK
    DreamTeK almost 6 years
    VS 2017 Community Win 10. I guess I should of tried turning it off and on again before searching for a solution!
  • Ivan Kaloyanov
    Ivan Kaloyanov almost 6 years
    This is a comment
  • EliSherer
    EliSherer almost 6 years
    What helped me is closing all instances of VS (not enough to close the faulty one), and then delete the .vs folder and start VS again.
  • AaronLS
    AaronLS about 5 years
    For me I was using Queue New Build to build on TFS and the Queue Build dialog has a verbosity on the second tab I could turn up and then see the problem in the build log.
  • Imad
    Imad almost 5 years
    Just got into the situation where none of these shows error :(
  • Tys
    Tys about 4 years
    Added a reference to another project in the solution. Somehow something went wrong. References list in the Solution Explorer stated that it was there. Only after switching to diagnostic mode, the output window told me that there was something wrong with that reference. Removed it and added it again, and problem solved.
  • Carter
    Carter about 4 years
    Wow, this worked for me how in the heck is this a thing in VS 2019's new version. Thanks man!
  • DAG
    DAG almost 4 years
    When I attempted to resolve this by deleting bin and obj folder it fixed it. Also I required admin rights to delete the obj folder so something very strange had happened.
  • DudeManGuy
    DudeManGuy almost 4 years
    My solution was to wipe VS off my disk and use notepad
  • Mariano Luis Villa
    Mariano Luis Villa over 3 years
    Thanks! If you don't find the specific error but suspect this is the issue, you can try changing the project's TF to a higher one. That was it in my case.
  • ourmandave
    ourmandave over 3 years
    VS 2019 Pro Win 7. The tradition continues. =(
  • MadMarc
    MadMarc over 3 years
    VS 2019 Community 16.7.5, Windows 10. Some things will never change.
  • Hawkeye4040
    Hawkeye4040 over 3 years
    Wow, that is so odd! Is that a bug in VS?
  • Liam
    Liam over 3 years
  • Arun Prasad E S
    Arun Prasad E S over 3 years
    @Liam a lot of things, like cache, configuration settings etc. stackoverflow.com/a/48897202/5237614
  • nam
    nam over 3 years
    @RenatKhabibulin For my VS2019, just closing and restarting the VS2019 worked.
  • Svet
    Svet over 3 years
    that is what i was looking for. project is not building after changes because of this folder
  • AAV
    AAV over 3 years
    I had the same issue with Visual Studio 2019 showing the number of errors in the build diagnostics but not in the Error List. I was able to see errors in the error list by opening the project with Visual Studio 2017
  • Marc Roussel
    Marc Roussel about 3 years
    Wow this command showed the error which building inside VS didn't so I've been able to solve the error. The question now is why VS doesn't report the error while this command does
  • derekbaker783
    derekbaker783 about 3 years
    "First of all make sure all the projects in your solution are targeting the same .NET version". Including test projects.
  • gollumullog
    gollumullog over 2 years
    yup. closed Visual studio deleted .vs folder and restarted and worked fine
  • InvalidBrainException
    InvalidBrainException over 2 years
    This is still happening in VS 2022....
  • alelom
    alelom about 2 years
    In my case, compiling the projects one at a time helped. I didn't get any error when doing Rebuild All (even cleaning/reopening/etc), except when I went singularly and did Build on every single project. One of the projects in the chain had errors that popped up only like this. Fixing the errors allowed me to compile the solution.
  • Waleed Al Harthi
    Waleed Al Harthi almost 2 years
    VS 2022 and Windows 11. Hello from the future!