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

ApiCompat fails inside VS for Microsoft.Win32.Registry (src) - Intermediate paths broken #35178

Closed
ViktorHofer opened this issue Apr 19, 2020 · 1 comment
Labels
area-Microsoft.Win32 untriaged New issue has not been triaged by the area owner

Comments

@ViktorHofer
Copy link
Member

ViktorHofer commented Apr 19, 2020

Opening Microsoft.Win32.Registry via build.cmd -vs Microsoft.Win32.Registry and building the src project fails with the following errors and warnings:

Severity	Code	Description	Project	File	Line	Suppression State
Warning	MSB3245	Could not resolve this reference. Could not locate the assembly "mscorlib". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.	Microsoft.Win32.Registry (ref\Microsoft.Win32.Registry)	C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets	2081	
Warning	MSB3245	Could not resolve this reference. Could not locate the assembly "mscorlib". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets	2081	
Error		TypesMustExist : Type 'Microsoft.Win32.Registry' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryHive' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryKey' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryKeyPermissionCheck' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryOptions' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryValueKind' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryValueOptions' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.RegistryView' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'Microsoft.Win32.SafeHandles.SafeRegistryHandle' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'System.Security.AccessControl.RegistryAccessRule' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'System.Security.AccessControl.RegistryAuditRule' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'System.Security.AccessControl.RegistryRights' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		TypesMustExist : Type 'System.Security.AccessControl.RegistrySecurity' does not exist in the implementation but it does exist in the contract.	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	82	
Error		ApiCompat failed for 'C:\git\runtime3\artifacts\bin\Microsoft.Win32.Registry\netcoreapp5.0-Debug\Microsoft.Win32.Registry.dll'	Microsoft.Win32.Registry (src\Microsoft.Win32.Registry)	C:\Users\vihofer\.nuget\packages\microsoft.dotnet.apicompat\5.0.0-beta.20201.2\build\Microsoft.DotNet.ApiCompat.targets	96	

The warnings are expected as net461 references mscorlib which I haven't restored from the repo root. Related: #31844.

The errors though seem to be unexpected. Taking a further look reveals that the output assembly isn't present in the OutDir. ApiCompat should probably fail with a different error here?

Checking the BaseOutputIntermediatePath reveals that the assembly is actually compiled into netcoreapp5.0-Windows_NT-Debug instead of netcoreapp5.0-Debug which seems correct. The intermediate paths (and possibly the output paths as well) are probably broken when building inside VS:

image

cc @ericstj @Anipik

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Microsoft.Win32 untriaged New issue has not been triaged by the area owner labels Apr 19, 2020
@ViktorHofer ViktorHofer changed the title ApiCompat fails inside VS for Microsoft.Win32.Registry (src) ApiCompat fails inside VS for Microsoft.Win32.Registry (src) - Intermediate paths broken Apr 19, 2020
@ViktorHofer
Copy link
Member Author

ViktorHofer commented Apr 19, 2020

OK I'm relatively certain that this is because of my change dotnet/arcade#5293. Seems like the AttachTargetFrameworkSuffix target isn't run.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Microsoft.Win32 untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants