Random binary signature exception
-
Thursday, January 27, 2011 4:06 PM
Hello,
I've an app (windows service) that is using SQL Serve Compact 4.0 data provider. The app works well, and uses the local database without problem. Then, after a while, it starts to report this error.
How can be? If the file is wrong, it may report this from first db access, not after a while (and a lot of operations)!
thanks
System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlServerCe.SqlCeException: The signature verification of the SQL Server Compact native binaries has failed. This could be due to the presence of incorrect version of the SQL Server Compact native binaries or the binaries may be from a different source than Microsoft. Please install SQL Server Compact binaries that have been digitally signed by Microsoft. [ DLL Name = sqlcese40.dll ]
at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
at System.Data.SqlServerCe.SqlCeConnection.Open()
All Replies
-
Friday, January 28, 2011 5:57 AMModerator
Hi Trapulo,
Welcome to MSDN forums.
According to your description and exception information, It is hard to trouble shooting, as your post, the exception is thrown randomly, from the exception I think your problem may relate to the version of SSCE, so make sure that your computer has both x86 and amd64 MSIs of Compact are installed and they are of the same version. You can download from this link: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0d2357ea-324f-46fd-88fc-7364c80e4fdb&displaylang=en
By the way, your app with windows service, you can create a console application or to WinForm to run your method to see whether the exception will be throw.
Have a nice day.
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Friday, January 28, 2011 10:53 AM
I'm using the final release, not the CTP!
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=033cfb76-5382-44fb-bc7e-b3c8174832e2
In fact, before to install the final release I was using the CTP. However I've some other servers with same situation (CTP then updated to final), when the application runs without this strange error.
The server is Win2003 R2 x64, so I did install the x64 version. Why do you say to install either the x86 and the x64 version? If I try to run the x86 setup, it reports that is the wrong version!
My application can run as win server, and either as console application. I tried to run as console, and the trouble is the same. Always, after a while (about 15 or 30 minutes, not more), it starts to report that error.
Any other idea?
thanks
-
Tuesday, February 01, 2011 8:48 AMModerator
Hi Trapulo,
I suspected there are some assembly version conflict or mistake when you updated from SQL Compact 4.0 CTP to RTM. Some assemblies related to Entity Framework may not be updated to the latest version. Please check whether the current issue is similari with the one in the last post of this thread, http://stackoverflow.com/questions/3223359/cant-get-sql-server-compact-3-5-4-to-work-with-asp-net-mvc-2.
"The key for me was realizing that the version of System.Data.SqlServerCe.Entity.dll in the Private directory (C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private) is 4.0.0.1, where the version beneath the Desktop directory (C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Desktop\System.Data.SqlServerCe.Entity) is 4.0.0.0. The version of System.Data.SqlServerCe.dll in the Private directory is 4.0.0.0.
I think it was a mistake on the part of Microsoft to distribute an updated SqlServerCe.Entity.dll without a corresponding update to SqlServer.dll."
Besides, we can also use Fusion Log viewer to verify the correct version of assembly is loaded in our app:
http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspx
http://msdn.microsoft.com/en-us/library/e74a18c4.aspxGood day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Thursday, February 03, 2011 1:33 AMModerator
Hi Trapulo,
I am writing to check the status of this issue. Could you please tell us how is the problem now?
If you need any further assistance, please feel free to let me know.
Have a nice day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Thursday, February 03, 2011 8:49 AM
Hello,
I've found that a class library used by the project had a direct reference to the old CPT dll. In fact the library don't use the SQL Library directly, so I just removed the reference from the project. Now it seems that the problem is solved, but I'm still monitoring it because the problem was random so I wait some time before to be sure that this did solve.
However I don't understand why a library referenced but not used can create this kind of problem.
Thanks
-
Friday, February 04, 2011 3:28 AMModerator
Hi Trapulo,
Please feel free to let me know if the issue still exists.
I have seen such Dll conflict before and it often occurs when updated assemblies are installed. .NET has some very complicated logic to load and verifty assemblies. If both the CTP and RTM assemblies are referred, it is likely the issue can occur randomly. :)
Generally we can check such issues via Fusion log as I have suggested in my first post. Also, Process Explorer can list all the assemblies we loaded in certain process too. You can refer to this KB article, http://support.microsoft.com/kb/970920.
Good luck & have a nice weekend!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Proposed As Answer by Alan_chenModerator Monday, February 07, 2011 3:10 AM
-
Monday, February 07, 2011 11:57 AM
Hello again,
the problem is not solved :(
The server has restarted to report that error either with the new version that doesn't contain any reference to CTP ols asseblies.
I've tried with process explorer to check the runtime when the application is working and is reporting the error, and it seems that it has loaded right dll and nothing else.
I attach here most important dlls taken from process explorer that in some way are related to data management, so maybe you will find any trouble that I can't see:
sqlceer40EN.dll Native Error Strings and Resources Microsoft Corporation 4.0.8482.1
sqlceme40.dll Managed Extensions (64-bit) Microsoft Corporation 4.0.8482.1Microsoft.Data.Entity.CTP.dll .NET Framework Microsoft Corporation 4.0.30319.0
Microsoft.Data.Entity.CTP.dll .NET Framework Microsoft Corporation 4.0.30319.0
Microsoft.Practices.EnterpriseLibrary.Common.dll Enterprise Library Shared Library Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Common.dll Enterprise Library Shared Library Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.dll Enterprise Library Logging Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.dll Enterprise Library Logging Application Block Microsoft Corporation 4.1.0.0
Microsoft.Practices.ObjectBuilder2.dll Microsoft.Practices.ObjectBuilder2 Microsoft Corporation 2.2.0.0
Microsoft.Practices.ObjectBuilder2.dll Microsoft.Practices.ObjectBuilder2 Microsoft Corporation 2.2.0.0
mscoree.dll Microsoft .NET Runtime Execution Engine Microsoft Corporation 4.0.31106.0
mscoreei.dll Microsoft .NET Runtime Execution Engine Microsoft Corporation 4.0.30319.1
mscorlib.ni.dll Microsoft Common Language Runtime Class Library Microsoft Corporation 4.0.30319.1
mscorrc.dll Microsoft .NET Runtime resources Microsoft Corporation 4.0.30319.1
msv1_0.dll Microsoft Authentication Package v1.0 Microsoft Corporation 5.2.3790.4587System.Data.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Data.Entity.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Data.Entity.ni.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Data.ni.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Data.OracleClient.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Data.OracleClient.ni.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Data.SqlServerCe.dll System.Data.SqlServerCe Microsoft® Corporation 4.0.8482.1
System.Data.SqlServerCe.dll System.Data.SqlServerCe Microsoft® Corporation 4.0.8482.1
System.Data.SqlServerCe.Entity.dll System.Data.SqlServerCe.Entity Microsoft® Corporation 4.0.8482.1
System.Data.SqlServerCe.Entity.dll System.Data.SqlServerCe.Entity Microsoft® Corporation 4.0.8482.1System.Transactions.dll .NET Framework Microsoft Corporation 4.0.30319.1
System.Transactions.ni.dll .NET Framework Microsoft Corporation 4.0.30319.1Maybe the CTP4 of Microsoft.Data.Entity.CTP.dll has some internal trouble working with SQL CE 4.0 RTM?
Thanks
p.s. an addendum: this is how I configure EF code first CTP to use SQL CE 4.0 (I'm not using a config string in .config file because I need to avoid this data in files external to compiled). Is there something that I can do better?
Imports System.Data.Entity
Public Class EntitiesDataContext
Inherits DbContext
Public Sub New()
Data.Entity.Infrastructure.Database.DefaultConnectionFactory = New Data.Entity.Infrastructure.SqlCeConnectionFactory("System.Data.SqlServerCe.4.0")
System.Data.Entity.Infrastructure.Database.SetInitializer(Of DAL.EntitiesDataContext)(New Data.Entity.Infrastructure.RecreateDatabaseIfModelChanges(Of DAL.EntitiesDataContext))
Me.Database.Connection.ConnectionString = "Data Source=|DataDirectory|\db.sdf;"
End Subend Class
-
Monday, February 07, 2011 2:24 PMModerator
Hi Trapulo,
I just know that you are using EF CTP4 which is a pre-release version. I would strongly not recommend you use the pre-release version of EF in real app development. There may be some unexpected issues when these CTPs are working with other RTM assemblies.
Also, EF CTP5 has been released, http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35adb688-f8a7-4d28-86b1-b6235385389d. You may try the CTP5 to see if the problem still exists.
Besides, I know how to use Code First, but I cannot say I am an expert of it, so for EF pre-release issues, I would recommend you post the question at EF pre-release forum for better support, http://social.msdn.microsoft.com/Forums/eu/adonetefx/threads. Many product team members will directly help us there. You can also consult the issue there to see whether there is any issues when using EF CTPs and SQL CE 4.0.
Also, the product team will release a stand-alone package of EF new features in the CTPs in Q1 2011, http://blogs.msdn.com/b/adonet/archive/2011/01/10/ef-feature-ctp5-pluggable-conventions.aspx.
Have a nice day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Monday, February 07, 2011 2:46 PM
I'll try to ask them, but it may be strange that the CTP has some issue with SQL CE RTM based on the error I have. I've opened the CTP with reflector and in fact it doesn't own any reference to SQL CE dlls..
I've not upgraded to CTP5 yet because I may update all existing installation, and I'd like to wait the next release to make this just a single time.
-
Tuesday, February 08, 2011 2:40 AMModerator
Hi,
I checked our internal database, but I did not find any related issues. To narrow down the problem, could you please try to use SQL CE 4.0 and EF RTM (no CTPs)?
Good day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, February 08, 2011 10:36 AM
But EF code first has not an RTM.. :(
-
Tuesday, February 08, 2011 2:16 PMModerator
Oh! I can understand. :( So does the issue have very large impact on your app? Can we currently catch the exception and re-create new connections? If it does not have very big impact, I would recommend you wait for the new package of EF.
Also, if you receive any feedback from product group in the EF pre-release forum, would you please share the information here to benefit more community members?
Good day!
Thanks
Michael Sun [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Tuesday, February 08, 2011 5:25 PM
I've updated the app to EF code first CTP5, the last one. As expected, this didn't solve the problem :(
What the hell does contain this SQL 4.0 RTM to create this trouble? I think that the problem is not in EF but in SQL...
-
Thursday, March 10, 2011 11:43 AM
Hi Trapulo,
I know this discussion has been going on for a long time now. At this point, I think we would need more deep troubleshooting of your environment and it would take more than discussing. I am sure there is some kind of version mismatch and we are for sure missing something here. You may have to open a ticket with Microsoft CSS and we will be able to look into it more deeply and come up with a resolution. Please let me know your thoughts on this.
Thanks,
Smat Msft
-
Monday, March 21, 2011 10:45 AM
Yes: I still have this problem. The support will solve this if I'm using EF code first CTP5 that is a CTP? The problem sure is not in EF, however..
May I found the local phone number in MSDN pages?
Thanks
-
Tuesday, April 26, 2011 1:41 PMThe main Microsoft support number is (800) MICROSOFT (642-7676).
-
Wednesday, December 14, 2011 9:29 PM
still same problem. Now using EF 4.1 RTM... :(

