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

DocsByReflection exception during code generation #119

Open
wolfen351 opened this issue Jan 11, 2017 · 0 comments
Open

DocsByReflection exception during code generation #119

wolfen351 opened this issue Jan 11, 2017 · 0 comments

Comments

@wolfen351
Copy link
Collaborator

Hi there

Im getting the below exception when calling the proxies endpoint. This happens if I enable the XML documentation output in my project. I have hundreds of XML comments so I cant be specific on which one is failing. Please can WebAPIProxy catch this exception and silently ignore it? Or provide a parameter to disable documentation output for cases like this. Or even just provide a better error message, so I know which comment is freaking it out?

Many regards
Iain

{"Message":"An error has occurred.","ExceptionMessage":"Unable to cast object of type 'System.Xml.XmlComment' to type 'System.Xml.XmlElement'.","ExceptionType":"System.InvalidCastException","StackTrace":" at DocsByReflection.DocsTypeService.GetXmlFromName(Type type, Char prefix, String name, Boolean throwError)\r\n at DocsByReflection.DocsService.GetXmlFromType(Type type, Boolean throwError)\r\n at WebApiProxy.Server.MetadataProvider.GetDescription(Type type)\r\n at WebApiProxy.Server.MetadataProvider.AddModelDefinition(Type classToDef)\r\n at WebApiProxy.Server.MetadataProvider.ParseType(Type type, ModelDefinition model)\r\n at WebApiProxy.Server.MetadataProvider.<>c__DisplayClass17.b__c(ApiParameterDescription b)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)\r\n at WebApiProxy.Server.MetadataProvider.<>c__DisplayClass17.b__a(ApiDescription a)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at WebApiProxy.Server.Templates.JsProxyTemplate.TransformText()\r\n at WebApiProxy.Server.ProxyHandler.<>c__DisplayClass3.b__1()\r\n at System.Threading.Tasks.Task1.InnerInvoke()\r\n at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at WebApiProxy.Server.ProxyHandler.d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at Mybox.Server.Web.MyboxAPI.Providers.LogRequestAndResponseHandler.d__3.MoveNext() in C:\Stuff\Code\LaundryboxFreshSVN\mybox\branches\mobileapi\Franchise\Web\MyboxAPI\Providers\Logging.cs:line 102\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Owin.PassiveAuthenticationMessageHandler.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.HttpServer.d__0.MoveNext()"}

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

1 participant