Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
SQL Server CE 3.5.1.50 in Project conflicts with 3.5.1.0 in GAC

Unanswered SQL Server CE 3.5.1.50 in Project conflicts with 3.5.1.0 in GAC

  • Wednesday, January 16, 2013 6:14 AM
     
     

    I am trying to publish a VS 2012 project and are using SQL Compact 3.5.1.50 and EF 4.0.  I have read all of EricEJ's articles (http://erikej.blogspot.com/2012/05/private-deployment-of-sql-server.html) on how to get Private deployment to work.  Thanks to his articles, I have worked through several problems.  But the problem that I am having now is that on my Dev machine my GAC has 3.5.1.0 installed and when EF project is called I get the error:

    [A]System.Data.SqlServerCe.SqlCeConnection cannot be cast to [B]System.Data.SqlServerCe.SqlCeConnection. 
    Type A originates from 'System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91' in the context 'Default' at location '\CustomerApplicationWPF\bin\Debug\System.Data.SqlServerCe.dll'. 
    Type B originates from 'System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\System.Data.SqlServerCe\3.5.1.0__89845dcd8080cc91\System.Data.SqlServerCe.dll'.

    If I try to use the install on a different machine, I get the error:

    The file 'C:\Users\xxx\AppData\Local\Temp\Deployment\6C6J1Q4E.CW7\6BDZDO78.1XR\System.Data.SqlServerCe.dll' already exists.

    I have tried:

    * Upgrading my GAC System.Data.SqlServerCe to 3.5.1.50, but it did not change the version

    * Uninstalling System.Data.SqlServerCe 3.5.1.0 in the GAC

    * Changing the App.Config DbProviderFactories to use 3.5.1.0

    Nothing works.  I usually get a message on the non-Dev machine that System.Data.SqlServerCe must be first installed in the GAC, which I do not want to do.

