You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason the design-time builds were failing is because it is trying to run ApiCompat checks on net461 and net472, but I haven't built for those TFMs.
C:\Users\eerhardt\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20109.1\build\Microsoft.DotNet.ApiCompat.targets(51,5): ResolvedMatchingContract 'F:\git\runtime2\artifacts\bin\System.Configuration.ConfigurationManager\ref\net461-Debug\System.Configuration.ConfigurationManager.dll' did not exist. [F:\git\runtime2\src\libraries\System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj]
I suspect that the VS project-system isn't expecting those design-time builds to fail. And when they do, there are cases where VS thinks that the project doesn't contain any output items. I turned on the "Up to date" logging, and noticed that:
1>FastUpToDate: No build outputs defined. (System.Configuration.ConfigurationManager)
1>FastUpToDate: Project is up to date. (System.Configuration.ConfigurationManager)
1>FastUpToDate: Up to date check completed in 0.5 ms (System.Configuration.ConfigurationManager)
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
@davkean - Does VS expect those design-time builds to fail? Would this be the reason why it thinks there are No build outputs defined.?
One option here is to not run ApiCompat during a design-time build. There may be other options to fixing this as well. But I wouldn't expect developers to have to build for all TFMs before they can use VS.
Targets that run during design-time builds need to have correct dependencies. A target has a implicit assumption that the project is built before running, which is a bad assumption.
I also believe that it doesn't really provide much value to try to run it on design-time builds, so it would be better to just skip it on design time builds
When opening the
System.Configuration.ConfigurationManager
project in VS, I was noticing that thesrc
project wasn't getting built.Digging into the design-time builds, it appears some of them are failing:
The reason the design-time builds were failing is because it is trying to run
ApiCompat
checks onnet461
andnet472
, but I haven't built for those TFMs.C:\Users\eerhardt\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20109.1\build\Microsoft.DotNet.ApiCompat.targets(51,5): ResolvedMatchingContract 'F:\git\runtime2\artifacts\bin\System.Configuration.ConfigurationManager\ref\net461-Debug\System.Configuration.ConfigurationManager.dll' did not exist. [F:\git\runtime2\src\libraries\System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj]
I suspect that the VS project-system isn't expecting those design-time builds to fail. And when they do, there are cases where VS thinks that the project doesn't contain any output items. I turned on the "Up to date" logging, and noticed that:
@davkean - Does VS expect those design-time builds to fail? Would this be the reason why it thinks there are
No build outputs defined.
?One option here is to not run ApiCompat during a design-time build. There may be other options to fixing this as well. But I wouldn't expect developers to have to build for all TFMs before they can use VS.
/cc @joperezr @Anipik @safern
The text was updated successfully, but these errors were encountered: