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 ==========
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:
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 usingWhereas, it should just be
It's not as pretty as I like, but it's the only way to go, apparently.
I had this problem and it turned out that I had a
using
pointing to an empty namespace. Removing thatusing
clause fixed the problemCheck 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.
Try this
Excluding
"mstscax.dll"
from the Dependencies worked for me.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:
For me this issue was related to a custom CodeAnalysis ruleset setting "IncludeAll".
It appears the Compiler observes this setting:
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.
This is potentially a problem with Intellisense not observing the IncludeAll option. See https://github.com/dotnet/roslyn/issues/7400