Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 8, 2025

In C# projects, .resx files and their referenced resources conventionally reside in a Resources directory. Using the same directory for LuYao.ResourcePacker causes files to be packaged twice—once by the .resx system and once by this library.

Changes

Core library:

  • Changed default ResourcePackerDirectory from "Resources" to "Attachments" in:
    • ResourcePackerTask.cs
    • ResourcePackageGenerator.cs
    • LuYao.ResourcePacker.MSBuild.props

Documentation:

  • Updated README with new default and backward compatibility note
  • Updated example project READMEs

Examples:

  • Renamed Resources/Attachments/ in all 7 example projects
  • Updated .csproj file references

Backward Compatibility

Users can override via MSBuild property:

<PropertyGroup>
    <ResourcePackerDirectory>Resources</ResourcePackerDirectory>
</PropertyGroup>

Rationale

Attachments is semantically appropriate for supplementary files "attached" to the application. It follows C# PascalCase conventions and won't conflict with standard resource management.

Original prompt

This section details on the original issue you should resolve

<issue_title>在 C# 项目中,默认的资源文件就是保存在 Resources 目录,这导致 .ResX 引用的文件被二次打包。</issue_title>
<issue_description>在 C# 项目中,默认的资源文件就是保存在 Resources 目录,这导致 .ResX 引用的文件被二次打包。我们是否修改一下规则,不使用 Resources 做为打包目录呢?

如果不适用 Resources 作为目录名,那应该用什么呢?</issue_description>

<agent_instructions>Android 项目因为是小写命名,他的目录名称是 res 。但是在 C# 目录中使用小写的 res 似乎不合适。</agent_instructions>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com>
Copilot AI changed the title [WIP] Modify default resources directory for C# project Change default resource directory from Resources to Assets Nov 8, 2025
Copilot finished work on behalf of Soar360 November 8, 2025 04:03
Copilot AI requested a review from Soar360 November 8, 2025 04:03
@Soar360
Copy link
Contributor

Soar360 commented Nov 8, 2025

@copilot 我感觉 Assets 也不太合适,是否 Attachments 更符合语义呢?

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

Copilot AI commented Nov 8, 2025

@copilot 我感觉 Assets 也不太合适,是否 Attachments 更符合语义呢?

Changed from "Assets" to "Attachments" as suggested. The change is more semantically appropriate for supplementary resource files. Commit d440348

Copilot AI changed the title Change default resource directory from Resources to Assets Change default resource directory from Resources to Attachments Nov 8, 2025
Copilot finished work on behalf of Soar360 November 8, 2025 04:39
@Soar360 Soar360 marked this pull request as ready for review November 8, 2025 04:52
@Soar360 Soar360 merged commit 8f54652 into main Nov 8, 2025
@Soar360 Soar360 deleted the copilot/modify-resources-directory branch November 8, 2025 04:52
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.

在 C# 项目中,默认的资源文件就是保存在 Resources 目录,这导致 .ResX 引用的文件被二次打包。

2 participants