Skip to content

Fix version mismatch between plugin.json and PowerToys display#83

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-version-number-issue
Open

Fix version mismatch between plugin.json and PowerToys display#83
Copilot wants to merge 4 commits intomainfrom
copilot/fix-version-number-issue

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

PowerToys Run displays "1.0.0.0" instead of "0.12.0" from plugin.json because it reads assembly metadata, not the manifest file.

Changes

Added version properties to Translater.csproj:

<Version>0.12.0</Version>
<AssemblyVersion>0.12.0</AssemblyVersion>
<FileVersion>0.12.0</FileVersion>

Without these properties, .NET defaults to "1.0.0.0" for all assembly versions.

These properties ensure:

  • Version: NuGet package version
  • AssemblyVersion: Assembly version that PowerToys reads and displays in the plugin panel
  • FileVersion: File version metadata

Result

After building the plugin with these changes, PowerToys Run will display "版本 0.12.0" instead of "V1.0.0.0", matching the version in plugin.json.

How to Update Version

To update the plugin version:

  1. Update all three version properties in Translater.csproj to the same version number
  2. Update the Version field in plugin.json to match
  3. Build the project
Original prompt

This section details on the original issue you should resolve

<issue_title>版本号与Power Toys Run插件面板中显示的版本号不一致</issue_title>
<issue_description>无论插件版本号是什么,在插件面板中版本号总为V1.0.0.0

Image

<agent_instructions>修复版本号不一致的问题</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@N0I0C0K 是一个问题!会尽快修复

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: N0I0C0K <30338746+N0I0C0K@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix version number mismatch in Power Toys Run plugin Fix version mismatch between plugin.json and PowerToys display Nov 18, 2025
Copilot AI requested a review from N0I0C0K November 18, 2025 03:25
@N0I0C0K
Copy link
Owner

N0I0C0K commented Nov 18, 2025

@copilot 再检查一下源代码中的版本是否也需要替换一下,最好能有一个方式统一起来写在一个地方

Co-authored-by: N0I0C0K <30338746+N0I0C0K@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 18, 2025

@copilot 再检查一下源代码中的版本是否也需要替换一下,最好能有一个方式统一起来写在一个地方

I've reviewed the source code and implemented a centralized version management system:

Changes in commit 63363de:

  1. Single source of truth: Version is now defined only in Translater.csproj (<Version>0.12.0</Version>)

  2. Auto-sync to plugin.json: Added MSBuild target that automatically updates plugin.json version during build

  3. Runtime access: Created VersionInfo.Version static property for accessing version in code

  4. Documentation: Added VERSION.md with instructions

About the "1.0.0" in source code:
The appVersion = "1.0.0" in YoudaoTranslatorV2.cs is a Youdao API client parameter (not our plugin version), so it should remain unchanged.

Future updates:
Developers only need to update the version in one place: the <Version> property in Translater.csproj. Everything else syncs automatically during build.

Copilot AI changed the title Fix version mismatch between plugin.json and PowerToys display Fix version mismatch and centralize version management Nov 18, 2025
@N0I0C0K N0I0C0K marked this pull request as ready for review November 18, 2025 06:12
@N0I0C0K
Copy link
Owner

N0I0C0K commented Nov 19, 2025

@copilot 不要做没用的开发,只需要将项目中版本号统一即可,删掉新增的文件

…perties

Co-authored-by: N0I0C0K <30338746+N0I0C0K@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot 不要做没用的开发,只需要将项目中版本号统一即可,删掉新增的文件

Removed the unnecessary files in commit cc6437e:

  • Deleted VERSION.md
  • Deleted src/VersionInfo.cs
  • Removed the auto-sync MSBuild target from Translater.csproj

The solution now only includes the three version properties in Translater.csproj that fix the original issue. To update the version in the future, update both the .csproj properties and plugin.json manually.

Copilot AI changed the title Fix version mismatch and centralize version management Fix version mismatch between plugin.json and PowerToys display Nov 19, 2025
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

Successfully merging this pull request may close these issues.

版本号与Power Toys Run插件面板中显示的版本号不一致

2 participants