Skip to content

Make publish work for desktop projects - #240

Merged
nguerrera merged 1 commit into
masterfrom
desktop-publish
Oct 11, 2016
Merged

nguerrera merged 1 commit into
masterfrom
desktop-publish

Conversation

@nguerrera

@nguerrera nguerrera commented Oct 11, 2016 •

Copy link
Copy Markdown
Contributor
  • Always generate deps file if PreserveCompilationContext=true

This is where we're hoping to land,, but it's still different from the embedded desktop file used in project.json builds. We should decide today with the MVC folks if we're going to match the old behavior or stick with the new approach, which is more consistent across platforms. I'll follow up with a separate change once we make a final decision on this.

Fix #111
Fix #119

  • Normalize and dedup paths to publish

This is a workaround for an issue where we were trying to copy the same file passed twice in Copy Task SourceFiles to one DestinationFile. I think it's fine to be defensive because it's really easy to end up with duplicates in the half dozen or so different items that can end up in this list.

With that said, I think I finally found the root cause of the duplication just now so I could likely get away with fixing only that and reverting the normalization and deduping. My preference, however. would be to keep the deduping regardless.

@eerhardt @dotnet/project-system

</_ResolvedFileToPublish>
</ItemGroup>

<RemoveDuplicates Inputs="@(_ResolvedFileToPublish)">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure this is correct for a few reasons. From MSDN https://msdn.microsoft.com/en-us/library/ms164300.aspx:

This task is case insensitive and does not compare item metadata when determining duplicates.

  1. 'case insensitive' on a case sensitive file system may be a problem.
  2. 'does not compare item metadata' - What happens when there are multiple files with different "RelativePath" metadata? Does the first win?

Why is this needed at all? Who is adding the same file multiple times? Is it ResolvedAssembliesToPublish?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll get to the root of it and remove the de-duping here. I'll leave the Path.GetFullPath normalizing because that was a red herring that cost me a bunch of time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. We no longer use RemoveDuplicates blindly across everything.

- Normalize paths to publish and deal with copy-local overlap
- Always generate deps file if PreserveCompilationContext=true
@nguerrera

Copy link
Copy Markdown
Contributor Author

@eerhardt The duplication was caused by lock file assemblies being copylocal by default on desktop. There was a collision between adding the copylocal assemblies to resolve list and what we discover in ResolvePublishAssemblies. We now handle just those two overlapping with a simple Exclude (thanks for the suggestion offiline) and ResolvePublishAssemblies wins.

@eerhardt

Copy link
Copy Markdown
Member

:shipit:

@nguerrera
nguerrera merged commit c9cd2a7 into master Oct 11, 2016
@nguerrera
nguerrera deleted the desktop-publish branch October 11, 2016 19:47
mmitche pushed a commit to mmitche/sdk that referenced this pull request Jun 5, 2020
…ng-directory

Set default run working directory to project directory.
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.

Scenario: enable web apps targeting desktop frameworks Add .deps.json file for desktop web apps when PreserveCompilationContext = true

2 participants