Error "PostSharp.Sdk.CodeModel.BindingException: Cannot get the reflection object for"

joey.li's Avatar

joey.li

16 Jan, 2018 07:23 AM

PostSharp Version: 5.0.43.0

I previously has a method with signature below. I can be compiled without problem.
SendMail(System.Net.Mail.MailAddress, System.Net.Mail.MailAddress[], System.Net.Mail.MailAddress[], System.String, System.String)

However, I got the following build time exception whenever I change the signature of the captioned method.
+ Change the method name ==> failed
+ Add more method arguments == failed

I seems that I also cannot add any new method to the project.

Severity Code Description Project File Line Suppression State
Error Unhandled exception (postsharp-net40-x86-srv.exe release | .NET Framework 4.6.1): PostSharp.Sdk.CodeModel.BindingException: Cannot get the reflection object for 'CompanyXXX.LeaveApproval.Net.Mail.SmtpService.SendMail2(System.Net.Mail.MailAddress, System.Net.Mail.MailAddress[], System.Net.Mail.MailAddress[], System.String, System.String)'.
   at ^Mzw3\.bgGgRlJ.^cCM832sT[??0](Object _0, BindingOptions _1, ^d1u4kZd5aJLe _2)
   at PostSharp.Sdk.CodeModel.MethodDefDeclaration.GetSystemMethod(Type[] genericTypeArguments, Type[] genericMethodArguments, BindingOptions bindingOptions)
   at PostSharp.Sdk.CodeModel.MethodDefDeclaration.^xHA5o+hH(Type[] _0, Type[] _1, BindingOptions _2)
   at PostSharp.Sdk.CodeModel.MetadataDeclaration.^UDRJYqgBJZ7t(Type[] _0, Type[] _1, BindingOptions _2)
   at PostSharp.Sdk.AspectWeaver.AspectWeaverInstance..ctor(AspectWeaver aspectWeaver, AspectInstanceInfo aspectInstanceInfo)
   at PostSharp.Sdk.AspectWeaver.AspectWeavers.MethodLevelAspectWeaverInstance..ctor(MethodLevelAspectWeaver aspectWeaver, AspectInstanceInfo aspectInstanceInfo)
   at ^wy1eTA/ccvw/.CreateAspectWeaverInstance(AspectInstanceInfo _0)
   at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^lp9i7ZhC(InstructionWriter _0, AspectInstanceInfo _1, StructuredDeclarationDictionary`1 _2)
   at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^gJhZb6Cg.^KzeTZ0pV(IMetadataDeclaration _0, AspectInstanceInfo _1)
   at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^lNgKC+Z4(IMetadataDeclaration _0, Func`3 _1)
   at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^v4\.zwEyH.^8/pSq47Q(IMetadataDeclaration _0)
   at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^d+wOzSPF(IMetadataDeclaration _0, Func`2 _1)
   at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^+g+TCqVg(TypeDefDeclaration _0, Func`2 _1, Set`1 _2)
   at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^fJqG(Func`2 _0)
   at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^fJqG(Func`3 _0)
   at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.Execute()
   at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
   at PostSharp.Sdk.Extensibility.Project.Execute()
   at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
   at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation). CompanyXXX.LeaveApproval

  1. Support Staff 1 Posted by PostSharp Techn... on 16 Jan, 2018 03:49 PM

    PostSharp Technologies's Avatar

    Hello,

    thank you for reporting this issue.

    Unfortunately we are not able to reproduce the issue. Please, could you provide us a minimal example project that reproduces the issue?

    Best regards,
    -jakub

  2. Support Staff 2 Posted by PostSharp Techn... on 24 Jan, 2018 04:30 PM

    PostSharp Technologies's Avatar

    Hello,

    We are going to close this request as there have not been any further updates. Please feel free to reopen the discussion if you need more help.

    Thanks,
    PostSharp Team

  3. PostSharp Technologies closed this discussion on 24 Jan, 2018 04:30 PM.

  4. joey.li re-opened this discussion on 25 Jan, 2018 12:57 AM

  5. 3 Posted by joey.li on 25 Jan, 2018 12:57 AM

    joey.li's Avatar

    Eventually, I have to re-create the Visual Studio project and add back all project items to resolve this problem.

  6. Support Staff 4 Posted by PostSharp Techn... on 29 Jan, 2018 10:27 AM

    PostSharp Technologies's Avatar

    Hello,

    Thank you for the update.

    We are going to close this request as we believe it was solved. Please feel free to reopen the discussion if you need more help.

    Best regards,
    -tony

  7. PostSharp Technologies closed this discussion on 29 Jan, 2018 10:27 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac