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

Installation of Microsoft.Build.CopyOnWrite #593

Open
RaptorCZ opened this issue Nov 13, 2024 · 5 comments
Open

Installation of Microsoft.Build.CopyOnWrite #593

RaptorCZ opened this issue Nov 13, 2024 · 5 comments

Comments

@RaptorCZ
Copy link

I would like to know how to install this nuget. I found somewhere I need to put it to Directory.Build.targets as SDK reference

<Project>
  <Sdk Name="Microsoft.Build.CopyOnWrite" Version="1.0.302" />
</Project>

But I found on other sites, that it should be part of csproj, or Directory.Build.props

<Project>
  <ItemGroup>
    <PackageReference Include="Microsoft.Build.CopyOnWrite" Version="1.0.302" />
  </ItemGroup>
</Project>

Now I switched solution to Central Package Management and I'm using Directory.Packages.props for version definitions and not sure if both Build definitions supports it.

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>
  <ItemGroup>
    <PackageVersion Include="Microsoft.Build.CopyOnWrite" Version="1.0.302" />
  </ItemGroup>
</Project>

So how to use it?

@erikmav
Copy link
Collaborator

erikmav commented Nov 13, 2024

In most of my repos, where we use central packages, we use it in Directory.Packages.props using the syntax from this documentation:

<Project>
  <ItemGroup>
    <!-- <PackageVersion> elements here -->
  </ItemGroup>
  <ItemGroup>
    <GlobalPackageReference Include="Microsoft.Build.CopyOnWrite" Version="1.0.334" />
  </ItemGroup>
</Project>

@erikmav
Copy link
Collaborator

erikmav commented Nov 13, 2024

Installation as an SDK is covered here but in my experience the global package reference approach covered more cases in my hetereogeneous C#/C++ repos.

@erikmav
Copy link
Collaborator

erikmav commented Nov 13, 2024

Also see the comment at the top of the README that this package is becoming redundant with the 24H2 Windows 11 release, as well as Server 2025.

@RaptorCZ
Copy link
Author

Also see the comment at the top of the README that this package is becoming redundant with the 24H2 Windows 11 release, as well as Server 2025.

hmm, thnx.
I'm on 24H2 (Insider - Dev Build 26120.2222) so maybe I can just get rid of it.

@erikmav
Copy link
Collaborator

erikmav commented Nov 13, 2024 via email

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