Visual Studio 2015 project builds failed but no errors

Visual StudioVisual Studio-2015BuildMsbuild

Visual Studio Problem Overview


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 ==========

Visual Studio Solutions


Solution 1 - Visual Studio

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 2 - Visual Studio

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 3 - Visual Studio

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 - Visual Studio

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

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

Solution 5 - Visual Studio

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.

Solution 6 - Visual Studio

Check all your project Framework versions, and make sure they're all the same, or at least that project A doesn't reference project B when project B's .NET Framework version is higher.

Solution 7 - Visual Studio

What happened by me was, changing the timezone on the computer to +5:30 and then changing it back -5:00 is what confused VS. When I restarted VS, it worked fine again.

Solution 8 - Visual Studio

I don't know whether I am the only one who is facing this problem.

In my case when I opened Visual Studio the timezone was in GMT+1:00, and the build was successful. Then I changed the timezone to GMT+5:30, and then without restarting the Visual Studio, I tried to run the application, but the build failed without any error or warning.

I changed back the timezone to GMT+1:00, and the build succeeded without any mistake.

Solution 9 - Visual Studio

I had this problem with VS2015 Update 3 RC and Xamarin (.Forms shared project).
Compiler don't stop, errors were only showed in the output window.
This only for Xamarin projects (with VB.NET projects all has worked as expected)...
To try find the reason for the problem, I have changed the Build Output in VS:

  • menu "Tools - Options"
  • from the left panel: "Projects And Solutions: Build And Run":
  • change "MSBuild Output Verbosity" from "Minimal" to "Diagnostic"

After doing that, the compiler has stopped and the error was showed..
After that, I have set the option back from "Diagnostic" to "Minimal" (like it was before) and... it has worked also with "Minimal" (to be sure, I also have restarted VS)...

