refit icon indicating copy to clipboard operation
refit copied to clipboard

[BUG] Refit - Paket - VS 2022: Incompatible csproj changes

Open Flohack74 opened this issue 3 years ago • 2 comments

Describe the bug When using refit 6.3.2 together with the Paket package manager the following snippet is added to the csproj file in use:

    <Analyzer Include="..\..\..\packages\refit\analyzers\dotnet\roslyn4.0\cs\InterfaceStubGeneratorV2.dll">
      <Paket>True</Paket>
    </Analyzer>

This worked obviously for Visual Studio 2019, but in 2022 we get

    Error CS0101: The namespace "RefitInternalGenerated" already contains a definition for "PreserveAttribute". (9, 19)

and a lot of follow-up errors.

Steps To Reproduce

  1. Use Visual Studio 2022
  2. Create a new example solution + e.g. netcore project
  3. Install Paket according to https://fsprojects.github.io/Paket/get-started.html
  4. Add refit package to it
  5. Build solution

Expected behavior Compile works normally

Screenshots

Environment

  • OS: Win 10 64bit
  • Device: n/a
  • Version: 6.3.2
  • Working Version: n/a

Additional context We do not know if this is a bug with refit´s nuget package contents, or how Paket does extract that, but we start here to file a bug. feel free to explain why this is a bug at Paket´s side :)

Flohack74 avatar May 16 '22 11:05 Flohack74

I also have this same problem and cannot figure out how to resolve it. Only thing that worked is that I had VS2019 installed and managed to build the project with it. But on VS2022 or JetBrains Rider, it throws exceptions.

vukasinpetrovic avatar Aug 11 '22 09:08 vukasinpetrovic

Ok, I figured out a temporary solution. I switched back to MSBuild v16 and building the project now works. I hope developers can resolve this problem. There is already a ticket for it (https://github.com/reactiveui/refit/issues/1387)

image

vukasinpetrovic avatar Aug 11 '22 09:08 vukasinpetrovic