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

Roslyn 4.10.0 does not compile for .NET 6 #74016

Open
josefpihrt opened this issue Jun 15, 2024 · 5 comments
Open

Roslyn 4.10.0 does not compile for .NET 6 #74016

josefpihrt opened this issue Jun 15, 2024 · 5 comments
Assignees
Milestone

Comments

@josefpihrt
Copy link
Contributor

Version Used: 4.10.0

Steps to Reproduce:

After updating Roslyn references from 4.9.2 to 4.10.0 the project cannot be compiled for .NET 6

PR: dotnet/roslynator#1483
Job: https://github.com/dotnet/roslynator/actions/runs/9527109706/job/26263368490

Copy of output from the job above:

Run dotnet restore
  Determining projects to restore...
  Restored /home/runner/work/roslynator/roslynator/src/Core/Core.csproj (in 2.75 sec).
  Restored /home/runner/work/roslynator/roslynator/src/CSharp/CSharp.csproj (in 2.8 sec).
  Restored /home/runner/work/roslynator/roslynator/src/CSharp.Workspaces/CSharp.Workspaces.csproj (in 3.06 sec).
  Restored /home/runner/work/roslynator/roslynator/src/Workspaces.Core/Workspaces.Core.csproj (in 249 ms).
  Restored /home/runner/work/roslynator/roslynator/src/VisualBasic/VisualBasic.csproj (in 658 ms).
  Restored /home/runner/work/roslynator/roslynator/src/VisualBasic.Workspaces/VisualBasic.Workspaces.csproj (in 419 ms).
  Restored /home/runner/work/roslynator/roslynator/src/Documentation/Documentation.csproj (in 878 ms).
/home/runner/work/roslynator/roslynator/src/CommandLine/CommandLine.csproj : error NU[17](https://github.com/dotnet/roslynator/actions/runs/9527109706/job/26263368490#step:5:18)01: Warning As Error: Package 'Microsoft.Build 17.10.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.
/home/runner/work/roslynator/roslynator/src/CommandLine/CommandLine.csproj : error NU1701: Warning As Error: Package 'Microsoft.IO.Redist 6.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.
  Failed to restore /home/runner/work/roslynator/roslynator/src/CommandLine/CommandLine.csproj (in 7.1 sec).

Similar issue: #71784

I would like to know if this issue can be fixed or if I have to drop support for .NET 6 SDK for my .NET CLI tool (after updating to 4.10.0)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 15, 2024
@jjonescz
Copy link
Member

Looks like it's just a warning, not an error. Does anything break if it's suppressed?

@josefpihrt
Copy link
Contributor Author

@jjonescz I didn't notice it's a warning.

Anyway, the build fails:

MSBuildWorkspaceCommand.cs(13,30): Error CS0234 : The type or namespace name 'MSBuild' does not exist in the namespace 'Microsoft.CodeAnalysis' (are you missing an assembly reference?)

@dibarbet
Copy link
Member

(Triage) Likely duplicate of #71784, assigning over to Jason

@Cosifne Cosifne removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 2, 2024
@arunchndr arunchndr closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
@jasonmalinowski
Copy link
Member

@arunchndr I'm going to reopen this since I think it's fixed by #72257, which also has some other long-term value to merge as well.

@jasonmalinowski
Copy link
Member

(that PR will need a bit of love to get mergeable again but hope to do that once I have the time)

@arunchndr arunchndr added this to the Backlog milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants