-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Visual Studio design time build failing to recognize essential types like Void, IDisposable, Enum in test code #68862
Comments
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsIt seems a recent change broke design time build for test code in Visual Studio. Not sure if widespread or not, but I can repro this in
|
That's because you have a ProjectReference to the source project even though the source assembly is already referenced as part of the live built microsoft.netcore.app.ref targeting pack: runtime/src/libraries/System.Formats.Tar/tests/System.Formats.Tar.Tests.csproj Lines 69 to 71 in 5992145
When you remove that ProjectReference, the design time build failures go away. You can see in the design time binlog that the reference assembly is chosen from the ProjectReference's output folder: |
Thanks, that fixed it. |
cc @ericstj as you might be interested in this. Seems there is a conflict between P2Ps when the assembly is also exposed inbox (via the targeting pack). |
yeah, that's not handled well in the SDK: dotnet/sdk#2674 It might be nice if our infrastructure did some validation around what sort of reference to use where. Guide people down the path of doing the right thing. |
This already works for a normal build because of runtime/eng/targetingpacks.targets Line 131 in 3116f28
It might make more sense to investigate why this doesn't work for a design time build. |
@ViktorHofer
It seems a recent change broke design time build for test code in Visual Studio. Not sure if widespread or not, but I can repro this in
System.Formats.Tar
:main
.git clean -fdx
.build.cmd clr+libs -rc release
.build.cmd -vs System.Formats.Tar
.The text was updated successfully, but these errors were encountered: