Upgrade single project and nuget lookup fix
This commit is contained in:
@@ -23,7 +23,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
|
||||
[ObservableProperty]
|
||||
private ObservableCollection<string> _parityResults = new() { };
|
||||
|
||||
|
||||
[ObservableProperty]
|
||||
private string _resultsLabel = "Ready";
|
||||
|
||||
@@ -35,10 +35,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ResultsLabel = string.Empty;
|
||||
try
|
||||
{
|
||||
var results = SolutionProjectParity.CompareSolutionAndCSharpProjects(
|
||||
SolutionFolderPath,
|
||||
SolutionFilePath
|
||||
);
|
||||
var results = SolutionProjectParity.CompareSolutionAndCSharpProjects(SolutionFolderPath, SolutionFilePath);
|
||||
foreach (var result in results)
|
||||
ParityResults.Add(result);
|
||||
ResultsLabel = $"{results.Count} Projects in folder missing from solution";
|
||||
@@ -62,9 +59,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ErrorMessages?.Clear();
|
||||
try
|
||||
{
|
||||
var csprojList = SolutionProjectParity.RetrieveAllCSharpProjectFullPathsFromFolder(
|
||||
SolutionFolderPath
|
||||
);
|
||||
var csprojList = SolutionProjectParity.RetrieveAllCSharpProjectFullPathsFromFolder(SolutionFolderPath);
|
||||
foreach (var csproj in csprojList)
|
||||
{
|
||||
FormatCsproj.FormatCsprojFile(csproj);
|
||||
@@ -83,9 +78,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ErrorMessages?.Clear();
|
||||
try
|
||||
{
|
||||
var csprojList = SolutionProjectParity.RetrieveAllCSharpProjectFullPathsFromFolder(
|
||||
SolutionFolderPath
|
||||
);
|
||||
var csprojList = SolutionProjectParity.RetrieveAllCSharpProjectFullPathsFromFolder(SolutionFolderPath);
|
||||
foreach (var csproj in csprojList)
|
||||
{
|
||||
FormatCsproj.FormatCsprojFile(csproj);
|
||||
@@ -97,7 +90,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ParityResults?.Add(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private async Task CheckForMissingImplicitUsingsInSolutionFile(CancellationToken token)
|
||||
{
|
||||
@@ -116,7 +109,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ParityResults?.Add(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private async Task CheckForMissingTreatWarningsAsErrorsInSolutionFile(CancellationToken token)
|
||||
{
|
||||
@@ -135,7 +128,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ParityResults?.Add(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private async Task DeleteBinAndObjFoldersInFolder(CancellationToken token)
|
||||
{
|
||||
@@ -153,7 +146,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
ParityResults?.Add(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private async Task UpdateAllProjectsToNet80(CancellationToken token)
|
||||
{
|
||||
@@ -172,6 +165,24 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task UpdateProjectToNet80(CancellationToken token)
|
||||
{
|
||||
ErrorMessages?.Clear();
|
||||
ParityResults.Clear();
|
||||
ResultsLabel = string.Empty;
|
||||
try
|
||||
{
|
||||
await DotNetUpgrade.UpdateProjectAtPathToNet80(CsprojFilePath);
|
||||
ResultsLabel = "Successfully updated project to .NET 8";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ResultsLabel = "Failed to update project to .NET 8";
|
||||
ParityResults?.Add(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task LoadSolutionFile(CancellationToken token)
|
||||
{
|
||||
@@ -264,7 +275,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
var json = JsonSerializer.Serialize(dto);
|
||||
await File.WriteAllTextAsync("./localState.json", json);
|
||||
}
|
||||
|
||||
|
||||
private async Task LoadSavedState()
|
||||
{
|
||||
try
|
||||
@@ -284,7 +295,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
LoadSavedState().ConfigureAwait(false);
|
||||
|
||||
@@ -107,6 +107,15 @@
|
||||
Update all projects in Solution to .NET 8.0
|
||||
</TextBlock>
|
||||
</Button>
|
||||
<Button Grid.Row="2" Grid.Column="2" MinHeight="100" Padding="10" Margin="5"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
|
||||
IsEnabled="{Binding SolutionFilePath, Mode=OneWay, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding UpdateProjectToNet80Command}">
|
||||
<TextBlock TextWrapping="Wrap">
|
||||
Update C# Project to .NET 8.0
|
||||
</TextBlock>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Label HorizontalAlignment="Center" Name="ResultsLabel" Content="{Binding ResultsLabel}"></Label>
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user