Bugfix/fix asp websites failing to resolve projects that depend on netstandard#12980
Conversation
JanProvaznik
left a comment
There was a problem hiding this comment.
could you please provide a minimal demo which this change fixes? I don't think it's necessary to add a unit test but I'd like to see the scenario and have clear evidence it's fixed with the change.
|
TestSolution.zip |
f14ad00 to
0f99717
Compare
0f99717 to
b6f9616
Compare
|
@JanProvaznik does this minimal test solution show you what you needed? |
b6f9616 to
bc87445
Compare
|
What are the chances of this being merged? |
|
@rainersigwald could you give this a look? |
There was a problem hiding this comment.
sorry for ghosting - vacation... I tried to understand the scenario and looked at the demo; this change looks reasonable, now the resolution works and the library targeting netstandard is copied.
However it does not solve your issue right? The aspnet_compiler also needs the netstandard.dll which is not present.
|
A possible solution is to copy the netstandard.dll from Facades folder when it's required. I managed to build the example with that edit. @rainersigwald is that a reasonable approach? |
ASP.NET WebSite projects (legacy, no .csproj) that reference netstandard2.0 libraries fail at runtime because netstandard.dll is not copied to the bin folder. This extends PR dotnet#12980 by: 1. Capturing RAR's DependsOnNETStandard output property 2. Copying netstandard.dll from the Facades folder when needed The fix only applies to .NET Framework 4.7.1+ where netstandard facades are available in the Reference Assemblies Facades folder. Fixes dotnet#12933 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
All good, your PR looks good, I had something similiar in my first approach. The only problem is that this will copy for the facades folder for every project that depends on netstandard so we probably want preserve newest on the copy. I'll add my suggestion to your PR |
I am unsure if this has undesirable performace implications
b5161c2 to
375552c
Compare
|
superseded by #13058 |
…ired (#13058) ## Summary - Captures RAR's DependsOnNETStandard output property - Copies netstandard.dll from the Facades folder when the project depends on netstandard This is a minimal extension to PR #12980 that completes the fix for issue #12933. ## Test plan - [x] Build ASP.NET WebSite project referencing netstandard2.0 library - [x] Verify netstandard.dll is copied to website/Bin folder - [x] Verify build succeeds (aspnet_compiler passes) - [x] Run SolutionProjectGenerator unit tests (160 passed, 0 failed) --------- Co-authored-by: johnazule <126243662+johnazule@users.noreply.github.com>
…ired (dotnet#13058) ## Summary - Captures RAR's DependsOnNETStandard output property - Copies netstandard.dll from the Facades folder when the project depends on netstandard This is a minimal extension to PR dotnet#12980 that completes the fix for issue dotnet#12933. ## Test plan - [x] Build ASP.NET WebSite project referencing netstandard2.0 library - [x] Verify netstandard.dll is copied to website/Bin folder - [x] Verify build succeeds (aspnet_compiler passes) - [x] Run SolutionProjectGenerator unit tests (160 passed, 0 failed) --------- Co-authored-by: johnazule <126243662+johnazule@users.noreply.github.com>
Fixes #12933
Context
Currently we don't provide a target framework version when generating metaprojects for asp websites, which leads reference table to assume that the framework version is 4.6.0, which apparently does not contain a reference for netstandard2.0.
Changes Made
Add a TargetFrameworkVersion based on the provided target framework moniker