none
Why VS check the assembly's timestamp while we request exported service by MEF

    Question

  • Hi Everyone,

    We meet a MEF cache issue with VS2015 RTM.

    We installed SM.LanguageService.dll as an extension in Visual Studio by Vsix.

    In the VS log, we got such error:
    Assembly timestamp in MEF Cache does not match loaded assembly timestamp
        SM.LanguageService, Version=6.1.13.1, Culture=neutral, PublicKeyToken=dcdf48f0f8024578; code-base: file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/EXTENSIONS/FMGYETVZ.QVL/SM.LanguageService.dll

    The loaded assembly path = "C:\Program Files (x86)\Unisys\AB Suite 6.0\Bin" and the cached assembly path = "C:\Program Files (x86)/Microsoft Visual Studio 14.0\Common7\IDE\Extensions\fmgyetvz.qvl\"
    The loaded assembly path is our product installation path and the cached assembly path is an extension path and is generated by VS while we install SM.LanguageService.dll by VSIX package.

     

    The extension.vsixmanifest configuration for installing SM.LanguageService.dll

    <PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">   <Metadata>  <Identity Id="SM.LanguageService.VSIXInstaller.b49504f6-b41e-4dec-8883-7e51268df9b0" Version="1.0" Language="en-US" Publisher="Unisys" />  <DisplayName>System Modeler LDL+ Language Service</DisplayName>  <Description xml:space="preserve">Agile Business Suite Development Environment Language Service</Description>   </Metadata>   <Installation AllUsers="true">  <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0]" />   </Installation>   <Dependencies>  <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.6,)" />   </Dependencies>   <Assets>  <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="SM.LanguageService" Path="|SM.LanguageService|" />   </Assets> </PackageManifest>


    We compared the dll in the two paths, their binary are equal.
    The timestamp of the SM.LanguageService.dll in loaded assembly path is its last build time(Timestamp=12/23/2015 3:15:06 AM) while in cached assembly path is the extension installed time(Timestamp=1/4/2016 9:03:29 AM).

    We are confused that why VS check the dll's timestamp while we request exported service?
    Is there any effective way to help us avoid this issue?
    Thanks & Regards,
    Jupiter Team

    Tuesday, January 5, 2016 7:26 AM

Answers

  • Hi Jupiter Team,

    Please create a new simple project to make sure this problem occurs with all projects or just this specific project.

    >>We are confused that why VS check the dll's timestamp while we request exported service?

    Visual Studio caches something which ma be used in future to speed up when it used next time. So I think when Visual Studio try to retrieve next time, it need to make sure it is the latest version which need to compare the timestamp to confirm it get the latest version.

    >>Is there any effective way to help us avoid this issue?

    Visual Studio caches is a default action and I don't find such settings in Visual Studio to disable it. But we can clear Visual Studio caches with command "Devenv /ClearCache".

    And there also has a component which is against MEF Caches, please try with it from below link. Hope it can help you.

    https://visualstudiogallery.msdn.microsoft.com/22b94661-70c7-4a93-9ca3-8b6dd45f47cd

    Best Regards,
    Weiwei

    Wednesday, January 6, 2016 7:53 AM
    Moderator