Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building in VS doesn't build the src project #32146

Closed
eerhardt opened this issue Feb 11, 2020 · 4 comments
Closed

Building in VS doesn't build the src project #32146

eerhardt opened this issue Feb 11, 2020 · 4 comments

Comments

@eerhardt
Copy link
Member

When opening the System.Configuration.ConfigurationManager project in VS, I was noticing that the src project wasn't getting built.

image

Digging into the design-time builds, it appears some of them are failing:

Project    Project    Dimensions    Targets    Type    Start    Elapsed    Status
System.Configuration.ConfigurationManager    .csproj    Debug|AnyCPU|net461    CollectUpToDateCheckBuiltDesignTime;CollectPackageDownloads;ResolveAssemblyReferencesDesignTime;CollectAnalyzersDesignTime;CollectSDKReferencesDesignTime;CollectUpToDateCheckInputDesignTime;CollectUpToDateCheckOutputDesignTime;ResolvePackageDependenciesDesignTime;CompileDesignTime;CollectResolvedCompilationReferencesDesignTime    DesignTimeBuild    2020-02-11T15:49:35        Failed
System.Configuration.ConfigurationManager    .csproj    Debug|AnyCPU|net472    CollectUpToDateCheckBuiltDesignTime;CollectPackageDownloads;ResolveAssemblyReferencesDesignTime;CollectAnalyzersDesignTime;CollectSDKReferencesDesignTime;CollectUpToDateCheckInputDesignTime;CollectUpToDateCheckOutputDesignTime;ResolvePackageDependenciesDesignTime;CompileDesignTime;CollectResolvedCompilationReferencesDesignTime    DesignTimeBuild    2020-02-11T15:49:35        Failed

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.

/cc @joperezr @Anipik @safern

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Feb 11, 2020
@davkean
Copy link
Member

davkean commented Feb 11, 2020

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.

@joperezr
Copy link
Member

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

@davkean
Copy link
Member

davkean commented Feb 12, 2020

@safern safern removed the untriaged New issue has not been triaged by the area owner label Feb 12, 2020
@ViktorHofer
Copy link
Member

Fixed by dotnet/arcade#4829

@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants