Build error throws when running dotnet pack with multiple target framework
See original GitHub issueBug Description:
After upgrading the .NET 6.0 preview 1 SDK, it throws build error when running dotnet pack command line. The problem is occur when the project file have multiple target frameworks <TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>. If I change it to single <TargetFramewok> then it works fine.
Exceptions (if any)
C:\Program Files\dotnet\sdk\6.0.100-preview.1.21103.13\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.ScopedCss.targets(134,3): error MSB4044: The “ComputeCssScope” task was not given a value for the required parameter “TargetName”. [D:\Feb\NET6\RazorClassLibrary2\RazorClassLibrary2.csproj]
To Reproduce
- Download the Razor sample.
 - Goto command prompt and then run the command 
dotnet pack -c Release 
Sample:
Further technical details
Blazor RazorClass Library 6.0 sample Latest SDK .NET 6.0 Preview 1 VS 2019 preview
Issue Analytics
- State:
 - Created 3 years ago
 - Reactions:7
 - Comments:14 (6 by maintainers)
 
Top Results From Across the Web
dotnet pack targeting multiple frameworks
1 Answer 1 ... For multi-targeting, use the plural TargetFrameworks property to provide a list of frameworks. TargetFramework (singular) only ...
Read more >Troubleshoot .NET Framework targeting errors
A description of common NuGet restore errors in Visual Studio and how to troubleshoot them.
Read more >Multi-targeting for NuGet Packages
If the project targets .NET framework 4.0 and earlier, NuGet throws an appropriate error message for not finding the compatible assembly.
Read more >Chapter 11. Multiple frameworks and runtimes - .NET Core in ...
NET Core SDK makes it possible to support multiple frameworks in the same NuGet package (generated by dotnet pack ). Frameworks vs. runtimes....
Read more >Multi-targetting .Net Framework and .Net Core in a single project
You can go through these steps in a simplistic, “try to build;fix the next error; repeat” way. 1. Change TargetFramework to TargetFrameworks.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@skclusive None yet. We’re tracking it under next sprint planning. If you’re affected by this, you can let us know by giving the issue a thumbs up.
Still running into this issue with Preview 7.