I am trying to deploy an application that uses SMO on a workstation without SQL Server installed on it. The instance the app is connecting to is SQL Server 2008. The application is failing with:
Could not load file or assembly 'Microsoft.SqlServer.Replication, Version 10.0.0.0, Culture=neutral, PublicKeyToken=89845cdc8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.
The assembly in question is in the same path as my application as well as system32. I am running this on a Windows 7 64 bit box. I have run SQL Native Client, CLR, and SMO MSIs from the 2008 SMO redist download page.
This app worked fine when connecting to SQL Server 2005.
What gives?
It looks to me like you are referencing SMO Version 10 in you project, but the client machine you are trying to deploy your application to is probably running SMO version 9. I had this same problem and updated my project references to reference SMO verison 9. I also set the SMO objects to copy local = true to ensure the correct assembly was referenced on the client machine.
Related
I have a c# console application which is scheduled to import bulk data from oracle to sql database. I am leaning towards using the oracle client dlls from the installation folder instead of having it installed on server. I read many existing SO answers on copying required dlls in installation folder.
https://jeremybranham.wordpress.com/2011/04/25/oracle-instant-client-with-odp-net/
The application works fine on my windows 10 machine where no oracle client is installed. But on Windows Server 2008 R2 it throws error saying OraOps12.dll is not found. Though I have the dll available. What can I do to troubleshoot the issue?
Make sure the dll is referenced in the project and it's set to copy to the output directory. I can't explain why, but I have had referenced dll's not set to copy and have run into similar issues as you are describing.
I think it is a bad idea to copy the DLL's from the Oracle Client manually. You may provide a copy of Oracle.DataAccess.dll - for all the rest ask your customer to install an appropriate Oracle Client, i.e. the version and architecture has to match the Oracle.DataAccess.dll.
Or use the ODP.NET Managed Driver (Oracle.ManagedDataAccess.dll), this is a stand-alone DLL which does not require any additional file.
Finally I could work it out without actually installing Oracle Client on the server. I was receiving error about not able to load OraOps12.dll but eventually I found out that the dll I was missing was msvcr120.dll. The dll is Microsoft Visual C++ Runtime. So now, I have following Oracle dlls in my deployment folder & the application is working. No changes in configuration are required.
msvcr120.dll
Oracle.DataAccess.dll
OraOps12.dll
oraociei12.dll
oraons.dll
oci.dll
I develope a C# application that works with SMO Classes and uses these assemblies :
Microsoft.SqlServer.ConnectionInfo.dll
Microsoft.SqlServer.Management.Sdk.Sfc.dll
Microsoft.SqlServer.Smo.dll
Microsoft.SqlSever.SqlEnum
and I use SQL Server 2012 assemblies, therefore my App will work with sql server 2012 and I must install sql server 2012 and shared mangement object 2012 on target machine in order to my app work correctly.
now I want to Know if sql2005/2008 is installed on target machine then my App can work with that sql engine or Necessarily I must install sqlserver 2012 ?
I had developed a WPF application, and its backend is a SQL Server CE .SDF file. In setup and deployment project I added .SDF file in it
The issue is: to access and get records from the .SDF file we require an additional software. Please find the below Link
https://www.microsoft.com/en-in/download/details.aspx?id=17876
It has 2 exe files
64 Bit
86/32 Bit
Visual Studio directly installs this software when we install VS
On a client system, I didn't find these files so I am unable to access the .SDF file and get records from it
I need to Copy these files in Application folder and Automatically Install it if the above software is not Present in the PC
Now I am Manually Installing these software(exe ) in Each PC
You're mistaken - to deploy a SQL Server CE 4.0 based application, you do NOT need to deploy and/or install any additional software to your client system - it suffices to include the necessary, relevant SQL Server CE 4.0 DLL's into your application (into the bin or lib folder or something), and just ship those files with your application. That's all you need - no server-side or client-side install needed ! (That's the WHOLE POINT of using SQL Server CE, after all!)
See these links for in-depth descriptions of how to do it:
Right here on Stackoverflow:
How to deploy SQL Server Compact 4.0
Another way to do it:
How to deploy the SQL Server Compact Edition software locally
Official MSDN documentation:
How to deploy a SQL Server Compact 4.0 database with an application
My project makes use of the Oracle.DataAccess.dll DLL and when I build and run my application it works fine on my PC, as I have added the reference in my project to it C:\Oracle\instantclient_11_2_dc\odp.net\bin\4\Oracle.DataAccess.dll
However when I run on another machine without this reference it fails installation with the following message.
How do I include the DLL file in my project so it is deployed with it as as requirement, and doesn't reference my local file system?
You have to install the Oracle client on the client machine if this is a client/server application. If it is web based application then it should be installed there.
I don't use the instant client as I end up wanting to edit the connections in the TNSNames.ora so I use the full or Administrator install.
The client version will usually connect back or forward two Oracle versions but life is easier if you use the version appropriate to your database version.
You'll want to install the Oracle Data Access Components from here: http://www.oracle.com/technetwork/topics/dotnet/downloads/net-downloads-160392.html?ssSourceSiteId=ocomen on your dev machine AND any servers you plan on deploying to (or you can xcopy install per How can I deploy a .NET application that uses ODAC without installing the whole component to the user?). Also marked Q as duplicate to this one.
I am using VS 2013 with InstallShield Limited Edition Project.
Everything is working fine in development environment where I have created reference to System.Data.SqlServerCe.dll
After I generate .exe file and install my application it is unable to find reference for SQL Server CE 3.5 thus automatically gets reference for SQL Server CE 4.0 and gave an error.
Incompatible Database Version. If this was a compatible file, run repair. For other cases refer to documentation. [ Db version = 4000000,Requested version = 3505053,File name = \?\C:\Users\someuser\AppData\Local\testapp\testdb.sdf ]
I have tried going through "this" article on MSDN but I can't find any publish tab in properties of my project.
Furthermore I am deploying System.Data.SqlServerCe.dll and all 7 32bit version SQL Server CE 3.5 dlls with my setup.
sqlceca30.dll
sqlcecompact30.dll
sqlceer30en.dll
sqlceme30.dll
sqlceoledb30.dll
sqlceqp30.dll
sqlcese30.dll
No, the issue is that your database file is in 4.0 format. As you can see from the error message, the engine is trying to open a 3,5 file, but gets a 4,0 file instead. So your application is using the 3,5 engine.
The problem was when I was trying to deploy msi package using InstallShield it used different build setting(x64) than my current setting(x86) which was causing my application to get the reference of x64 Sql Server CE 4.0 files.
So it was fixed by changing setting of singleimage compiling option.