Microsoft.CodeAnalysis build error
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- build-system, tooling
Research direction
Reproduce the failure with dotnet build -c Release, then inspect Directory.Packages.props, Directory.Build.props, and Foo.CodeAnalysis.csproj alongside the Microsoft.MSBuildCache.SharedCompilation targets named in the error. Trace the Microsoft.CodeAnalysis version mismatch and verify that the affected project builds successfully without the ResolveFileAccesses assembly-load failure.
Written by the indexing model from the issue text.
Description
When testing out MSBuildCache on my solution, I am getting a build error related to Microsoft.CodeAnalysis 3.8.00, from one of our projects that itself references a difference Microsoft.CodeAnalysis version:
https://github.com/microsoft/MSBuildCache/blob/main/Directory.Packages.props#L29 references <PackageVersion Include="Microsoft.CodeAnalysis" Version="3.8.0" /> so it appears they are clashing?
NB I'm using dotnet build here - is it unsupported and I need a VS Install?
dotnet build -c Release
C:\Users\<snip>\.nuget\packages\microsoft.msbuildcache.sharedcompilation\0.1.318-preview\build\Microsoft.MSBuildCache.Shared
Compilation.targets(9,5): error MSB4018: The "ResolveFileAccesses" task failed unexpectedly. [C:\src\Foo\src\CodeAnalysis\src
\Foo.CodeAnalysis\Foo.CodeAnalysis.csproj]
C:\Users\<snip>\.nuget\packages\microsoft.msbuildcache.sharedcompilation\0.1.318-preview\build\Microsoft.MSBuildCache.Shared
Compilation.targets(9,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, V
ersion=3.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified. [C:\src\Foo\src
\CodeAnalysis\src\Foo.CodeAnalysis\Foo.CodeAnalysis.csproj]
Foo.CodeAnalysis.csproj
...
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="NETStandard.Library" />
</ItemGroup>
...
Directory.Build.props
<ItemGroup Condition="'$(MSBuildProjectName)'!='Foo.CodeAnalysis' AND '$(MSBuildProjectName)'!='Foo.CodeAnalysis.Test'">
<ProjectReference Include="$(MSBuildThisFileDirectory)\CodeAnalysis\src\Foo.CodeAnalysis\Foo.CodeAnalysis.csproj"
PrivateAssets="all"
ReferenceOutputAssembly="false"
OutputItemType="Analyzer"/>
</ItemGroup>
Directory.Packages.props
...
<ItemGroup >
<GlobalPackageReference Include="Microsoft.MSBuildCache.SharedCompilation" Version="0.1.318-preview" />
<GlobalPackageReference Include="Microsoft.MSBuildCache.Local" Version="0.1.318-preview" />
</ItemGroup>
...
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Features" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.NUnit" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.NUnit" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Features" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Scripting.Common" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.0.1" />
...
- Dominant language
- C#
- Stars
- 64
- Forks
- 24
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 2
Contributor guide
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 microsoft/MSBuildCache
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
microsoft/MSBuildCache#154 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/MSBuildCache#164 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/MSBuildCache#167 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/MSBuildCache#159 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/MSBuildCache#155 · 1 comment ·
All issues in microsoft/MSBuildCache
Similar issues
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficulty 2/5 1-2 days Newbie friendliness 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
getsentry/sentry-dotnet#5617 · 1 comment ·
-
:watch: Not Triaged dotnet-fsharp/svc
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/azure-sdk-for-net#63292 · 3 comments · 1 reaction ·