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 Microsoft.NETCore.App is an implicit dependency for publish. #2881

Merged
merged 2 commits into from
Feb 13, 2019

Conversation

peterhuene
Copy link
Contributor

@peterhuene peterhuene commented Jan 29, 2019

This commit ensures that we exclude files from the Microsoft.NETCore.App
platform library on publish when the platform library is
Microsoft.AspNetCore.App, which doesn't have an explicit dependency on
Microsoft.NETCore.App.

When publishing a 2.x ASP.NET application, the MicrosoftNETPlatformLibrary
property gets changed by ASP.NET to Microsoft.AspNetCore.App. This causes
the task responsible for determining what files to copy locally to treat files
from Microsoft.NETCore.App and its dependencies as not being part of the
platform.

However, when publishing the application as framework-dependent, almost all the
platform files get excluded thanks to conflict resolution which has the files
as part of the platform manifest and preferred packages. Unfortunately, the
apphost, hostpolicy, and hostfxr files are not part of these lists and as a
result will be copied locally.

This breaks framework-dependent apphost activation because hostfxr and
hostpolicy are copied locally. Additionally, these files end up in the
deps.json file which also prevents roll-forward activation if the two files are
manually deleted.

The fix is to treat Microsoft.NETCore.App as an implicit dependency of
Microsoft.AspNetCore.App where we calculate the list of excluded packages for
a framework-dependent publish.

Fixes dotnet/cli#10602.

@peterhuene peterhuene added this to the 2.2.1xx milestone Jan 29, 2019
@peterhuene peterhuene requested review from dsplaisted and a team January 29, 2019 18:19
@peterhuene peterhuene changed the title Implement a fix for detecting conflicts with MS.NETCore.DotNetHost* files. [WIP] Implement a fix for detecting conflicts with MS.NETCore.DotNetHost* files. Jan 29, 2019
@peterhuene
Copy link
Contributor Author

peterhuene commented Jan 29, 2019

Marking WIP as this needs approval.

@livarcocc I'm not marking this or the original issue as servicing consider until the fix is reviewed and we're happy with it.

@nguerrera
Copy link
Contributor

I did not review in detail, but can we not consider that there is an implicit dependency from Microsoft.AspNetCore.App to Microsoft.NETCore.App?

I don't understand why this requires hard-coding of file versions, etc.

This commit ensures that we exclude files from the `Microsoft.NETCore.App`
platform library on publish when the platform library is
`Microsoft.AspNetCore.App`, which doesn't have an explicit dependency on
`Microsoft.NETCore.App`.

When publishing a 2.x ASP.NET application, the `MicrosoftNETPlatformLibrary`
property gets changed by ASP.NET to `Microsoft.AspNetCore.App`.  This causes
the task responsible for determining what files to copy locally to treat files
from `Microsoft.NETCore.App` and its dependencies as not being part of the
platform.

However, when publishing the application as framework-dependent, almost all the
platform files get excluded thanks to conflict resolution which has the files
as part of the platform manifest and preferred packages.  Unfortunately, the
apphost, hostpolicy, and hostfxr files are not part of these lists and as a
result will be copied locally.

This breaks framework-dependent apphost activation because hostfxr and
hostpolicy are copied locally.  Additionally, these files end up in the
deps.json file which also prevents roll-forward activation if the two files are
manually deleted.

The fix is to treat `Microsoft.NETCore.App` as an implicit dependency of
`Microsoft.AspNetCore.App` where we calculate the list of excluded packages for
a framework-dependent publish.

Fixes dotnet/cli#10602.
@peterhuene peterhuene force-pushed the fix-conflict-detection branch from e210d39 to db1d373 Compare January 29, 2019 22:53
@peterhuene peterhuene changed the title [WIP] Implement a fix for detecting conflicts with MS.NETCore.DotNetHost* files. [WIP] Ensure Microsoft.NETCore.App is an implicit dependency for publish. Jan 29, 2019
… lib names.

This commit treats `Microsoft.NETCore.App` as an implicit dependency for any
platform library name, allowing the fix to work for both `Microsoft.AspNet.App`
and `Microsoft.AspNet.All`.
@livarcocc
Copy link
Contributor

@peterhuene let me know when this is ready for shiproom.

@peterhuene
Copy link
Contributor Author

@livarcocc I think it's ready. I'll try to be available for the next shiproom to help defend, but I may have to do so from my TEALS class.

@livarcocc
Copy link
Contributor

@peterhuene don't worry. I will talk to you tomorrow morning and get the information I need. Don't worry about it when you are in class.

@peterhuene peterhuene changed the title [WIP] Ensure Microsoft.NETCore.App is an implicit dependency for publish. Ensure Microsoft.NETCore.App is an implicit dependency for publish. Jan 31, 2019
@peterhuene
Copy link
Contributor Author

This has been approved but is waiting for the branch to open for the appropriate release before merging.

@peterhuene
Copy link
Contributor Author

As the 2.2.1xx branch is now open for the next release, I'm merging this.

@peterhuene peterhuene merged commit 0b99559 into dotnet:release/2.2.1xx Feb 13, 2019
@peterhuene peterhuene deleted the fix-conflict-detection branch February 13, 2019 05:21
dsplaisted pushed a commit to dsplaisted/sdk that referenced this pull request Feb 19, 2020
….10 (dotnet#2881)

- Microsoft.DotNet.Cli.Runtime - 3.1.100-preview1.19463.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants