Sergio0694 / PolySharp

PolySharp provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. Add a reference, set your C# version to latest and have fun! 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update readme and add warning for projects using packages.config

Sergio0694 opened this issue · comments

Description

Source generators might not be loaded correctly in legacy-style .csproj projects on NETFX (see #39, #43). The readme should include a warning explaining this, with a link to the SDK-style .csproj project docs to help users understand how to fix things.

commented

I just checked my solution and noticed that I have 2 legacy-style csproj projects in it with PolySharp. And PolySharp works fine in both. But I use <PackageReference> in both projects.

Could it be that the requirement is not strictly about SDK-style projects, but instead just to not use packages.config? So legacy-style csproj with <PackageReference> works too?

Correction, yes, the issue is not legacy style, the issue is package.config, that's not supported. Using legacy style is fine as long as you're using package reference. I'm also thinking I could add a warning in my .targets to just let users know if they have package.config, why the generator isn't running. That would make the UX much better in case they're not working 🙂

commented

I'm also thinking I could add a warning in my .targets to just let users know if they have package.config, why the generator isn't running. That would make the UX much better in case they're not working

That would be great, yes!

Correction, yes, the issue is not legacy style, the issue is package.config, that's not supported. Using legacy style is fine as long as you're using package reference.

That's a major relief, I was worried this wouldn't work at all for our Web Forms project, which is forever stuck on the old csproj format. But we already switched to using <PackageReference> a while ago, so we should (hopefully) be fine.