升級至 .NET 8 並解決相容性問題#1
Hidden character warning
Conversation
- 在 `InfiniteDemand.csproj` 中: - 更新目標框架為 .NET 8,並設定語言版本為最新。 - 跳過匯入 `Mod.targets`,避免與 .NET 8 的 `ModPostProcessor` 問題。 - 新增 `<RunModPostProcessor>false</RunModPostProcessor>`。 - 在 `ilpp.pid` 中: - 將數值從 `13112` 修改為 `17400`。 - 在 `PublishConfiguration.xml` 中: - 更新 GitHub 外部連結至新的儲存庫。 - 新增註解,說明此版本基於 .NET 8 建置以提升效能與相容性。
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the InfiniteDemand mod to .NET 8 by updating the project configuration to target net8.0 and resolving compatibility issues with the game's build tooling. The changes avoid ModPostProcessor execution which may not be compatible with .NET 8, while maintaining proper reference resolution through selective import of build props.
- Modified
.csprojto target .NET 8 and skipMod.targets/ModPostProcessorto avoid compatibility issues - Updated GitHub repository URL to reflect new location
- Updated build process identifier in
ilpp.pid
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| InfiniteDemand/InfiniteDemand.csproj | Updated to target .NET 8, commented out Mod.targets import, and explicitly disabled ModPostProcessor |
| InfiniteDemand/Properties/PublishConfiguration.xml | Updated GitHub external link to new repository location |
| InfiniteDemand/Library/ilpp.pid | Updated process identifier from 13112 to 17400 |
| <TargetFramework>net8.0</TargetFramework> | ||
| <LangVersion>latest</LangVersion> | ||
| <GenerateDependencyFile>false</GenerateDependencyFile> | ||
| <!--Skip ModPostProcessor which may not be compatible with .NET 8--> |
There was a problem hiding this comment.
The comment states ModPostProcessor 'may not be compatible' with .NET 8, but this is speculative without concrete evidence. Consider documenting the specific incompatibility encountered (e.g., error message, behavior) or noting this is a preventive measure pending verification of .NET 8 compatibility.
| <!--Skip ModPostProcessor which may not be compatible with .NET 8--> | |
| <!--Preventively skip ModPostProcessor: .NET 8 compatibility has not been verified as of this release. If you encounter issues, please document the specific error here.--> |
| </PropertyGroup> | ||
|
|
||
| <!--Imports must be after PropertyGroup block--> | ||
| <!--Only import Mod.props for reference resolution, skip Mod.targets to avoid ModPostProcessor issues with .NET 8--> |
There was a problem hiding this comment.
Commenting out the Mod.targets import may cause build functionality loss beyond just ModPostProcessor. The comment should clarify what build steps/targets are being skipped and document any manual workarounds required (e.g., missing MSBuild tasks for PDX publishing, deployment steps). Consider whether critical build targets from Mod.targets need to be manually replicated.
| <!--Only import Mod.props for reference resolution, skip Mod.targets to avoid ModPostProcessor issues with .NET 8--> | |
| <!-- | |
| Only import Mod.props for reference resolution. | |
| Mod.targets is NOT imported to avoid ModPostProcessor issues with .NET 8. | |
| By skipping Mod.targets, the following build steps/targets are NOT run: | |
| - ModPostProcessor (custom post-build step, incompatible with .NET 8) | |
| - PDX publishing/deployment MSBuild targets (e.g., tasks for packaging and uploading to Paradox Mods) | |
| - Any other custom build steps defined in Mod.targets | |
| Manual workarounds required: | |
| - If publishing to Paradox Mods, use the Paradox launcher or upload manually. | |
| - Deployment: Copy output DLLs to the mod folder manually as needed. | |
| - If any other build steps from Mod.targets are required, replicate them manually in this .csproj. | |
| Re-enable the Mod.targets import ONLY if all targets are compatible with .NET 8. | |
| --> |
This pull request updates the project to improve compatibility with .NET 8 and ensures reference resolution works correctly while avoiding issues with the post-processing step. It also updates the project's GitHub link and adjusts build metadata.
.NET 8 migration and build configuration:
InfiniteDemand.csprojto only importMod.propsand skipMod.targetsto avoidModPostProcessorissues that may arise with .NET 8. Added a property to explicitly skip running theModPostProcessor.net8.0inInfiniteDemand.csprojto ensure compatibility with .NET 8.Project metadata and links:
PublishConfiguration.xmlto point to the new repository location.ilpp.pid, likely reflecting a new build or process state.- 在InfiniteDemand.csproj中:Mod.targets,避免與 .NET 8 的ModPostProcessor問題。<RunModPostProcessor>false</RunModPostProcessor>。在
ilpp.pid中:13112修改為17400。在
PublishConfiguration.xml中: