none
Sync 4 using code: Could not load assembly MS.Sync.Services

    Question

  • Hi guys,

    Big props for getting the code for the sync framework up on the weekend. I'm having an issue integrating it into my solution however. I removed the references to the Micorosft.Synchronization.Services.dll file which was found in the Program Files folders (the installed October CTP) from my service project. I added the SyncServiceLib project from the code to my solution. I added a Project reference from my sync service project to SyncServiceLib. Everything builds fine but when I run the solution and then query the service in IE (for example trying to run the $diag test) it returns a page with the following error on it. I'm assuming that WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN is where the problem lies but I've uninstalled the October CTP and scoured my PC for other copies of the dll and can't find any that could be causing this problem...

    Server Error in '/ColdFusionService' Application.

     

    Could not load file or assembly 'Microsoft.Synchronization.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

     

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Synchronization.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.

    === Pre-bind state information ===
    LOG: User = Development\Peter Mauger
    LOG: DisplayName = Microsoft.Synchronization.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
     (Fully-specified)
    LOG: Appbase = file:///D:/CodeWorking/Red Nightingale/ColdFusion/src/app/Services/ColdFusionService/
    LOG: Initial PrivatePath = D:\CodeWorking\Red Nightingale\ColdFusion\src\app\Services\ColdFusionService\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: D:\CodeWorking\Red Nightingale\ColdFusion\src\app\Services\ColdFusionService\web.config
    LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: Microsoft.Synchronization.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/coldfusionservice/8fabe02f/71799868/Microsoft.Synchronization.Services.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/coldfusionservice/8fabe02f/71799868/Microsoft.Synchronization.Services/Microsoft.Synchronization.Services.DLL.
    LOG: Attempting download of new URL file:///D:/CodeWorking/Red Nightingale/ColdFusion/src/app/Services/ColdFusionService/bin/Microsoft.Synchronization.Services.DLL.
    WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
    ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
    


    Stack Trace:

    [FileLoadException: Could not load file or assembly 'Microsoft.Synchronization.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +95
       System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +54
       System.Type.GetType(String typeName, Boolean throwOnError) +59
       System.ServiceModel.Activation.ServiceParser.GetType(String typeName) +62
       System.ServiceModel.Activation.ServiceParser.GetCompiledType(Assembly compiledAssembly) +76
       System.ServiceModel.Activation.ServiceParser.CreateParseString(Assembly compiledAssembly) +44
       System.ServiceModel.Activation.ServiceBuildProvider.GetCustomString(CompilerResults results) +32
       System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +235
       System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16
       System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +9031202
       System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +320
       System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +111
       System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) +90
       System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +29
       System.ServiceModel.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) +161
       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +208
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +615
    
    [ServiceActivationException: The service '/ColdFusionService/sync.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not load file or assembly 'Microsoft.Synchronization.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).]
       System.Runtime.AsyncResult.End(IAsyncResult result) +687598
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
       System.ServiceModel.Activation.ServiceHttpHandler.EndProcessRequest(IAsyncResult result) +6
       System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +96
    

     


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

    Sunday, September 11, 2011 10:39 PM

Answers

  • got bitten by this same one and spent hours on it.

    if you're running the listservice sample, open up the svc file, change the version to 1.0.0.0 and remove the PublicKeyToken

     

    • Marked as answer by Peter Mauger Monday, September 12, 2011 12:03 AM
    Sunday, September 11, 2011 11:59 PM
    Moderator

All replies

  • got bitten by this same one and spent hours on it.

    if you're running the listservice sample, open up the svc file, change the version to 1.0.0.0 and remove the PublicKeyToken

     

    • Marked as answer by Peter Mauger Monday, September 12, 2011 12:03 AM
    Sunday, September 11, 2011 11:59 PM
    Moderator
  • Champion!
    Monday, September 12, 2011 12:03 AM
  • Also be sure to change the value in any .config files that was created by the CTP SyncSvcUtil.
    Michael
    Tuesday, September 13, 2011 8:37 PM