Fix ASP.NET WebSite projects to copy netstandard.dll facade when required#13058
Conversation
I am unsure if this has undesirable performace implications
…solve-projects-that-depend-on-netstandard
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>
|
We probably want to add SkipUnchangedFiles to this copy, as this current implementation will copy the facades folder for every project reference that depends on netstandard |
…ard fix - Wrap all new behavior behind ChangeWave 18.5 for safe opt-out - Only pass TargetFrameworkVersion for .NET Framework 4.7.1+ (which has netstandard facades) - Preserve existing MSB3268 warnings for older frameworks (<4.7.1) - Add WebConfigFileName property for AppConfigFile parameter - Add SkipUnchangedFiles to Copy tasks for efficiency - Add -errorstack to AspNetCompiler when Debug=true - Update ChangeWaves.md documentation Tested scenarios: - 4.8.1 target: ClassLib.dll + netstandard.dll copied, no warnings - 4.6.2 target: Warnings preserved (no facade available) Fixes dotnet#12933
Pass Clean=true to AspNetCompiler when building with Rebuild target, enabling the -c flag for full recompilation of previously compiled components.
Required for the ASP.NET netstandard fix feature gate.
There was a problem hiding this comment.
Pull request overview
This PR extends PR #12980 to complete the fix for issue #12933, which addresses ASP.NET Framework 4.8 WebSite projects' inability to resolve assembly references for projects with dependencies on netstandard2.0.
Changes:
- Captures RAR's DependsOnNETStandard output property to detect when project dependencies require netstandard.dll
- Adds conditional copying of netstandard.dll from the .NET Framework Facades folder when the project depends on netstandard and targets .NET Framework 4.7.1+
- Adds -errorstack flag to AspNetCompiler debug mode for enhanced error diagnostics
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Tasks/AspNetCompiler.cs | Adds -errorstack switch to debug mode for enhanced error reporting |
| src/Build/Construction/Solution/SolutionProjectGenerator.cs | Implements netstandard.dll facade copying logic with ChangeWave gating, captures DependsOnNETStandard property, and adds web.config path support |
| documentation/wiki/ChangeWaves.md | Documents the Wave18_5 change for ASP.NET WebSite netstandard dependency resolution |
- Add try-catch around FrameworkName constructor to handle malformed monikers - Remove unrelated -errorstack switch from AspNetCompiler
|
I played with it a bunch and converged on this @johnazule .would you be happy if this was merged? Or is there more that's not working with your Solution? The |
|
@JanProvaznik sorry about the delay, got caught up at work. This looks good! I am happy for it to merge |
johnazule
left a comment
There was a problem hiding this comment.
Looks good! I think this will do everything I need it to
|
@JanProvaznik is the review you requested an internal team I don't have access to? All links to the reviewer seem invalid |
|
yes, it's internal, sorry for delays |
Summary
This is a minimal extension to PR #12980 that completes the fix for issue #12933.
Test plan