Closed jnm2 closed 5 years ago
The parameter is required to ensure that calls to the task include all expected parameters. If data is not getting passed, we end up with other bugs that are even less informative. The solution here is to make sure that the call has the parameter set correctly.
What can we do so that it no longer forces me to declare a dummy \
😕 Is it treating an empty value the same as not passing anything at all?
I thought that was how it worked, let me double-check.
Can confirm, adding <NoWarn></NoWarn>
to the csproj does not fix the MSB4044 error. (Even if it did, I'd ask to not have to do that.)
My workaround for now is <NoWarn>_</NoWarn>
.
So we forgot to set AllowEmptyStrings
?
I didn't know about that property, thought RequiredAttribute was coming from an MSBuild namespace. Sounds like it would work.
Yep, seems the MSBuild version of this attribute does not have the same property. Checking into alternatives...
@jnm2 This property should not be marked as required, since MSBuild does not distinguish between empty and missing. The same applies for all string properties for which empty is a valid input.
This is on old-style csproj (stuck on old csproj only till 16.4 releases). Regardless, seems like a simple fix. Maybe we don't make it a required parameter after all? I didn't understand why we added it originally.
https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/blob/ea0490148d3c8b158b68ede5e81f1ccf012175f5/TunnelVisionLabs.ReferenceAssemblyAnnotator/AnnotatorBuildTask.cs#L53-L58