Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] fix the NuGetizer 3000 #3379

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Jul 22, 2019

Fixes: http://work.azdo.io/917139
Context: https://github.com/NuGet/Home/wiki/NuGetizer-Core-Features

The NuGetizer 3000, was failing on Xamarin.Android 9.4 with:

The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild".

This tool runs a GetPackageContents MSBuild target that is defined
here:

https://github.com/NuGet/NuGet.Build.Packaging/blob/dev/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets#L201

Since this isn't a Build or a Compile, neither of these targets
will run:

  • _SetupDesignTimeBuildForBuild
  • _SetupDesignTimeBuildForCompile

I don't think we can make the _AddAndroidCustomMetaData MSBuild
target (that runs <FilterAssemblies/>) depend on either of these.

The simple fix is to just remove [Required] from the
DesignTimeBuild property, as it will be fine for it to default to
false.

/cc @mrward @kzu

Fixes: http://work.azdo.io/917139
Context: https://github.com/NuGet/Home/wiki/NuGetizer-Core-Features

The NuGetizer 3000, was failing on Xamarin.Android 9.4 with:

    The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild".

This tool runs a `GetPackageContents` MSBuild target that is defined
here:

    https://github.com/NuGet/NuGet.Build.Packaging/blob/dev/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets#L201

Since this isn't a `Build` or a `Compile`, neither of these targets
will run:

* `_SetupDesignTimeBuildForBuild`
* `_SetupDesignTimeBuildForCompile`

I don't think we can make the `_AddAndroidCustomMetaData` MSBuild
target (that runs `<FilterAssemblies/>`) depend on either of these.

The simple fix is to just remove `[Required]` from the
`DesignTimeBuild` property, as it will be fine for it to default to
`false`.
Copy link

@mrward mrward left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@jalbertSyncroTech
Copy link

Any updates on a release of this fix? We're in the process of evaluating VS2019 16.2 coming from 16.1.3, but our Release builds which generate NuGet packages are failing with this error message.

@jonathanpeppers
Copy link
Member Author

@jalbertSyncroTech you didn't mention how you are running your build, but you can workaround by setting the MSBuild property:

msbuild foo.csproj /p:DesignTimeBuild=False

You can also try setting it in your csproj file if you are using the IDE.

@jalbertSyncroTech
Copy link

jalbertSyncroTech commented Jul 30, 2019

Thanks @jonathanpeppers! Explicitly setting DesignTimeBuild to false resolved the error message, I was able to add this to a .targets file that's we reference from every .csproj in our solution that does NuGet packaging. For reference, we use VS2019 both for TFS continuous integration builds and for developer IDE builds.

I'd expect that any Xamarin.Android users who create NuGet packages may run into this, so you may want to add a comment to the VS2019 16.2 Release Notes.

@jonpryor jonpryor merged commit e13408f into dotnet:master Jul 30, 2019
jonpryor pushed a commit that referenced this pull request Jul 30, 2019
Fixes: http://work.azdo.io/917139
Context: https://github.com/NuGet/Home/wiki/NuGetizer-Core-Features

The NuGetizer 3000, was failing on Xamarin.Android 9.4 with:

	The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild".

This tool runs a `GetPackageContents` MSBuild target that is defined
in the [`NuGet.Build.Packaging` MSBuild targets][0].

Since this isn't a `Build` or a `Compile`, neither of these targets
will run:

  * `_SetupDesignTimeBuildForBuild`
  * `_SetupDesignTimeBuildForCompile`

I don't think we can make the `_AddAndroidCustomMetaData` MSBuild
target (that runs `<FilterAssemblies/>`) depend on either of these.

The simple fix is to just remove `[Required]` from the
`FilterAssemblies.DesignTimeBuild` property, as it will be fine for
it to default to `false`.

[0]: https://github.com/NuGet/NuGet.Build.Packaging/blob/88f9e4b5e95c0d2b7b7ac12fb721675a851fcd5d/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets#L201
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants