JustMock Profiler causes error when starting VSTO addin from Visual Studio

7 posts, 0 answers
  1. Frank
    Frank avatar
    1 posts
    Member since:
    Oct 2013

    Posted 30 Oct 2013 Link to this post

    Hi,

    we encountered following problem with the JustMock profiler.
    We have an Outlook VSTO addin. If I start the VSTO addin with debug mode from VS with running JustMock profiler VSTO throws me following error:

    ************** Exception Text **************
    System.MethodAccessException: UnsafeNativeMethods._AxlGetIssuerPublicKeyHash(IntPtr, Microsoft.Win32.SafeHandles.SafeAxlBufferHandle ByRef)
       bei System.Security.Cryptography.X509Certificates.X509Native.UnsafeNativeMethods._AxlGetIssuerPublicKeyHash(IntPtr pCertContext, SafeAxlBufferHandle& ppwszPublicKeyHash)
       bei System.Security.Cryptography.Xml.ManifestSignedXml.VerifyAuthenticodePublisher(X509Certificate2 publisherCertificate)
       bei System.Security.Cryptography.Xml.ManifestSignedXml.VerifyAuthenticodeSignature(XmlElement signatureNode, X509RevocationFlag revocationFlag, X509RevocationMode revocationMode)
       bei System.Security.Cryptography.Xml.ManifestSignedXml.VerifySignature(X509RevocationFlag revocationFlag, X509RevocationMode revocationMode)
       bei System.Security.Cryptography.ManifestSignatureInformation.VerifySignature(ActivationContext application, ManifestKinds manifests, X509RevocationFlag revocationFlag, X509RevocationMode revocationMode)
       bei Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInTrustEvaluator.VerifyCertificateSignature(ActivationContext context, OnlineOfflineState offlineState, String productName, DeploymentSignatureInformation& signatureInformation)
       bei Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySecurity(ActivationContext context, Uri manifest, AddInInstallationStatus installState)
       bei Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5472 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Office.Runtime.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.40305.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.v10.0.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.40305.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.40305.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0
        Assembly Version: 9.0.0.0
        Win32 Version: 9.0.30729.5806
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0/9.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.40305.0
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Core
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.30729.5420 built by: Win7SP1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    Accessibility
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    System.Deployment
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5476 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Security
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5475 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.dll
    ----------------------------------------
    System.Deployment.resources
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Deployment.resources/2.0.0.0_de_b03f5f7f11d50a3a/System.Deployment.resources.dll
    ----------------------------------------
    mscorlib.resources
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5472 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    System.Xml.Linq
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.30729.5420 built by: Win7SP1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll
    ----------------------------------------

    VSTO Error:

    NET Runtime version 2.0.50727.5472 - Failed to CoCreate profiler.


    If I deactivate the profiler everything works fine.

    Best regards
  2. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 01 Nov 2013 Link to this post

    Hi Frank,

    Thank you for contacting us.

    To be able to investigate the issue further, we will require some additional information:
    1. What Visual Studio are you using in order to reproduce the issue?
    2. What is the .NET version of the project?
    3. Which is the Outlook version that your application is targeting (e.g., Outlook 2003/Outlook2007/etc...)?

    Thank you for the help in advance.

    Regards,
    Kaloyan
    Telerik
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
  3. DevCraft R3 2016 release webinar banner
  4. Mark
    Mark avatar
    14 posts
    Member since:
    Jul 2013

    Posted 05 Nov 2013 Link to this post

    Hi,

    Frank is currently in vacations so I will answer the question for him.

    We have:
    Visual Studio 2010 (10.0.40219.1 SP1 Rel)
    The project's .Net Version is .NET Framework 3.5 SP1
    VSTO Version is 2010
    On the development system where the problem occurs we are using Office 2007 SP 3 with PIA 2007.

    Thank you
    Mark

  5. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 05 Nov 2013 Link to this post

    Hi Mark,

    Thank you for clarifying this.

    We will investigate the issue on our side and will contact you when we have any results.

    Regards,
    Kaloyan
    Telerik
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
  6. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 11 Nov 2013 Link to this post

    Hi,

    We tried to reproduce the issue on the exact same environment. Unfortunately, we had no success with this. What we tried was:
    1. We configured the proper environment by installing all the above mentioned software.
    2. We created a new (default) Outlook 2007 Add-in project.
    3. Then, we tried to debug it and it worked as expected. No error events were detected in the event viewer.

    To be able to assist you further, we need to know if the matter occurs in a specific project by running a custom logic? And if it is so, can you send us that project?

    Further, I will recommend to keep the JustMock profiler disabled, while you are debugging/running your applications. In other words, enable the profiler only when you are executing unit tests. This should prevent situations like the issue you have came across.

    Thank you for the cooperation and understanding so far. I am expecting your reply.

    Regards,
    Kaloyan
    Telerik
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
  7. Mark
    Mark avatar
    14 posts
    Member since:
    Jul 2013

    Posted 13 Nov 2013 Link to this post

    Hi,

    thank you for your answer.
    Yes we have already disabled the profiler so this issue is nothing critical. :-)

    I also tried to investigate this further and it seems that it has to do with the Resharper addin.
    I suspended the resharper plugin and created a new project and it worked fine.
    Then I reactivated resharper and retried but couldn't reproduce the issue.

    However I still have a test project where this error occurs .
    To which address should I send you the project? You can send me an email with the address then I will send you the project to this email address.

    Thank you
    Mark
  8. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 18 Nov 2013 Link to this post

    Hi Mark,

    Thank you for coming back to us with the good news. I am glad the issue is solved now.

    At this point we won't require the repro project. However, if the above matter occurs again, please contact us in this thread.

    Have a nice day and happy mocking :).

    Regards,
    Kaloyan
    Telerik
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Back to Top
DevCraft R3 2016 release webinar banner