Visual Studio 2015 project builds failed but no errors

74,860

Solution 1

I have had the same problem and closing and re-opening Visual Studio clears it up.

I had also tried Cleaning the solution and the Clean Failed as well.

There may be other scenarios where this does not do the trick, but in my case restarting has resolved this for me.

Solution 2

It's possible that you're not seeing all the build errors.

By changing the drop down list after the "Messages" icon from "Build + Intellisense" to "Build Only", you will be able to see errors thrown during the build that are not detected by Intellisense. See the screenshot below:

Build

Solution 3

I've been seeing regular instances of VS2015 reporting "build failed" but not showing any errors in the error window. Coming from an ancient command line background, I finally went looking at the output window. The output window showed the compiler reporting errors but those errors were not being captured to the error window. I never saw this problem under VS2013.

The usual closing of VS and reopening of it hasn't cleared this condition. (In VS2013 this was a common way to kick XAML intellisense in the rear and make it stop fixating on an "error" that had been fixed.)

So far this has always been related to compilation errors in a XAML page CS file. I can't remember seeing it in a non-page CS file.

Until one figures out to go check the output window, things like intellisense reporting in the error window invalid references to objects in the XAML, but no compiler errors being shown in the error window can get VERY confusion since it "appears" like the errors are the intellisense reporting XAML errors. But they actually aren't. The XAML errors are just symptoms of CS files failing to compile but not having their errors reporting in the error window.

Solution 4

Deleting the hidden .vs folder for worked for me for VS2015.

(Note that this is where the SUO files live now)

Solution 5

This might happen when you reference a different .net framework version project (v4.5.2 vs v4.5 in my case). Correcting this will fix your problem.

Share:
74,860

Related videos on Youtube

Rob Greenlee
Author by

Rob Greenlee

Updated on May 11, 2021

