Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Diagnostics.Process.sln fails to build in Visual Studio #51601

Closed
fandrei opened this issue Apr 21, 2021 · 8 comments
Closed

System.Diagnostics.Process.sln fails to build in Visual Studio #51601

fandrei opened this issue Apr 21, 2021 · 8 comments

Comments

@fandrei
Copy link
Contributor

fandrei commented Apr 21, 2021

Description

build -subset clr -configuration debug
build -subset libs -configuration debug -runtimeconfiguration debug
build -vs System.Diagnostics.Process

After this, I'm trying to build System.Diagnostics.Process.sln in Visual Studio and getting these errors:

Error occurred while restoring NuGet packages: Invalid restore input. Duplicate frameworks found: 'net6.0-windows7.0, net6.0, netstandard2.0, netstandard2.0, net461'. Input files: <PATH>\runtime\src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj.

CSC : error CS0006: Metadata file '<PATH>\runtime\artifacts\bin\System.Drawing.Common\net6.0-Unix-Debug\System.Drawing.Common.dll' could not be found

Configuration

Windows 10 x64
.NET 6.0 Preview 2
VS 16.9.4

@dotnet-issue-labeler dotnet-issue-labeler bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Apr 21, 2021
@ghost
Copy link

ghost commented Apr 21, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

build -subset clr -configuration debug
build -subset libs -configuration debug -runtimeconfiguration debug
build -vs System.Diagnostics.Process

After this, I'm trying to build System.Diagnostics.Process.sln in Visual Studio and getting these errors:

Error occurred while restoring NuGet packages: Invalid restore input. Duplicate frameworks found: 'net6.0-windows7.0, net6.0, netstandard2.0, netstandard2.0, net461'. Input files: <PATH>\runtime\src\libraries\Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj.

CSC : error CS0006: Metadata file '<PATH>\runtime\artifacts\bin\System.Drawing.Common\net6.0-Unix-Debug\System.Drawing.Common.dll' could not be found

Configuration

Windows 10 x64
.NET 6.0 Preview 2
VS 16.9.4

Author: fandrei
Assignees: -
Labels:

area-Infrastructure-libraries, untriaged

Milestone: -

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Apr 21, 2021
@ViktorHofer ViktorHofer added this to the 6.0.0 milestone Apr 21, 2021
@ViktorHofer
Copy link
Member

Assigning @Anipik. He will take a look when he has some cycles after Preview 4 work is done.

@ericstj
Copy link
Member

ericstj commented Jul 27, 2021

The original problem here was caused by the SLN file missing System.Drawing.Common. I tried to update the SLN's using SLNGen here: ericstj@b50f32f#diff-25b59c493b7dab638637a5692c6a479434b2dfc4ebd1fc9582b7cd63b5b44b21R24

This fixed the SLN but now the build is failing as follows (in VS), which is the same thing mentioned in #53529

9>C:\Users\erics\.nuget\packages\microsoft.dotnet.genfacades\6.0.0-beta.21370.12\build\Microsoft.DotNet.GenPartialFacadeSource.targets(27,5): error : Did not find type 'System.Drawing.Bitmap' in any of the seed assemblies.
9>C:\Users\erics\.nuget\packages\microsoft.dotnet.genfacades\6.0.0-beta.21370.12\build\Microsoft.DotNet.GenPartialFacadeSource.targets(27,5): error : Did not find type 'System.Drawing.BitmapSuffixInSameAssemblyAttribute' in any of the seed assemblies.
9>C:\Users\erics\.nuget\packages\microsoft.dotnet.genfacades\6.0.0-beta.21370.12\build\Microsoft.DotNet.GenPartialFacadeSource.targets(27,5): error : Did not find type 'System.Drawing.BitmapSuffixInSatelliteAssemblyAttribute' in any of the seed assemblies.
9>C:\Users\erics\.nuget\packages\microsoft.dotnet.genfacades\6.0.0-beta.21370.12\build\Microsoft.DotNet.GenPartialFacadeSource.targets(27,5): error : Did not find type 'System.Drawing.Brush' in any of the seed assemblies.
...

I can reproduce the same thing from the command-line if I build the project for this TargetFramework and don't build ProjectReferences:

dotnet msbuild /bl /p:BuildProjectReferences=false /p:TargetFramework=netcoreapp3.1

Dropping /p:BuildProjectReferences=false makes it succeed.

The difference between the two is that when project references are not built, the not-supported source isn't passed to the gen facades task. (Aside: I don't think the targets for facades and not-supported assemblies make sense together since not-supported assemblies assume that everything in the contract is not supported, which makes GenFacades irrelevant).

The reason for this difference is that _GetGenFacadeNotSupportedCompileInputs is not finding the sources. This appears to have been regressed by dotnet/arcade@516eb1e#diff-36f97615b83f7a82f10b4f885cd942304f49b73cced7e809c156b0a241893d87R34

This changed the name of the Target used, but missed updating the name of that target in the condition (this codepath is only used during VS builds). I'll submit a fix for that.

@ViktorHofer
Copy link
Member

Excellent find @ericstj 👍. As you can see in the change, I did update the target name in the condition but unfortunately to the wrong one :(

@ericstj
Copy link
Member

ericstj commented Jul 27, 2021

No worries. Easy thing to miss since we don't have CI coverage for the VS-style build.

@FWest98
Copy link
Contributor

FWest98 commented Jul 28, 2021

I am encountering this issue as well. I currently can't build System.DirectoryServices.AccountManagement (or any of the associated tests) . I got many of the CS0006 errors (metadata not found). After updating the sln file to the entry in #56430, I get the same errors about seed assemblies as above #51601 (comment)...

Is there anything I can do now manually to make the builds within VS work?

@ericstj
Copy link
Member

ericstj commented Jul 28, 2021

Try updating

<MicrosoftDotNetGenFacadesVersion>6.0.0-beta.21370.12</MicrosoftDotNetGenFacadesVersion>

To 6.0.0-beta.21378.2

The fix for the seed assemblies change hasn't made it into dotnet/runtime yet.

@ViktorHofer
Copy link
Member

Fixed with the GenFacades fix in the Arcade repo.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants