Polysharp didn't work for me
goodstas opened this issue · 4 comments
I created Console App for .NET Framework 4.7.2 and added to the project file 11.0. I installed the PolySharp package .I don't see that it produces some source generators files and i got the exceptions from the compiler.. will be appreciate for advise what i did wrong. I didn't see the Polysharp in my References list but there is packages.config file and there is a reference there. I attached zip file with a solution. There are 2 projects in solution. Please look on ConsolePolysharp2. Thank you!
ConsolePolySharp.zip
The issue is you're using a legacy-style .csproj project with the package.config
configuration. This causes the source generators to not run correctly, which is why you're seeing those errors. You need to migrate to an SDK-style .csproj project 🙂
To clarify: you don't need to change framework or anything, you can keep using .NET Framework 4.7.2 if you want. But you will need to update the .csproj file to use the new format, so that the generators can run.
Thank you very much for quick answer and your work. You got my 5 star :)
@Sergio0694 This is a very important point since .NET Framework projects are still created with legacy-style .csproj files that use packages.config by Visual Studio. I think this should be mentioned in the readme.
Yeah that's a good point, I'll add a warning about this in the readme! 🙂