Skip to content

Bugfix/fix asp websites failing to resolve projects that depend on netstandard#12980

Closed
johnazule wants to merge 2 commits into
dotnet:mainfrom
johnazule:bugfix/fix-asp-websites-failing-to-resolve-projects-that-depend-on-netstandard
Closed

Bugfix/fix asp websites failing to resolve projects that depend on netstandard#12980
johnazule wants to merge 2 commits into
dotnet:mainfrom
johnazule:bugfix/fix-asp-websites-failing-to-resolve-projects-that-depend-on-netstandard

Conversation

@johnazule

Copy link
Copy Markdown
Contributor

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

@JanProvaznik JanProvaznik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@johnazule

Copy link
Copy Markdown
Contributor Author

TestSolution.zip
This is a small project which show cases the difference. This PR currently doesn't add in the netstandard.dll to the bin folder but otherwise it addresses the dependency issues

@johnazule johnazule force-pushed the bugfix/fix-asp-websites-failing-to-resolve-projects-that-depend-on-netstandard branch from f14ad00 to 0f99717 Compare January 9, 2026 13:37
@johnazule johnazule requested a review from JanProvaznik January 9, 2026 13:38
@johnazule johnazule force-pushed the bugfix/fix-asp-websites-failing-to-resolve-projects-that-depend-on-netstandard branch from 0f99717 to b6f9616 Compare January 12, 2026 04:16
@johnazule

Copy link
Copy Markdown
Contributor Author

@JanProvaznik does this minimal test solution show you what you needed?

@johnazule johnazule force-pushed the bugfix/fix-asp-websites-failing-to-resolve-projects-that-depend-on-netstandard branch from b6f9616 to bc87445 Compare January 15, 2026 00:04
@shadow7412

Copy link
Copy Markdown

What are the chances of this being merged?
We're running into some build errors in our build environment that would be resolved by this I'm pretty sure...

@johnazule

Copy link
Copy Markdown
Contributor Author

@rainersigwald could you give this a look?

@JanProvaznik JanProvaznik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@JanProvaznik

JanProvaznik commented Jan 19, 2026

Copy link
Copy Markdown
Member

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?

JanProvaznik added a commit to JanProvaznik/msbuild that referenced this pull request Jan 19, 2026
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

Copy link
Copy Markdown
Contributor Author

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

Jeremy Spedding added 2 commits January 20, 2026 09:53
I am unsure if this has undesirable performace implications
@JanProvaznik

Copy link
Copy Markdown
Member

superseded by #13058

JanProvaznik added a commit that referenced this pull request Apr 8, 2026
…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>
dfederm pushed a commit to dfederm/msbuild that referenced this pull request Apr 9, 2026
…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>
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.

ASP .Net Framework 4.8 webSITE cannot resolve assembly references for projects with dependency on netstandard2.0

3 participants