豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Pack target can't create contentFiles with build actions correctly #4166

@clairernovotny

Description

@clairernovotny

When reviewing the spec for the Pack target
https://github.com/NuGet/Home/wiki/Adding-nuget-pack-as-a-msbuild-target

In the section where it talks about contentFiles, it says"

Apart from Content items, the <Pack> and <PackagePath> metadata can also be set on files with Build Action = Compile, EmbeddedResource, ApplicationDefinition, Page, Resource, SplashScreen, DesignData, DesignDataWithDesignTimeCreatableTypes, CodeAnalysisDictionary, AndroidAsset, AndroidResource, BundleResource or None.

I'm not sure how that's going to work correctly. The content that I want to pack is not going to be of that type in the library itself. For example, in my xUnit for Devices library, I have an App.Xaml.pp that is "Content" in my library, but the buildAction needs to be ApplicationDefinition. It cannot be "ApplicationDefinition" with metadata in the library itself.

What it needs is Content or None with a metadata BuildAction where I can specify what it should be in the nuget.

But that's not enough either. It also needs to provide arbitrary key/value metadata that will go on the generated item. For example I need a "Generator" metadata with the value of MSBuild:Compile to go on the XAML ones.

XAML Forms requires other similar things too. Rather than hard-code every combination of metadata that gets attached to the generated item, something more generic that encodes a key/value pair would be better.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions