Stack Overflow in ReferenceResolver.cs when web project references WPF library
See original GitHub issueThis was filed as microsoft/msbuild#4560, but the proximate cause of the failure is here, as described below.
Describe the bug
Using .NET Core SDK 3.0.100-preview7, when a web project references a library that uses WPF, the build fails with a stack overflow (and very little information).
To Reproduce
Steps to reproduce the behavior:
- Using .NET Core SDK 3.0.0-preview8-27919-09 (also reported on public preview7)
- Build the attached zip with
dotnet build WebApp\WebApp.csproj
$ dotnet build
Microsoft (R) Build Engine version 16.3.0-preview-19369-03+db6ae5a0d for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 84.2 ms for S:\repro\microsoft\msbuild\issues\4560\WebApp\WebApp.csproj.
You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
LibWithWpf -> S:\repro\microsoft\msbuild\issues\4560\LibWithWpf\bin\Debug\netcoreapp3.0\LibWithWpf.dll
Stack overflow.
Expected behavior
Successful build or actionable error.
Additional context
I caught this in the debugger and found that it’s recursing at
I added a tracepoint to indicate what is being resolved and got this: https://gist.github.com/rainersigwald/791d5ead4580da117f55886cfd1e6bd8
The tail end of that log points out the problem, I think: ReachFramework.dll
depends on PresentationFramework.dll
depends on ReachFramework.dll
in a cycle.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
.NET Core Preview 7 - Child node "2" exited prematurely / ...
The stack overflow that's causing the problem: Stack Overflow in ReferenceResolver.cs when web project references WPF library aspnetcore# ...
Read more >Why can't I reference my class library?
I right click the Bin folder or Project and select Add Reference, then select my Class Library Project, it adds the 15 or...
Read more >Stack Overflow as a reference in a professional paper/ ...
Suppose I'm doing an academic paper, journal article, or other professional presentation. Would you say that it would be possible to use Stack...
Read more >WebView control for Windows Forms and WPF
The WebView control shows web content in your Windows Forms or WPF desktop application. This is one of several wrapped Universal Windows ...
Read more >MapControl for Windows Forms and WPF
The MapControl class enables you to display a symbolic or photorealistic map in your Windows Forms or WPF desktop application.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @rainersigwald. @peter-bull while we resolve this bug, you could workaround the issue by disabling the feature. Here’s what you need to set in your project file:
in your project
Fixed in https://github.com/aspnet/AspNetCore-Tooling/commit/43776c1864780c87435a8ae85cf2877658238079