{"action":"created","issue":{"url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/64","repository_url":"https://api.github.com/repos/ArxOne/MrAdvice","labels_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/64/comments","events_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/64/events","html_url":"https://github.com/ArxOne/MrAdvice/issues/64","id":165010594,"number":64,"title":"methodAdviceContext.Proceed() throws an invocation exception on a Generic method that has a where constraint","user":{"login":"shirbr510","id":6445074,"avatar_url":"https://avatars.githubusercontent.com/u/6445074?v=3","gravatar_id":"","url":"https://api.github.com/users/shirbr510","html_url":"https://github.com/shirbr510","followers_url":"https://api.github.com/users/shirbr510/followers","following_url":"https://api.github.com/users/shirbr510/following{/other_user}","gists_url":"https://api.github.com/users/shirbr510/gists{/gist_id}","starred_url":"https://api.github.com/users/shirbr510/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirbr510/subscriptions","organizations_url":"https://api.github.com/users/shirbr510/orgs","repos_url":"https://api.github.com/users/shirbr510/repos","events_url":"https://api.github.com/users/shirbr510/events{/privacy}","received_events_url":"https://api.github.com/users/shirbr510/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-12T07:22:05Z","updated_at":"2016-07-12T08:54:54Z","closed_at":null,"body":"Hi Pascal.\r\n\r\nI have a class with many Gets that applies to the given interface:\r\n\r\n```\r\npublic interface IProviderFactory\r\n    {\r\n        IAvailableProjectWrapperProvider GetAvailableProjectProvider();\r\n        IPromoterProvider GetPromoterProvider();\r\n        IContactProvider<T> GetContactProvider<T>() where T : Contact;\r\n        IConnectedContactProvider GetConnectedContactProvider();\r\n        IDocumentProvider GetDocumentsProvider();\r\n        IPictureProvider GetPicturesProvider();\r\n        IVideoProvider GetVideosProvider();\r\n        IProjectAsyncProvider<T> GetGeneralProjectProvider<T>() where T : GeneralProject;\r\n        IStructureProvider GetStructureProvider();\r\n        IUserProvider GetUserProvider();\r\n        IPaymentWrapperProvider<T> GetPaymentProvider<T>() where T : PaymentWrapper;\r\n        IResellerProvider GetResellerProvider();\r\n        IUsersConnectionDetailsProvider GetIUsersConnectionDetailsProvider();\r\n        IGeneralVoteProvider GetGeneralVoteProvider();\r\n        ISmartAgentPropertyProvider GetSmartAgentPropertyProvider();\r\n        IGeneralClassCodeProvider GetGeneralClassCodeProvider();\r\n        IClassCodeUpdater GetGeneralClassCodeUpdater();\r\n        IUnderConstructionGeneralProjectProvider GetUnderConstructionProjectProvider();\r\n        IGeneralProjectTreeAsyncProvider GetGeneralProjectTreeProvider();\r\n        ISessionsProvider GetSessionsProvider();\r\n    }\r\n```\r\n\r\nI have decorated it with an AdviceAttribute and everything goes normal until getting to method `GetGeneralProjectProvider<T>()`.\r\n\r\nthe attribute works fine until the `methodAdviceContext.Proceed()` throws a `TargetInvocationException` on the call to the method.\r\n\r\nthe error's message is:\r\n\r\n`GenericArguments[0], 'T', on 'BuildinClickDAL.Providers.Projects.Abstract.IProjectProvider`1[T]' violates the constraint of type parameter 'T'.`\r\n\r\nthe error's stack trace is : \r\n\r\n```\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at ArxOne.MrAdvice.Advice.InnerMethodContext.Invoke()\r\n   at ArxOne.MrAdvice.Advice.SyncAdviceContext.Proceed()\r\n   at Buildin.Infrastructure.Logging.Attributes.LogThisAttribute.Advise(MethodAdviceContext context) in C:\\Git\\BuildinClick\\BuildinClickAPI\\Buildin.Infrastructure\\Logging\\Attributes\\LogThisAttribute.cs:line 32\r\n   at ArxOne.MrAdvice.Advice.MethodAdviceContext.Invoke()\r\n   at ArxOne.MrAdvice.Invocation.ProceedAdvice(Object target, Object[] parameters, MethodBase methodBase, MethodBase innerMethod, Boolean abstractedTarget, Type[] genericArguments)\r\n   at BuildinClickMongoDAL.Factories.MongoProviderFactory.GetGeneralProjectProvider[T]()\r\n   at BuildinClickWebApi.Jobs.SmartAgentJob..ctor() in C:\\Git\\BuildinClick\\BuildinClickAPI\\BuildinClickWebApi\\Jobs\\SmartAgentJob.cs:line 30\r\n```\r\n\r\nalso, there is an inner excpetion with stack trace:\r\n\r\n```\r\n   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)\r\n   at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()\r\n   at System.Reflection.RuntimeMethodInfo.GetParameters()\r\n   at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)\r\n   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)\r\n   at System.Exception.GetStackTrace(Boolean needFileInfo)\r\n   at System.Exception.get_StackTrace()\r\n   at System.Exception.PrepForRemoting()\r\n```\r\n\r\nwhat am I missing?\r\n\r\nI think it might be a bug"},"comment":{"url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/comments/231978467","html_url":"https://github.com/ArxOne/MrAdvice/issues/64#issuecomment-231978467","issue_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/64","id":231978467,"user":{"login":"shirbr510","id":6445074,"avatar_url":"https://avatars.githubusercontent.com/u/6445074?v=3","gravatar_id":"","url":"https://api.github.com/users/shirbr510","html_url":"https://github.com/shirbr510","followers_url":"https://api.github.com/users/shirbr510/followers","following_url":"https://api.github.com/users/shirbr510/following{/other_user}","gists_url":"https://api.github.com/users/shirbr510/gists{/gist_id}","starred_url":"https://api.github.com/users/shirbr510/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirbr510/subscriptions","organizations_url":"https://api.github.com/users/shirbr510/orgs","repos_url":"https://api.github.com/users/shirbr510/repos","events_url":"https://api.github.com/users/shirbr510/events{/privacy}","received_events_url":"https://api.github.com/users/shirbr510/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T08:54:54Z","updated_at":"2016-07-12T08:54:54Z","body":"Thank you. also it also just re-occurred on another method with\ngeneric constraint so I guess it is rather easy to reproduce\n\nOn 7/12/16, Pascal Craponne <notifications@github.com> wrote:\n> This looks like a bug... I am going to investigate on it.\n>\n> ---\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub:\n> https://github.com/ArxOne/MrAdvice/issues/64#issuecomment-231973863\n"}}
{"actor":{"display_login":"shirbr510"}}