So.. it seems (at least im my case) that only to change (touch) the setting (MSBuild Output Verbosity") has solved the problem and that this is a bug in VS and/or the Xamarin integration Software...

Solution 10 - Visual Studio

What I did (after all the above, and it still wasn't working) was go through all the bin folders and clear them all out (ie the referenced projects too).

This worked for me, hope it does for you too.

Solution 11 - Visual Studio

I had this problem and it turned out that I had a using pointing to an empty namespace. Removing that using clause fixed the problem

Solution 12 - Visual Studio

Check the warnings..

I had the new class library with target .Net Framework 4.5 while the referencing project was 4.0 which caused reference issue.

After modifying the class library with target .Net Framework 4.0 it worked correctly.

Solution 13 - Visual Studio

Nothing from the answers above helped to me. After many experiments I have finally found that the problem is a reference of Microsoft.Net.Compilers v2.10.0 in one of the projects. VS 2015 uses MSBuild v14 which does not support that version of Microsoft.Net.Compilers.

Solution 14 - Visual Studio

For me this issue was related to a custom CodeAnalysis ruleset setting "IncludeAll".

It appears the Compiler observes this setting:

  <IncludeAll Action="Error" />

But IntelliSense took the default ACTION on the Rule Id which was "Warning". This would explain the behavior seen by @RobertHarvey where you filter the output by Build Only and it shows as an ERROR, but if you filter by Intellisene Only it shows as WARNING. Filtering output by the default Build + Intellisense seems non-deterministic!

My fix was to explicitly call out the rule that i wanted to be a warning as a warning.

  <Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
    <Rule Id="CS0618" Action="Warning" />
  </Rules>

This is potentially a problem with Intellisense not observing the IncludeAll option. See https://github.com/dotnet/roslyn/issues/7400

Solution 15 - Visual Studio

This can also happen when migrating a project to Visual Studio 2015 with an older Framework. Check your Warnings in your Error List. You may see something like project is currently .NET version 2.0 and requires .NET 3.5 or higher. If you find a similar warning go to your project's properties and target the required .NET Framework.

Solution 16 - Visual Studio

Please check warnings. Sometimes build failed because of some kind of warnings too.

Solution 17 - Visual Studio

When open a solution, generate it, I can see some build errors or warnings reported in the "Output tab", while the "Error tab" does not report any problem.

enter image description here

You can see that the "Error tab" config is OK ("Build only" and "Entire solution" selected).

Note that, after a deep investigation, I identified that this only occurs only if the "Error tab" was not shown yet when you start the build!

If you activated the "Error tab" before doing the build (or if it was the current tab when you launched Visual), then newly found errors/warnings will show up correctly:

enter image description here

It's as if the "Error tab" is initialized only when it gets visible (which may be true as it takes more time to show up first time you click it...), and, if it was not, it does not gather build results...

So far, having no better answer to this problem than "activate the Error tab before building".

And I bet that's why "restarting VS" sometime works. You see the "Error tab" is empty, you close and repoen VS, then, "Error tab" is shown by default as VS restored the current active tab from previous session. You build and now the "Error tab" gets populated...! You just got lucky.

Note: Reported a VS bug: https://connect.microsoft.com/VisualStudio/feedback/details/3132689

Solution 18 - Visual Studio

For me the build failed without errors, but after some light investigation I found out that the refence to MSHTML wasn't found by VS.

enter image description here

The behavior appeared after an update to Windows 10. To fix it you need to register the assembly from the GAC. For how to do it, go to this answer https://stackoverflow.com/questions/31853699/mshtml-dll-on-windows-10/38871078#38871078 that's where I found my answer.

Solution 19 - Visual Studio

MSBuild.exe is changed in the directory (C:\Program Files (x86)\MSBuild\14.0\Bin)

so i just replace the MSBuild.exe from other pc which has vs2015.

Now it working fine.

Solution 20 - Visual Studio

Taken from this answer

> Compilation failed, no errors were showed in the output window. > > To try find the reason for the problem, I have changed the Build > Output in VS: > - menu "Tools - Options" > - from the left panel: "Projects And Solutions: Build And Run": > - change "MSBuild Output Verbosity" from "Minimal" to "Diagnostic"

After doing that, I found the real reason which was in fact a mistake with dependency projects. I project that I was depending on was built for different framework (newer) than mine. Thus creating the issue. The errors was only outputed when I put the Output Verbosity to Diagnostic

Solution 21 - Visual Studio

For me, it was a rogue attached property. The problem wasn't necessarily that I couldn't see an error; the error was the following:

> Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.

Initially, the build would hang and not show any errors unless you attempted to close Visual Studio. After restarting, it would hang for a long period upon building, then display the above message.

Deleting hidden .vs folder, rebuilding/cleaning solution, and restarting Visual Studio did not work. Removing the attached property did; ergo, it could be actual code somewhere that isn't working properly.

As a last resort, I would remove any recent changes one by one until the issue is resolved as none of the solutions here helped.

Update

Because I'm used to developing traditional WPF applications, I didn't realize you can't have "chained" XAML namespaces using .s with UWP. I was attempting to set an attached property using

My.Namespace:SomeClass.SomeProperty="SomeValue"

Whereas, it should just be

MyNamespace:SomeClass.SomeProperty="SomeValue"

It's not as pretty as I like, but it's the only way to go, apparently.

Solution 22 - Visual Studio

What worked for me:

Closing all documents solved the issue for me. (Same solution if intelliSense stops working)

(right click tab - Close All Documents)

Solution 23 - Visual Studio

Try this

Excluding "mstscax.dll" from the Dependencies worked for me.

Solution 24 - Visual Studio

Niche issue: I ran into the same issue just now. None of the answers above seemed to help.

Issue was for a Console program, one cannot mark the Main() method as async** which is what I was doing. Not sure, why Visual Studio could not specify why exactly the project was not building (I got 0 errors and 0 warnings every time). I am using Visual Studio 2015 Enterprise.

Fix: The work around for that is here.

Solution 25 - Visual Studio

After updating a dll file, it turned out that the new file was targeting a higher verion of .NET Framework. The solution was to go to Project Properties and change the Target framework to the appropriate version.

Solution 26 - Visual Studio

I found solution by changing .NET Framework from 4.5.2 to 4.0.

Problem was caused by reference that was not compatible with currently selected framework.

Solution 27 - Visual Studio

I just cleared my filters and it worked for me.The clear all filters icon is near the messages box .

Solution 28 - Visual Studio

Start a new project. Copy all of your code up to below namespace ConsoleApp38450983450.

Paste into new project below namespace ScrewedUpConsoleApp102343

Build and run perfect

Solution 29 - Visual Studio

In my case this was caused by a path to a filename which was too long for Windows. I found it by reverting to a previous version in git.

Solution 30 - Visual Studio

You should set the combobox at right side under error list, on 'Entire Solution' to see all errors.enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRob GreenleeView Question on Stackoverflow
Solution 1 - Visual StudioS.Mohamed Mahdi Ahmadian zadehView Answer on Stackoverflow
Solution 2 - Visual StudioCarson EvansView Answer on Stackoverflow
Solution 3 - Visual StudioKeithView Answer on Stackoverflow
Solution 4 - Visual StudioMike AsdfView Answer on Stackoverflow
Solution 5 - Visual StudioClaudiu ConstantinView Answer on Stackoverflow
Solution 6 - Visual StudioDaniel MinnaarView Answer on Stackoverflow
Solution 7 - Visual StudioM BView Answer on Stackoverflow
Solution 8 - Visual StudioRudresha ParameshappaView Answer on Stackoverflow
Solution 9 - Visual StudioFredyWengerView Answer on Stackoverflow
Solution 10 - Visual StudioRodney EllisView Answer on Stackoverflow
Solution 11 - Visual StudioPhate01View Answer on Stackoverflow
Solution 12 - Visual StudiogyansadaView Answer on Stackoverflow
Solution 13 - Visual StudioPetar PetrovView Answer on Stackoverflow
Solution 14 - Visual StudiofelickzView Answer on Stackoverflow
Solution 15 - Visual StudioTyriddikView Answer on Stackoverflow
Solution 16 - Visual StudioKrishView Answer on Stackoverflow
Solution 17 - Visual Studiojpo38View Answer on Stackoverflow
Solution 18 - Visual StudioFidView Answer on Stackoverflow
Solution 19 - Visual StudiosabarishView Answer on Stackoverflow
Solution 20 - Visual StudioJohn DemetriouView Answer on Stackoverflow
Solution 21 - Visual Studiouser1618054View Answer on Stackoverflow
Solution 22 - Visual StudioZiv WeissmanView Answer on Stackoverflow
Solution 23 - Visual StudioEmile CloeteView Answer on Stackoverflow
Solution 24 - Visual Studiouser3613932View Answer on Stackoverflow
Solution 25 - Visual StudiousefulBeeView Answer on Stackoverflow
Solution 26 - Visual StudioStefan ĐorđevićView Answer on Stackoverflow
Solution 27 - Visual StudioNevin joseView Answer on Stackoverflow
Solution 28 - Visual StudioBrandon NorrisView Answer on Stackoverflow
Solution 29 - Visual StudioSegoView Answer on Stackoverflow
Solution 30 - Visual StudioMilad KoudarziView Answer on Stackoverflow