Yahoo Serious
Yahoo Serious

Reputation: 3918

Get Visual Studio to deploy dbnetlib.dll on Windows CE

I'm developing a device application, using a connection with a 'regular' Sql Server 2005 (not a Compact DB). Whenever I try to open SqlConnection on Windows CE (a Datalogic Memor CE), I’m getting a MissingMethodException: Can't find PInvoke DLL 'dbnetlib.dll'..

This seems to be a deployment issue. In my project I include: C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5\Devices\Client\System.Data.SqlClient.dll The file System.Data.SqlClient.dll does get deployed to my application directory, but there is no sign of dbnetlib.dll.

When I Google this Exception, I mainly get these suggestions:

The question is: do you know a solution for Visual Studio to deploy correctly?
Another question might be: do you have an opinion about this work around?

(BTW: the DB-connection works fine on a Datalogic Memor WM (Windows Mobile), so I guess the appropriate .NET-library is already installed on that device.)

Upvotes: 5

Views: 8534

Answers (1)

AAT
AAT

Reputation: 3386

Visual Studio generally does a good job of working out what to deploy, but it isn't fullproof. For example if the DLL is linked dynamically then it has no way of knowing that it is required and won't deploy it: it also routinely and silently fails to deploy files to the Windows directory.

I would recommend that you manually deploy the file during development. I generally prefer to do this anyway to make sure I know what has been deployed (the joy of batch files...).

Upvotes: 2

Related Questions