Skip to content

Generating resources for SDK-style projects targeting net20/net35 #7590

Answered by rainersigwald
savornicesei asked this question in Q&A
Discussion options

You must be logged in to vote

To target .NET Framework 2.0/3.5 projects that use resources, you must build with MSBuild.exe. dotnet build is not supported for that scenario.

The reason for this is that .NET Framework resources required using BinaryFormatter, which varies between .NET versions, so we cannot create the resources from a .NET 6 process. An improved mechanism is available called System.Resources.Extensions, but it supports .NET Framework 4.6.1 and higher, with no plans to support lower framework versions (dotnet/runtime#62282).

However, MSBuild.exe retains the ability to use a .NET Framework 3.5 process to create the resources, and works with .NET SDK projects. So to build this project you'll need to use t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@savornicesei
Comment options

@rainersigwald
Comment options

Answer selected by savornicesei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants