Sdk: Enable embedded resource DependentUpon convention on .NET Framework

Created on 13 Sep 2019  路  7Comments  路  Source: dotnet/sdk

Shouldn't this also be enabled for .NETFramework? Without it, embedded resource names are changing between classic and SDK-style projects. (Originally reported in https://github.com/aspnet/EntityFramework6/issues/1258)

https://github.com/dotnet/sdk/blob/25d8a32f0c357b8e6ccaa39fba27d5c61364e26a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L109-L112

cc @divega @Pilchie @ajcvickers @BenVillalobos

Most helpful comment

...we should document that you have to opt in...

...by changing net472 to netcoreapp3.0. :trollface:

All 7 comments

cc @nguerrera

Enabling the DependentUpon convention would be a breaking change on SDK upgrade for projects that target a framework supported by pre-3.0 SDKs.

Yes, this was by design to avoid a breaking change. cc @livarcocc

Putting in discussion for now. We could reconsider a break if we get enough feedback, but I think we should document that you have to opt in to this for older frameworks at this point. Silently changing resource names between sdk versions is not somehting we should do lightly. I'm not sure how to measure the risk.

...we should document that you have to opt in...

...by changing net472 to netcoreapp3.0. :trollface:

I think if there is a major version change, and assuming semver is used, then a breaking change would be acceptable. When upgrading to a new major version, people expect breaking changes and would assess what (re-)work is required in their code base when upgrading.

It would make sense to have this opted to true for .NET Framework since ComponentResourceManager expects the old behavior. The code that the Windows Forms designer generates for InitializeComponent uses ComponentResourceManager with this expectation.

Was this page helpful?
0 / 5 - 0 ratings