Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
<PackageVersion Include="NuGet.Protocol" Version="6.14.0" />
<PackageVersion Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="Spectre.Console" Version="0.49.1" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, thanks for catching that.

<PackageVersion Include="System.Composition.AttributedModel" Version="10.0.0-preview.7.25380.108" />
<PackageVersion Include="System.Collections.Immutable" Version="10.0.0-preview.7.25380.108" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.Reflection.Metadata" Version="10.0.0-preview.7.25380.108" />
<PackageVersion Include="System.Resources.Extensions" Version="10.0.0-preview.7.25380.108" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
<PackageVersion Include="System.Threading.Channels" Version="9.0.3" />
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.8" />
<PackageVersion Include="TomsToolbox.Composition.MicrosoftExtensions" Version="2.22.2" />
<PackageVersion Include="TomsToolbox.Wpf.Composition" Version="2.22.2" />
Expand All @@ -58,4 +60,4 @@
<ItemGroup>
<GlobalPackageReference Include="TomsToolbox.Composition.Analyzer" Version="2.22.1" />
</ItemGroup>
</Project>
</Project>
48 changes: 28 additions & 20 deletions ICSharpCode.Decompiler/Solution/SolutionCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,32 +161,40 @@ static void FixAllProjectReferences(List<ProjectItem> projects)

foreach (var project in projects)
{
XDocument projectDoc = XDocument.Load(project.FilePath);

if (projectDoc.Root?.Name.LocalName != "Project")
try
{
throw new InvalidOperationException(
$"The file {project.FilePath} is not a valid project file, " +
$"no <Project> at the root; could not fix project references.");
}
XDocument projectDoc = XDocument.Load(project.FilePath);

if (projectDoc.Root?.Name.LocalName != "Project")
{
throw new InvalidOperationException(
$"The file {project.FilePath} is not a valid project file, " +
$"no <Project> at the root; could not fix project references.");
}

// sdk style projects don't use a namespace for the elements,
// but we still need to use the namespace for non-sdk style projects.
var sdkStyle = projectDoc.Root.Attribute("Sdk") != null;
var itemGroupTagName = sdkStyle ? "ItemGroup" : NonSDKProjectFileNamespace + "ItemGroup";
var referenceTagName = sdkStyle ? "Reference" : NonSDKProjectFileNamespace + "Reference";
// sdk style projects don't use a namespace for the elements,
// but we still need to use the namespace for non-sdk style projects.
var sdkStyle = projectDoc.Root.Attribute("Sdk") != null;
var itemGroupTagName = sdkStyle ? "ItemGroup" : NonSDKProjectFileNamespace + "ItemGroup";
var referenceTagName = sdkStyle ? "Reference" : NonSDKProjectFileNamespace + "Reference";

var referencesItemGroups = projectDoc.Root
.Elements(itemGroupTagName)
.Where(e => e.Elements(referenceTagName).Any())
.ToList();
var referencesItemGroups = projectDoc.Root
.Elements(itemGroupTagName)
.Where(e => e.Elements(referenceTagName).Any())
.ToList();

foreach (var itemGroup in referencesItemGroups)
foreach (var itemGroup in referencesItemGroups)
{
FixProjectReferences(project.FilePath, itemGroup, projectsMap, sdkStyle);
}

projectDoc.Save(project.FilePath);
}
catch (Exception ex)
{
FixProjectReferences(project.FilePath, itemGroup, projectsMap, sdkStyle);
throw new Exception(
$"Failed to fix project references in {project.FilePath}.", ex);
}

projectDoc.Save(project.FilePath);
}
}

Expand Down
8 changes: 7 additions & 1 deletion ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="NuGet.Protocol" />
<PackageReference Include="System.Security.Cryptography.Pkcs" />
<PackageReference Include="Spectre.Console" />
<PackageReference Include="System.Threading.Channels" />
</ItemGroup>

<Target Name="ILSpyUpdateAssemblyInfo" AfterTargets="ResolveProjectReferences">
<ReadLinesFromFile ContinueOnError="true" File="..\VERSION">
<Output TaskParameter="Lines" PropertyName="PackageVersion" />
</ReadLinesFromFile>
</Target>


<PropertyGroup>
<ServerGarbageCollection>true</ServerGarbageCollection>
<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
</PropertyGroup>
</Project>
Loading
Loading