Skip to content

Fix ASP.NET WebSite projects to copy netstandard.dll facade when required#13058

Merged
JanProvaznik merged 18 commits into
dotnet:mainfrom
JanProvaznik:fix/aspnet-website-netstandard-facades
Apr 8, 2026
Merged

Fix ASP.NET WebSite projects to copy netstandard.dll facade when required#13058
JanProvaznik merged 18 commits into
dotnet:mainfrom
JanProvaznik:fix/aspnet-website-netstandard-facades

Conversation

@JanProvaznik

Copy link
Copy Markdown
Member

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

  • Build ASP.NET WebSite project referencing netstandard2.0 library
  • Verify netstandard.dll is copied to website/Bin folder
  • Verify build succeeds (aspnet_compiler passes)
  • Run SolutionProjectGenerator unit tests (160 passed, 0 failed)

Jeremy Spedding and others added 4 commits January 15, 2026 11:04
I am unsure if this has undesirable performace implications
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>
@johnazule

johnazule commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

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

Comment thread src/Build/Construction/Solution/SolutionProjectGenerator.cs Outdated
…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.
@JanProvaznik JanProvaznik self-assigned this Feb 2, 2026
@JanProvaznik JanProvaznik marked this pull request as ready for review February 2, 2026 16:35
Copilot AI review requested due to automatic review settings February 2, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/Build/Construction/Solution/SolutionProjectGenerator.cs Outdated
Comment thread src/Tasks/AspNetCompiler.cs Outdated
- Add try-catch around FrameworkName constructor to handle malformed monikers
- Remove unrelated -errorstack switch from AspNetCompiler
@JanProvaznik

Copy link
Copy Markdown
Member Author

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 -errorstack is a fine idea for subsequent pr and the rest you proposed I don't think I want to merge unless I see a very good case for it.

@johnazule

Copy link
Copy Markdown
Contributor

@JanProvaznik sorry about the delay, got caught up at work. This looks good! I am happy for it to merge

@johnazule johnazule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think this will do everything I need it to

@JanProvaznik JanProvaznik requested a review from a team February 5, 2026 09:52
@johnazule

Copy link
Copy Markdown
Contributor

@JanProvaznik is the review you requested an internal team I don't have access to? All links to the reviewer seem invalid

@JanProvaznik

Copy link
Copy Markdown
Member Author

yes, it's internal, sorry for delays

This was referenced Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants