Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does postsharp include fixed version of Nuget.Packaging? #8

Open
AC42admin opened this issue Jul 3, 2024 · 1 comment
Open

Comments

@AC42admin
Copy link

Hi,

We have some conflicts in our solution and had to fix the version of Nuget.X to the same as shipped with Postsharp....which is quite annoying.

Under this folder 'C:\ProgramData\PostSharp\2024.1.4\bin.Release\net472' the version of NuGet.Packaging.dll is 6.9.1.x.

Is there a way to use the latest NuGet.X in our solution without having errors or warnings @build?

As a workaround we fixed the reference to Nuget.Packaging to 6.9.1 in our related solutions.

@prochan2
Copy link
Member

prochan2 commented Jul 4, 2024

Hello,

The folder C:\ProgramData\PostSharp\2024.1.4\bin.Release\net472 is meant to be used only by PostSharp and assemblies from this folder shouldn't be referenced. Having a project with PostSharp and the latest NuGet.Packaging referenced via NuGet, there's no build warning or error.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NuGet.Packaging" Version="6.10.1" />
    <PackageReference Include="PostSharp" Version="2024.1.4" />
  </ItemGroup>

</Project>

Referencing PostSharp using NuGet is the only supported way. In case you cannot use NuGet, there is still a way to reference PostSharp without NuGet. But even though it's available, we do not recommend it, and we cannot provide support in case this doesn't work. It is also only supposed to work with non-sdk-style .NET Framework projects. You can find the details in our docs.

In case you do reference PostSharp via NuGet, and you're still experiencing this issue, please provide a project that reproduces this, so we can investigate further.

@svick svick transferred this issue from postsharp/Metalama Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants