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

Conflicts between ExcelFunction and ExcelFunctionDoc attribute #36

Open
casbby opened this issue Oct 31, 2021 · 1 comment
Open

Conflicts between ExcelFunction and ExcelFunctionDoc attribute #36

casbby opened this issue Oct 31, 2021 · 1 comment

Comments

@casbby
Copy link

casbby commented Oct 31, 2021

Hi

When I include both ExcelFunction and ExcelFunctionDoc function attributes the doc gen will fail

 Unhandled Exception: System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type found.
1>     at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)
1>     at ExcelDnaDoc.Utility.ExcelDnaHelper.IsValidFunction(MethodInfo method, Boolean explicitExports)
1>     at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
1>     at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
1>     at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
1>     at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
1>     at System.Linq.GroupedEnumerable`3.GetEnumerator()
1>     at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
1>     at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
1>     at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
1>     at ExcelDna.Documentation.Models.AddInModel.<get_Functions>d__13.MoveNext()
1>     at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
1>     at CompiledRazorTemplates.Dynamic.aafaffbb.Execute()
1>     at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
1>     at RazorEngine.Razor.Parse[T](String razorTemplate, T model)
1>     at ExcelDnaDoc.Templates.ViewBase`1.Publish()
1>     at ExcelDnaDoc.HtmlHelp.Create(String dnaPath, String helpSubfolder, Boolean excludeHidden, Boolean skipCompile, Boolean runAsync)
1>     at ExcelDnaDoc.Program.Main(String[] args)

I can see ExplicitRegistration and SuppressOverwriteError have been included in both attributes therefore this error seems to be logical outcome.

Can you please confirm this is a bug and advise?

Thank you very much.

Casbby

@govert
Copy link
Member

govert commented Nov 12, 2021

@casbby - I've made an update to the ExcelDnaDoc package on NuGet as v1.5.0-rc. This should now be compatible with ExcelDna v 1.5.0. Please let me know whether this works for you.

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

No branches or pull requests

2 participants