The target attribute is missing or has no value

Topics: User Forum
Apr 8, 2013 at 6:17 PM
After upgrading to latest version, I am getting an error from buildassenbler in one of my existing project: "The target attribute is missing or has no value [C:\Dev\AF\Dev\SDK\Doc\SDKRef\Working\BuildReferenceTopics.proj]". There does not appear to be any indication of what is causing the problem.
Apr 8, 2013 at 8:25 PM
Delete, re-add, and then re-configure any build components and/or plug-ins in the project. It's most likely an outdated configuration.

Apr 8, 2013 at 9:03 PM
I created a new SHFB project with the same C# project as the documentation source and all the rest left as defaults (no plug-ins or build components) and I still get the same error. So I think it must be something in this project because other projects build without error.
Apr 8, 2013 at 9:08 PM
If I use the API filter to filter out most of the classes, then it works. I don't have enough information in the error message to locate the problem. I can try working with the API filter until I can narrow down the cause.
Apr 8, 2013 at 10:19 PM
The cause of the problem is there was a '<seealso langword="null"/>' in a param section instead of 'see'. It would have been very helpful if the error message could have given a hint as to where the issue was. But I was able to narrow it down using the API filter to find the offending method.
Apr 9, 2013 at 2:29 AM
Setting the BuildAsssembler verbosity to show informational messages would have helped as it would have reported the API member's ID prior to failing.

Apr 12, 2013 at 1:31 PM
What would need to be changed to have the error actually provide a line number in the xml that it was choking on?
Apr 12, 2013 at 7:22 PM
Line numbers are irrelevant at the point the exception is thrown. It's caused by a referenceLink element generated by the XSL transformations that doesn't have a target attribute value. As such, it's in the generated topic. As noted, turning on informational messages will let you get the member ID or topic ID in which the failure is occurring. Locating it is just a matter of going to that member or topic and finding the see, seelaso, exception, or other element that's missing or has an empty cref attribute. If it's in MAML, it'll most likely be an empty codeEntityReference element.

The change occurred when I refactored the component and its supporting classes. I'll convert it back to a warning for the next release to avoid confusion in the future. It'll then do what it did in the past and generate nothing so the topic won't contain a link or any text where it should be.