All Replies

  • Wednesday, January 16, 2013 9:07 AM
    Moderator
     
     
    Could you share your app.config settings? And do all your Projects reference assembly version 3.5.1.50 ?

    Please mark as answer, if this was it. Visit my SQL Server Compact blog

  • Wednesday, January 16, 2013 1:24 PM
     
      Has Code

    Yes, System.Data.SqlServerCe and System.Data.SqlServerCe.Entity point to version 3.5.1.50.

    Not sure if it matters, but I also have a reference to Microsoft.Synchronization.Data.SqlServerCe w/ v 3.1.0.0

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
      <connectionStrings>
      </connectionStrings>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v11.0" />
          </parameters>
        </defaultConnectionFactory>
      </entityFramework>
    <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.SqlServerCe.3.5" />
          <add 
            name="Microsoft SQL Server Compact Data Provider 3.5" 
            invariant="System.Data.SqlServerCe.3.5" 
            description=".NET Framework Data Provider for Microsoft SQL Server Compact" 
            type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91" 
          />
        </DbProviderFactories>
      </system.data>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly xmlns="">
            <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral" />
            <bindingRedirect oldVersion="3.5.1.0-3.5.1.50" newVersion="3.5.1.50" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>



  • Wednesday, January 16, 2013 6:20 PM
    Moderator
     
     
    I am sure the Sync fx DLL also references 3.5.1.0, so you should try to add a binding redirect for this one also.

    Please mark as answer, if this was it. Visit my SQL Server Compact blog

  • Thursday, January 17, 2013 4:39 AM
     
      Has Code

    I went back through and followed the articles on an empty brand new project.  The resulting setup file fails saying "An error has occurred writing to the hard disk" with the details:

    PLATFORM VERSION INFO
    	Windows 			: 6.1.7601.65536 (Win32NT)
    	Common Language Runtime 	: 4.0.30319.17929
    	System.Deployment.dll 		: 4.0.30319.17929 built by: FX45RTMREL
    	clr.dll 			: 4.0.30319.17929 built by: FX45RTMREL
    	dfdll.dll 			: 4.0.30319.17929 built by: FX45RTMREL
    	dfshim.dll 			: 4.0.41209.0 (Main.041209-0000)
    
    SOURCES
    	Deployment url			: file:///C:/dev/rrrr/Trunk/dddd/Sandbox/NewPrivateDeploy35SP2/NewPrivateDeploy35SP2/publish/NewPrivateDeploy35SP2.application
    	Application url			: file:///C:/dev/rrrr/Trunk/dddd/Sandbox/NewPrivateDeploy35SP2/NewPrivateDeploy35SP2/publish/Application%20Files/NewPrivateDeploy35SP2_1_0_0_9/NewPrivateDeploy35SP2.exe.manifest
    
    IDENTITIES
    	Deployment Identity		: NewPrivateDeploy35SP2.application, Version=1.0.0.9, Culture=neutral, PublicKeyToken=1e78f0dc76fcc752, processorArchitecture=msil
    	Application Identity		: NewPrivateDeploy35SP2.exe, Version=1.0.0.9, Culture=neutral, PublicKeyToken=1e78f0dc76fcc752, processorArchitecture=msil, type=win32
    
    APPLICATION SUMMARY
    	* Installable application.
    
    ERROR SUMMARY
    	Below is a summary of the errors, details of these errors are listed later in the log.
    	* Activation of C:\dev\rrrr\Trunk\dddd\Sandbox\NewPrivateDeploy35SP2\NewPrivateDeploy35SP2\publish\NewPrivateDeploy35SP2.application resulted in exception. Following failure messages were detected:
    		+ Downloading file:///C:/dev/rrrr/Trunk/dddd/Sandbox/NewPrivateDeploy35SP2/NewPrivateDeploy35SP2/publish/Application Files/NewPrivateDeploy35SP2_1_0_0_9/System.Data.SqlServerCe.dll.deploy did not succeed.
    		+ The file 'C:\Users\mmmm\AppData\Local\Temp\Deployment\D93OKHHC.YXW\GBC965P6.0ZP\System.Data.SqlServerCe.dll' already exists.
    
    COMPONENT STORE TRANSACTION FAILURE SUMMARY
    	No transaction error was detected.
    
    WARNINGS
    	There were no warnings during this operation.
    
    OPERATION PROGRESS STATUS
    	* [1/16/2013 2:10:30 PM] : Activation of C:\dev\rrrr\Trunk\dddd\Sandbox\NewPrivateDeploy35SP2\NewPrivateDeploy35SP2\publish\NewPrivateDeploy35SP2.application has started.
    	* [1/16/2013 2:10:30 PM] : Processing of deployment manifest has successfully completed.
    	* [1/16/2013 2:10:30 PM] : Installation of the application has started.
    	* [1/16/2013 2:10:30 PM] : Processing of application manifest has successfully completed.
    	* [1/16/2013 2:10:34 PM] : Found compatible runtime version 2.0.50727.
    	* [1/16/2013 2:10:34 PM] : Detecting dependent assembly Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil using Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil.
    	* [1/16/2013 2:10:34 PM] : Detecting dependent assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
    	* [1/16/2013 2:10:34 PM] : Detecting dependent assembly WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=msil using WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=msil.
    	* [1/16/2013 2:10:34 PM] : Detecting dependent assembly System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
    	* [1/16/2013 2:10:34 PM] : Request of trust and detection of platform is complete.
    
    ERROR DETAILS
    	Following errors were detected during this operation.
    	* [1/16/2013 2:10:34 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
    		- Downloading file:///C:/dev/rrrr/Trunk/dddd/Sandbox/NewPrivateDeploy35SP2/NewPrivateDeploy35SP2/publish/Application Files/NewPrivateDeploy35SP2_1_0_0_9/System.Data.SqlServerCe.dll.deploy did not succeed.
    		- Source: System.Deployment
    		- Stack trace:
    			at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
    			at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
    			at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
    			at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
    			at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
    			at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
    			at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
    			at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
    		--- Inner Exception ---
    		System.IO.IOException
    		- The file 'C:\Users\mmmm\AppData\Local\Temp\Deployment\D93OKHHC.YXW\GBC965P6.0ZP\System.Data.SqlServerCe.dll' already exists.
    		- Source: mscorlib
    		- Stack trace:
    			at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    			at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    			at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
    			at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
    			at System.Deployment.Application.SystemNetDownloader.GetOutputFileStream(String targetPath)
    			at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
    
    COMPONENT STORE TRANSACTION DETAILS
    	No transaction information is available.
    

  • Thursday, January 17, 2013 2:17 PM
    Moderator
     
     
    That error seems to be click once releated, suggest you leave that out of the equation for now, and just use xcopy deployement when testing... When that Works, introduce Click Once.

    Please mark as answer, if this was it. Visit my SQL Server Compact blog