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

Multiple solutions in same folder cannot be upgraded to central package management #1621

Open
doxxx opened this issue Jan 3, 2025 · 2 comments

Comments

@doxxx
Copy link

doxxx commented Jan 3, 2025

- [ ] Include the log file upgrade-assistant.clef that is produced in the working directory
I cannot because I cannot invoke the tool.

Describe the bug

I have a repo which contains two solution files in the same folder, which contain a different subset of the projects in the repo. After I have upgraded one of the solutions to central package management, I can no longer do the same for the second solution. By this I mean that after selecting Upgrade in the context menu for a project in the second solution, the upgrades offered in the Upgrade Assistant window does not include an option to convert to central package management.

To Reproduce

Example repo: https://github.com/doxxx/DotNetUpgradeAssistantTwoSolutions

In this repo I have two solutions, which each contain a different project in the repo. The first commit is the original state without central package management. In this state, either SolutionOne or SolutionTwo can be opened in Visual Studio and when selecting the Upgrade option on the project, it offers the option to upgrade to central package management. The second commit is after upgrading SolutionOne to central package management. In this state, when you open SoltuionTwo in Visual Studio, selecting the Upgrade option from the project context menu no longer offers the option to upgrade to central package management.

Further technical details

  • Windows 10 64-bit
  • dotnet SDKs:
    5.0.408 [C:\Program Files\dotnet\sdk]
    6.0.302 [C:\Program Files\dotnet\sdk]
    7.0.100 [C:\Program Files\dotnet\sdk]
    9.0.100 [C:\Program Files\dotnet\sdk]
  • Upgrade Assistant Visual Studio extension version 0.5.829.41291
@doxxx
Copy link
Author

doxxx commented Jan 3, 2025

If I try to use the same version of the CLI tool, explicitly passing nuget.cpm as the operation on the unconverted project, I get the following log output:

Traits
        SolutionUnloadReload
        Cpm
        BuildTelemetry
        {Operation=nuget}
        NeedsSourceProjects
        NeedsRunConfig
Properties
        CommandSettings = Project: .\AppLibrary\AppLibrary.csproj, OperationControllerId: nuget.cpm, TargetFramework: , Destination: , Template=, Config: , NonInteractive=False
        TelemetryEvent = Microsoft.UpgradeAssistant.Services.TelemetryEvent
        Traits = Microsoft.UpgradeAssistant.Traits.TraitsSet
        UpgradeType = nuget.cpm
        Controller = Microsoft.UpgradeAssistant.Cli.Slices.Operations.Controllers.Cpm.CpmUpgradeController
        OperationDefinition = Microsoft.UpgradeAssistant.Operations.OperationDefinition
        SourceProjectPaths = System.Collections.Generic.List`1[System.String]
        SelectedProjectsDisplayOption = C:\Users\gordon.tyler\dev\BugReports\DotNetUpgradeAssistantTwoSolutions\AppLibrary\AppLibrary.csproj
        ConvertProjectsToSdkStyle = False
        IncludeWebProjects = False
        UseTransitivePinning = False
        CpmUpgradeSettings = Microsoft.UpgradeAssistant.Operations.CpmUpgradeSettings
        EnvironmentVariablesKey = System.Collections.Generic.Dictionary`2[System.String,System.String]
        Slice = C:\Users\gordon.tyler\dev\BugReports\DotNetUpgradeAssistantTwoSolutions\AppLibrary
        OperationProjectCount = 1
        CorrelationIdKey = ca5c0013-4166-4817-8229-21b115ca74b4
        Nodes = System.Linq.Enumerable+OrderedIterator`2[Microsoft.UpgradeAssistant.SliceNode,System.Int32]
        OperationTelemetryEventKey = Microsoft.UpgradeAssistant.Services.TelemetryEvent
Initializing operation...
project AppLibrary.csproj...
        Microsoft.UpgradeAssistant.Msbuild.Transformers.ProjectPackagesConfigCleanupTransformer
        info: Done
        Microsoft.UpgradeAssistant.Msbuild.Transformers.CpmProjectPackagesTransformer
        info: Done
Skipped
dependencies.finalizer Finalize project dependencies...
        Microsoft.UpgradeAssistant.Msbuild.Transformers.CpmUpgradeFinalizerTransformer
        info: Done
Skipped
Finalizing operation...
Complete: 0 succeeded, 0 failed, 2 skipped.

@doxxx
Copy link
Author

doxxx commented Jan 3, 2025

If I remove the Directory.Packages.props file created by the conversion of SolutionOne and retry the operation in the CLI tool, then it successfully converts the project from SolutionTwo. However, I would then have to manually merge the contents of the two props files.

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

1 participant