Some projects can't be ported immediately after building all runtime
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- documentation, tooling
Research direction
Start in src/PortToTripleSlash/src/libraries/MSBuildLoader.cs, especially ThrowIfDiagnosticsFound at line 175 and LoadProjectAsync at line 80. Reproduce with build.cmd clr+libs -rc release and the shown PortToTripleSlash command, then verify that porting Microsoft.Extensions.Hosting.WindowsServices succeeds without manually rebuilding the project.
Written by the indexing model from the issue text.
Description
Problem
After building the runtime repo project with:
build.cmd clr+libs -rc release
I was unable to port docs from Microsoft.Extensions.Hosting.WindowsServices due to an exception when opening the project: Unresolved metadata reference removed from project.
Output
$ PortToTripleSlash.exe \
-Docs $ENV:SOURCEREPOS\dotnet-api-docs\xml
-CsProj $ENV:SOURCEREPOS\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj
-IncludedAssemblies Microsoft.Extensions.Hosting.WindowsServices
-IncludedNamespaces Microsoft.Extensions.Hosting.WindowsServices
Verifying CLI arguments...
Specified Docs xml locations:
- C:\Users\calope\source\repos\dotnet-api-docs\xml
Included assemblies:
- Microsoft.Extensions.Hosting.WindowsServices
Included namespaces:
- Microsoft.Extensions.Hosting.WindowsServices
Querying for all Visual Studio instances...
Looking for the latest stable instance of Visual Studio, if there is one...
Selected instance:
- MSBuildPath: C:\Program Files\dotnet\sdk\7.0.200
- Version: 7.0.200
Attempting to register assembly loader...
Attempting to register Visual Studio instance
Successful Visual Studio load!
Looking for a resolved workspace that contains the project 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj'...
Did not find an existing resolved project for path C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj. Creating a workspace for it...
Looking for a resolved project that contains the project 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj'...
Did not find an existing resolved project for path 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj'. Attempting to find the project in this workspace...
Found the project in this workspace. Attempting to get compilation...
Found the compilation for this project. Creating the resolved project...
Unhandled exception. System.Exception:
Project.OpenProjectAsync - C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj
Warning - Unresolved metadata reference removed from project: C:\Users\calope\source\repos\runtime\artifacts\bin\System.Diagnostics.DiagnosticSource\Debug\netstandard2.0\System.Diagnostics.DiagnosticSource.dll
at ApiDocsSync.PortToTripleSlash.MSBuildLoader.ThrowIfDiagnosticsFound(ResolvedWorkspace resolvedWorkspace, String origin, Boolean isMono) in C:\Users\calope\source\repos\api-docs-sync\src\PortToTripleSlash\src\libraries\MSBuildLoader.cs:line 175
at ApiDocsSync.PortToTripleSlash.MSBuildLoader.LoadProjectAsync(String projectPath, Boolean isMono, CancellationToken cancellationToken) in C:\Users\calope\source\repos\api-docs-sync\src\PortToTripleSlash\src\libraries\MSBuildLoader.cs:line 80
at ApiDocsSync.PortToTripleSlash.MSBuildLoader.LoadMainProjectAsync(String projectPath, Boolean isMono, CancellationToken cancellationToken) in C:\Users\calope\source\repos\api-docs-sync\src\PortToTripleSlash\src\libraries\MSBuildLoader.cs:line 63
at ApiDocsSync.PortToTripleSlash.PortToTripleSlash.Main(String[] args) in C:\Users\calope\source\repos\api-docs-sync\src\PortToTripleSlash\src\app\PortToTripleSlash.cs:line 19
at ApiDocsSync.PortToTripleSlash.PortToTripleSlash.<Main>(String[] args)
Workaround
Go to the folder of that assembly and build it before porting:
$ cd .\src\libraries\Microsoft.Extensions.Hosting.WindowsServices
$ dotnet build
MSBuild version 17.6.0-preview-23174-01+e7de13307 for .NET
Determining projects to restore...
Restored C:\Users\calope\source\repos\runtime\src\libraries\Common\tests\TestUtilities\TestUtilities.csproj (in 1.11 sec).
Restored C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\tests\Microsoft.Extensions.Hosting.Windo
wsServices.Tests.csproj (in 1.09 sec).
78 of 80 projects are up-to-date for restore.
Microsoft.Interop.SourceGeneration -> C:\Users\calope\source\repos\runtime\artifacts\bin\Microsoft.Interop.SourceGeneration\Debug\netstandard2.0\
Microsoft.Interop.SourceGeneration.dll
Microsoft.Extensions.Primitives -> C:\Users\calope\source\repos\runtime\artifacts\bin\Microsoft.Extensions.Primitives\ref\Debug\net8.0\Microsoft.
Extensions.Primitives.dll
...
...
Build succeeded.
0 Warning(s)
0 Error(s)
Porting again succeeds:
Output
$ PortToTripleSlash.exe -Docs C:\Users\calope\source\repos\dotnet-api-docs\xml -CsProj C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj -IncludedAssemblies Microsoft.Extensions.Hosting.WindowsServices -IncludedNamespaces Microsoft.Extensions.Hosting.WindowsServices
Verifying CLI arguments...
Specified Docs xml locations:
- C:\Users\calope\source\repos\dotnet-api-docs\xml
Included assemblies:
- Microsoft.Extensions.Hosting.WindowsServices
Included namespaces:
- Microsoft.Extensions.Hosting.WindowsServices
Querying for all Visual Studio instances...
Looking for the latest stable instance of Visual Studio, if there is one...
Selected instance:
- MSBuildPath: C:\Program Files\dotnet\sdk\7.0.200
- Version: 7.0.200
Attempting to register assembly loader...
Attempting to register Visual Studio instance
Successful Visual Studio load!
Looking for a resolved workspace that contains the project 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj'...
Did not find an existing resolved project for path C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj. Creating a workspace for it...
Looking for a resolved project that contains the project 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj'...
Did not find an existing resolved project for path 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj'. Attempting to find the project in this workspace...
Found the project in this workspace. Attempting to get compilation...
Found the compilation for this project. Creating the resolved project...
Looking for Docs xml files...
Type 'T:Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceHelpers' added with 1 member(s) included: C:\Users\calope\source\repos\dotnet-api-docs\xml\Microsoft.Extensions.Hosting.WindowsServices\WindowsServiceHelpers.xml
Type 'T:Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime' added with 6 member(s) included: C:\Users\calope\source\repos\dotnet-api-docs\xml\Microsoft.Extensions.Hosting.WindowsServices\WindowsServiceLifetime.xml
Finished looking for Docs xml files.
Looking for symbol locations for all Docs types...
Symbol 'T:Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceHelpers' located in 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\WindowsServiceHelpers.cs'.
Adding tree 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\WindowsServiceHelpers.cs' for 'T:Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceHelpers'...
Looking for a resolved workspace that contains the project 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting\src\Microsoft.Extensions.Hosting.csproj'...
...
...
Now attempting to port all found symbols...
Porting comments for 'Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceHelpers'. Locations: 1...
Porting docs for tree 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\WindowsServiceHelpers.cs'...
Docs ported to 'Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceHelpers'.
Porting comments for 'Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime'. Locations: 1...
Porting docs for tree 'C:\Users\calope\source\repos\runtime\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\WindowsServiceLifetime.cs'...
Docs ported to 'Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime'.
- Dominant language
- C#
- Stars
- 14
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/api-docs-sync
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
dotnet/api-docs-sync#182 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dotnet/api-docs-sync#181 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dotnet/api-docs-sync#180 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dotnet/api-docs-sync#179 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
dotnet/api-docs-sync#178 · 1 comment ·
All issues in dotnet/api-docs-sync
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·