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

Ensure that MSBuildProjectSystem doesn't add project references twice #815

Merged
merged 2 commits into from
Apr 6, 2017

Conversation

DustinCampbell
Copy link
Contributor

@DustinCampbell DustinCampbell commented Apr 6, 2017

Fixes #795

It's possible for project references to appear twice within an MSBuild project after execution:

  • As a ProjectReference item
  • As a ReferencePath item with ReferenceSourceTarget="ProjectReference"

This change makes sure that ReferencePath items that were sourced from project references aren't added. We just use the project references, which is a better experience at designtime when the project is built.

Note: There was code that used to do this, but it was unintentionally removed in a refactoring a few months ago (by me -- oops!): ef4b383.

It's possible for project references to appear twice within an MSBuild project after execution:

* As a ProjectReference item
* As a ReferencePath item with ReferenceSourceTarget="ProjectReference"

This change makes sure that ReferencePath items that were sourced from project references aren't added. We just use the project references, which is a better experience at designtime when the project is built.
@filipw
Copy link
Member

filipw commented Apr 6, 2017

have you thought of publishing all this MSBuild-related code as a nuget package?

For example I would like to use something like that in other projects - being able to go from csproj to everything needed to create a CSharpCompilation/describing the project (some kind of a replacement for https://www.nuget.org/packages/Microsoft.DotNet.ProjectModel)

@DustinCampbell
Copy link
Contributor Author

have you thought of publishing all this MSBuild-related code as a nuget package?

Probably not. We already have that in Roslyn with the MSBuildProjectLoader. It just doesn't work with the latest MSBuild and isn't portable. However, it's looking likely that I'll be called upon to fix that.

@filipw
Copy link
Member

filipw commented Apr 6, 2017

oh that's what I've been missing. Is it part of any of the Roslyn nuget packages?

@DustinCampbell
Copy link
Contributor Author

Sure, but it's only available on desktop: https://www.nuget.org/packages/Microsoft.CodeAnalysis.Workspaces.Common/.

The API sits next to MSBuildWorkspace.

@filipw
Copy link
Member

filipw commented Apr 6, 2017

thanks!

@DustinCampbell DustinCampbell merged commit 402f921 into OmniSharp:dev Apr 6, 2017
@DustinCampbell DustinCampbell deleted the fix-project-refs branch April 6, 2017 13:25
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.

2 participants