Comments

  • Rob Greenlee
    Rob Greenlee about 3 years

    My project builds all fail but I'm not shown any errors. I tried cleaning and rebuilding, that didn't work.

    I changed the MSBuild output verbosity to 'Diagnostic' hoping it would help me identify the problem and now I'm stuck. Here's what the output looks like:

    1>Project 'ProjectMM.Data.Models' is not up to date. Input file 'C:\Projects\ProjectMM\ProjectMM.Data.Models\ProjectMM.Data.Models.csproj' is modified after output file 'C:\Projects\ProjectMM\ProjectMM.Data.Models\bin\Debug\ProjectMM.Data.Models.pdb'.
    All packages are already installed and there is nothing to restore.
    1>------ Build started: Project: ProjectMM.Data.Models, Configuration: Debug Any CPU ------
    2>Project 'ProjectMM.Data' is not up to date. Input file 'C:\Projects\ProjectMM\ProjectMM.Data\ProjectMM.Data.csproj' is modified after output file 'C:\Projects\ProjectMM\ProjectMM.Data\bin\Debug\ProjectMM.Data.pdb'.
    2>------ Build started: Project: ProjectMM.Data, Configuration: Debug Any CPU ------
    3>Project 'ProjectMM' is not up to date. Input file 'c:\projects\projectmm\projectmm\app_start\bundleconfig.cs' is modified after output file 'C:\Projects\ProjectMM\ProjectMM\bin\ProjectMM.pdb'.
    3>------ Build started: Project: ProjectMM, Configuration: Debug Any CPU ------
    ========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========
    
    • Karthik
      Karthik almost 9 years
      Does your Error List window is showing up or not?
    • Karthik
      Karthik almost 9 years
      Go to View menu -> Select Error List and check if you have any errors. Ideally you should get it in Error List. Keep your Error List window in open and try building the project and see what happens..
    • Rob Greenlee
      Rob Greenlee almost 9 years
      So, here's what just happened: I posted this question and assuming I wouldn't get a response right away, I closed the project. You prompted me to open it back up, open the error list and rebuild. It worked perfectly, no errors, all succeeded!
    • jpo38
      jpo38 about 7 years
      @RobGreenlee: See my answer, I bet the "Error tab" was active when you re-opened the solution!
  • Yinda Yin
    Yinda Yin over 8 years
    For those of you still struggling with an invisible errors window, it appears you can get the compiler errors to show up in the window by selecting Build Only in the Filter ErrorList To dropdown in the Error List window (the dropdown is not labelled... You can figure out which one it is by hovering the mouse over it and observing the tooltip).
  • Bastiaan Linders
    Bastiaan Linders over 8 years
    If it doesn't help to restart. I often encounter this problem when I add a project to my solution, with another Target framework referencing different framework projects.
  • cellik
    cellik over 8 years
    In my case restarting VS or cleaning the solution didn't help. However, removing the .suo under the .vs folder solved the problem
  • felickz
    felickz over 8 years
    @RobertHarvey ... this is the key... but WHY in the world would Intellisense override the build?
  • David Gunderson
    David Gunderson over 8 years
    @RobertHarvey that was exactly it. Turns out, as someone here suggested I was referencing an incompatible .net project, but I couldn't tell what the problem was until I switched the output to "Build Only" in the Error pane. As soon as I did that it pointed me right to the issue. Thank you for the tip.
  • granadaCoder
    granadaCoder almost 8 years
    This answer was the clue for me. Search for "error CS" (no quotes) for possible blocking build exceptions.
  • granadaCoder
    granadaCoder almost 8 years
    PS. My error was that I had used the same variable name in my method. "string x = string.Empty;" for example. I had an exception handler that also had a "string x" declaration in it.
  • FredyWenger
    FredyWenger almost 8 years
    @Keith: Did you ever solved the problem? I have exactly the same (build failed, error is NOT showed in error-list but in output-window). I work with VS2015 update 3 RC and strange wise have the problem only with my Xamarin.Forms project, where I don't have it in another VB.net project opened with the same VS2015).
  • KMC
    KMC almost 8 years
    @cellik : It doesn't work in my case. What is worth..I'm using Enterprise edition.
  • KMC
    KMC almost 8 years
    Dude you are my savior!
  • Philip Schiff
    Philip Schiff over 7 years
    Restarting VS worked for me, but now it's cropping up with every build! Do I really want to wait for VS to start (slowww) every time I build?
  • JustinMichaels
    JustinMichaels over 7 years
    This is crazy that we accept this as our solution. I have this same issue and it appears to be with a single new solution that was targeted against 4.6.1 framework. I have yet to have the other 30+ older solutions do this.
  • martinh_kentico
    martinh_kentico over 7 years
    I had the same problem after changing my computer time from CEST time zone (GMT+1) to US time zone (GMT-7), it seems that it could not handle that the time stamp of the last build was in future. After restarting VS everything is OK.
  • Eric Milliot-Martinez
    Eric Milliot-Martinez over 7 years
    After leaving my computer locked over the weekend, I was having this problem and restarting Visual Studio 2015 (enterprise - update 3).
  • Johann Marx
    Johann Marx over 7 years
    Deleting the .suo files did the trick for me as well, restarting and cleaning did not.
  • CodyF
    CodyF over 7 years
    Why would the "Build Only" errors not be present in "Build + Intellisense"?
  • Admin
    Admin over 7 years
    @martinh_kentico, spot on.
  • John Demetriou
    John Demetriou over 7 years
    Why isn't this answer more highly upvoted? It gives you the perfect solution to debug what is wrong
  • John Demetriou
    John Demetriou over 7 years
    It's not just about figuring the problem, it's about learning how to troubleshoot the problem. This is why I included other answers debugging process, because that is what helped me find out what is wrong. Not just random guesses on what the problem might be
  • M B
    M B over 7 years
    no clue. I do use version control so it could be that got confused with the times???
  • TomK
    TomK about 7 years
    @martinh_kentico, bingo! To the letter, this is what happened to me. I work in NJ, today on a trip to TN, opened Visual Studio, changed laptop time zone from Eastern to Central and blam. Closed/Reopened, and all is well.
  • Drew
    Drew about 7 years
    This helped with showing the errors in the error list, but the lines of code with the errors have no red underlines. I'm guessing this must be an Intellisense issue then.
  • Drew
    Drew about 7 years
    This was exactly my problem. Added a new project to the solution which was v4.5.2 and I referenced it from another project which was v4.5. Switched the new project to v4.5 and it worked fine.
  • jpo38
    jpo38 about 7 years
    Check my answer below. I aslo thought your solution was right but I realized that even with the "Diagnostic" output level, my "Error tab" would remain empty. As other ones, you most likely kept the "Error tab" active and that's why it started working fine...
  • HerrimanCoder
    HerrimanCoder about 7 years
    Works for me. Mine had gotten switched to Build and Intellisense, which was hiding build errors. Build Only works and displays build errors.
  • I-A-N
    I-A-N about 7 years
    This solution worked for me. It happened to me once - no warnings were displayed. I opened the Error List window and rebuilt the solution. The warnings were displayed this time. I can't reproduce the same issue again even after restarting the VS.
  • MA9H
    MA9H almost 7 years
    You sir saved the day for me.. great job.. Thanks a lot
  • valverij
    valverij over 6 years
    This was beyond frustrating. Apparently the issue is still open in a different ticket: github.com/dotnet/roslyn/issues/19693
  • S52
    S52 over 6 years
    Perfect! Worked for me :)
  • Dux
    Dux almost 6 years
    This rather old question already has an accepted answer, it doesn't seem as if your very short and undescriptive answer here adds much to it. Also, please do not link to images on external sites but add the images to your answer!
  • Søren Boisen
    Søren Boisen over 5 years
    Wow, this is an amazingly dumb error to have in an IDE! I just experienced it in VS2017. No info in the build output and nothing in the error list. But switch from "Build + Intellisense" to "Build Only" and an error due to lack of cast of dynamic appears!
  • kselva
    kselva over 4 years
    it really works ... no need need restart and all.... before it was build+intellisence and i have changed to only intellisence
  • Chandraprakash
    Chandraprakash about 4 years
    Damn man, It was in Build+Intellisense for me, when i changed to Build Only i could see the errors popping up !! Thanks you !! You saved my day !
  • immutabl
    immutabl almost 4 years
    Thanks so much - this was driving me insane all afternoon :-)
  • Zi Cold
    Zi Cold over 3 years
    This solution worked for me (MS VS 2017). After all other solutions.
  • SQLServerSteve
    SQLServerSteve over 3 years
    This fix did the trick for me in VS 2019. I just wanted to point out that I mysteriously found 40 instances of MsBuild running in Task Manager at the time, all of which closed when all my open instances of VS were closed. I watch Task Manager routinely and saw nothing out of the ordinary shortly before the error occurred. This may be a clue to the underlying problem, whatever it is.
  • David Neuschulz
    David Neuschulz over 3 years
    I had a similar issue. I was running VS 2019 as administrator, When I finally tried running regularly, it worked. This was on a minimal VB HelloWorld app (1 form, 1 button, 1 label, that's all)