-
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
Resolve assets from targeting pack #2774
Conversation
5a2360c
to
e0a899d
Compare
TODO: Need to add an implicit reference to the Platforms package which brings in the RID graph. Currently, this is being brought in as a package dependency of Microsoft.NETCore.App (even though we are excluding all assets from it). When we resolve to an installed targeting pack, we won't have this package reference, so we'll need to implicitly reference the Platforms package. Once we do dotnet/cli#10528 or pass the runtime graph to NuGet via NuGet/Home#7351, then we can remove the implicit Platforms package reference. EDIT: Done |
TODO: Before merging this PR, it would be nice to use a runtime.json that's bundled in dotnet/core-sdk (dotnet/cli#10104) instead of the copied version that's included in this PR. EDIT: Done |
e0a899d
to
a522481
Compare
a522481
to
4303b79
Compare
@peterhuene I could especially use your review of the changes to the apphost logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM regarding the apphost changes and my feedback has been addressed.
I'll let Nick also sign off on this since he had additional comments.
+1 on keeping |
@nguerrera Thanks a lot, I was able to repro the failure. I was able to run the app successfully through the apphost by setting the I'm not sure what the typical workflow is in this repo, but I think we should fix the Overall this behavior is by design, at least for now. There are discussions about improvements in this area (make it so that |
Hmm. We are currently setting DOTNET_ROOT in dotnet run pending those discussions. Also, I tried running the dll with custom dotnet directly. The error message is looking for hostpolicy in the correct custom location but the wrong shared framework. So I'm confused. I will double check all of the above. |
As far as workflow, I:
Dogfood.cmd causes the build to use tasks and targets from the build of this repo. Sdk-build-env is just for building the repo, it will use tasks and targets from the "stage 0" / lkg the build downloaded. I will make both of these set DOTNET_ROOT and write a doc on how they work, but I'm nearly certain this is a red herring. I won't be sure until I get to the office and retry my steps above. |
Thanks for the description @nguerrera . I think I finally got the repro of the problem you're referring to... looking into it. |
It's a bug in |
Is putting Microsoft.NETCore.App last a reasonable workaround? We could do that. |
I filed https://github.com/dotnet/core-setup/issues/4947 as a tracking issue. Talking to @dsplaisted, sounds like a better workaround for now is not to write out netcoreapp at all when referencing one of the higher frameworks that will chain it in is referenced. |
Either should work (putting it last, or omitting completely). |
@nguerrera @peterhuene @livarcocc I've added some more commits here, and this is ready for "final" review before merging :-) Note that I copied in an ASP.NET Core target from Microsoft.AspNetCore.App. Per discussion with @natemcmaster, that functionality might be used in a unit test project which doesn't directly use the Web SDK. So he suggests we put it in the base SDK. |
or earlier was referenced as a package. This didn't use the AssemblyAttribute item group, so we cannot | ||
avoid duplicate AssemblyAttribute items without skipping this target altogether.. | ||
--> | ||
<Target Name="_GetUserSecretsAssemblyAttribute" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we condition this target to only run when Microsoft.AspNetCore.App is referenced? If that targeting pack isn't reference, generated code may not compile since Microsoft.Extensions.Configuration.UserSecrets.UserSecretsIdAttribute would be undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that since you have to set the UserSecretsId
property to enable this, it's probably not necessary to restrict this target to projects having an ASP.NET framework reference. If for some reason you want to set UserSecretsId
without having it generate the attribute (e.g. if you aren't referencing ASP.NET), then you can always set GenerateUserSecretsAttribute
to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…build 20190909.7 (#2774) - Microsoft.NET.Sdk.Razor - 3.1.0-alpha1.19459.7
First steps for dotnet/cli#10085
KnownFrameworkReference
to Microsoft.NETCore.App, and includes the RID graph directly. These will need to be added to core-sdkKnownFrameworkReference
, and the RIDs available, will also need to be supplied by core-sdk