-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Setting PreserveCompilationContext=false trims Microsoft.AspNetCore.App shared runtime in deps files #2092
Comments
From @pranavkm on March 26, 2018 17:57 Spoke to @eerhardt, the missing shared runtime isn't necessarily the cause for concern here - a console app's deps file also does not include a reference to the shared runtime cc @rynowak \ @steveharter \ @mkArtakMSFT |
Looking more, the The issue is that the |
See sdk/src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs Lines 63 to 66 in 935ac5f
PlatformLibrary s get trimmed.
|
@dsplaisted please take a look. |
Some more thoughts about this: Assuming the plan is to preserve the "Dependency" entries, even when the Platform library is trimmed:
|
Stepping back, the primary driver for turning off // Microsoft.NET.Sdk.Razor.targets
<!-- Use PreserveCompilationContext's value if it was explicitly set in the user's project -->
<PreserveCompilationReferences Condition="'$(PreserveCompilationContext)' != ''">$(PreserveCompilationContext)</PreserveCompilationReferences>
<!-- Initialize PreserveCompilationContext -->
<PreserveCompilationReferences Condition="'$(PreserveCompilationReferences )' == ''">true</PreserveCompilationReferences> Targets in Microsoft.NET.Sdk that control publishing would be modified to rely on this new switch: sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PreserveCompilationContext.targets Lines 45 to 46 in 6945e36
sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PreserveCompilationContext.targets Lines 84 to 85 in 6945e36
It's a breaking change for users relying on the refs directory in non-web scenarios, but I'm not sure if that's a common scenario. |
Duplicate of #2122 |
Going with #2092 (comment), which is tracked by #2122. |
…202.4 (#2092) [main] Update dependencies from dotnet/arcade
From @pranavkm on March 26, 2018 17:18
Steps to reproduce
The generated deps file will say that the application references both
Microsoft.NETCore.App
andMicrosoft.AspNetCore.App
:<PreserveCompilationContext>false</PreserveCompilationContext>
. Rebuild the projectMicrosoft.AspNetCore.App
:Environment data
More information:
The bulk of MVC's controller discovery model is based on finding libraries that directly or transitively depend on any one of Mvc's libraries. In 2.1.0-preview2, the Razor.Sdk only sets
PreserveCompilationContext=true
if the app has any files that require runtime compilation. For projects without views, such as webapi or empty web template, the produced deps file claims that the app does not referenceMicrosoft.AspNetCore.App
->Microsoft.AspNetCore.Mvc
. Consequently no controllers are discovered.Copied from original issue: dotnet/core-setup#3902
The text was updated successfully, but these errors were encountered: