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

Run _CheckForInvalidConfigurationAndPlatform in design-time builds #1657

Closed

Conversation

dsplaisted
Copy link
Member

Should fix the VS side of dotnet/sdk#798

The targets which currently get run as part of _CheckForInvalidConfigurationAndPlatform are:

  • _CheckForUnsupportedTargetFramework
  • CheckForDuplicateItems
  • _CheckForInvalidConfigurationAndPlatform
  • CheckForImplicitPackageReferenceOverrides

Copy link
Member

@davkean davkean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a complete fix - design-time builds are more than compile. Basically any target can run as a design-time build if there's a rule for it.

@davkean
Copy link
Member

davkean commented Feb 28, 2017

I'm not convinced their change to drop this target from being included in InitialTargets was a wise one, I think we've probably just regressed legacy.

@dsplaisted
Copy link
Member Author

Yes, after testing this I'm not sure whether we should try fixing this by changing the design time targets. The targets that are run by the project system when I try it out are:

  • CollectResolvedSDKReferencesDesignTime
  • CollectPackageReferences
  • ResolveComReferencesDesignTime
  • ResolveProjectReferencesDesignTime
  • ResolveAssemblyReferencesDesignTime
  • CollectSDKReferencesDesignTime
  • ResolvePackageDependenciesDesignTime
  • CompileDesignTime

Rather than make all of these targets depend on _CheckForInvalidConfigurationAndPlatform, a simpler solution is to modify the _CheckForUnsupportedTargetFramework target to run before GetReferenceAssemblyPaths.

@davkean
Copy link
Member

davkean commented Feb 28, 2017

I think the better change is to switch it back to being a initial target.

@davkean
Copy link
Member

davkean commented Mar 14, 2017

Going to close this PR - ping me if you still think this is the right approach, instead of adding it back to initial targets.

@davkean davkean closed this Mar 14, 2017
@davkean
Copy link
Member

davkean commented Mar 14, 2017

Side note, this still isn't all the design-time targets - any target can be a design-time target when using the MSBuild single file generator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants