Skip to content

A Visual Studio extension and dotnet tool to convert PackageReference Version child elements to attributes across your projects.

License

Notifications You must be signed in to change notification settings

icnocop/PackageReferenceVersionToAttribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PackageReference Version to Attribute

This Visual Studio extension and dotnet tool converts PackageReference Version child elements to attributes in C# project files (csproj).

It can also convert all projects in a Visual Studio solution file (sln).

Getting started with the Visual Studio Extension

  1. Download and install the extension from the Visual Studio Marketplace.

  2. Right-click on the root Solution node, or one or more projects, and select Convert PackageReference Version elements to attributes....

    Preview

  3. Wait until the process finishes.
    Check the status bar or the PackageReferences Version to Attribute Extension pane in the Output Window for details.

Getting started with the dotnet tool

  1. Install the dotnet tool using the following command:
    dotnet tool install PackageReferenceVersionToAttribute.Tool
    
  2. To convert all csproj files in the current directory and its subdirectories, run the tool with the command:
    PackageReferenceVersionToAttribute.Tool .\**\*.csproj
    
  3. For additional options and usage, you can run:
    PackageReferenceVersionToAttribute.Tool --help
    
    

Technical details

The extension will create a backup of each project file.
For example, MyProject.csproj will be copied to MyProject.csproj.bak.

If the project file is source controlled, it will be checked out for modification.

General

The Version child elements of PackageReference will be converted to a Version attribute.
For example, the following elements in the csproj project file:

  <PackageReference Include="Newtonsoft.Json">
    <Version>13.0.3</Version>
  </PackageReference>

will be converted to this:

  <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

Rate and Review

Has this extension helped you at all?

If so, please rate and share it.

Thank you! :)

About

A Visual Studio extension and dotnet tool to convert PackageReference Version child elements to attributes across your projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages