I wrote an asp.net web app which uses SMO against SQL Server 2008 to be able to run some DB scripts. It references these assemblies (in the C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies folder):
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Management.Sdk.Sfc
Microsoft.SqlServer.Smo
The microsoft.sqlserver.batchparser.dll is not in this folder.
Locally (32 bits machine, IIS7) I have no issue.
When I publish the app to my hosting provider (discountasp.net, SQL Server 2008, IIS7, 32bits too), I get this error:
Could not load file or assembly
'Microsoft.SqlServer.BatchParser,
Version=10.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or
one of its dependencies. The system
cannot find the file specified.
I searched my local machine and I can't find this assembly. However it works well on this machine.
The "Microsoft SQL Server 2008 Setup Discovery Report" tool reports I have v10.1.2531.0 installed locally.
To get this dll, you will need to install the Microsoft SQL Server 2008 Management Objects (available from here). That particular dll gets installed into the GAC, which is why you probably cannot find it using a search.
As you are using a hosting provider, it would appear that they do not have this installed. Your choices are to get it installed by them (which is probably unlikely), or deploy the dll manually (which may be on dodgy licencing ground).
First you need to enable browsing of GAC folder:
1. go to Registry Editor (RUN > regedit)
2. go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
3. Right click Fusion > NEW > DWORD
4. Type DisableCacheViewer
5. Double click DisableCacheViewer
6. Set value to 1
then you can find it here
C:\Windows\assembly\GAC_32\Microsoft.SqlServer.BatchParser\10.0.0.0__89845dcd8080cc91
You need to have the SMO components installed on your hosting provider as well. You can download them here.
I had a similar issue, but with R2. For me it worked by installing Microsoft® SQL Server® 2008 R2 Shared Management Objects and dependant Microsoft® System CLR Types for SQL Server® 2008 R2.
Find them here http://www.microsoft.com/en-us/download/confirmation.aspx?id=16978
I resolve this only Just Right Click on Project navigate to Properties and Change Platform Target from 'Any' to 'x86'
You could install the SQL Client Connection feature from the SQL Server DVD as well. I installed that as well as the SDK components to resolve this issue while installing SolarWinds.
I had SMO x64 installed, but SMO x86 was required on build server.
<startup useLegacyV2RuntimeActivationPolicy="true"> in App.config
This happened to me today. Running as administrator did the trick for me, I'm not sure why.
It's not ideal for production, but might work just fin for development environments.
Install the 'Microsoft Visual C++ 2013 Redistributable (x86)' if it is not showing up in add/remove programs.
Related
'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. I am getting this in visual studio only after upgrading from 32bit office 2013 to 64bit office 16. I have already installed the 64bit database engine and my published project from IIS is working with the existing access database. I switched debug mode to x64 and remove the references to the old office and replaced them with the new office access. How can I get Visual Studio 2010 to recognize my access database created in access 2013?
Things I have tried:
Installing Microsoft Access Database Engine 2010 Redistributable 64bit version.
Updating the office references in the project.
Debugging in x64 mode
This is a little outside of my normal area of database application design;
it's unclear - you state 2016 Office 64 bit installed but then Access 2010 Redistributable/Runtime 64bit - - so do you have a full license of Access installed?
if you do have the full Access license - try something that is quick: create a brand new database and import that table. Then try the link to this new db.
I had that issue in the past.
install 2007 Office System Driver and restart visual studio.
I've dealt many time with this problem, the solution was ever install one of these:
AccessDatabaseEngine 2007.exe
AccessDatabaseEngine_2010.exe
AccessDatabaseEngine_2016.exe
AccessDatabaseEngine_X64_2010.exe
AccessDatabaseEngine_X64_2016.exe
Most of the time I've solved installing the 2007 one even using 2016 version.
To run 32-bit applications on IIS, you will get the same error. So, from the IIS 7, right-click on the applications' application pool and go to "advanced settings" and change "Enable 32-Bit Applications" to "TRUE".
Restart your website and it should work.
I have a test website running on a test server with Windows Server Web (SP2) installed. I've just installed .NET4.5 on it. In the website (simple ASP.NET webforms from template) I've used Entity Framework 5 Spatial types, very simple code just for testing which runs fine on my local dev machine:
var conn = new DbEntities();
var geo = conn.tbl_SpatialData.First().GeoInfo;
var geom = DbGeometry.FromGml(geo.AsGml());
litText.Text = geom.AsGml();
However on the server it gives me this error:
Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found.
The sql database where it wants to connect is on a different server, and is a SQL Server 2008 -> I am connecting to the same db from my local dev machine.
I've already tried searching for the dll on my local machine, and adding it to the website's bin folder, however it gives me a new error requesting for another dll. I would like to have those dlls installed globally like on my dev machine. What am I missing or should I install on the server?
Thanks in advance!
That assembly and its dependencies are part of SQL Server Managements Objects. This feature must be installed on the server. It should be part of SQL Server's Client Tools or Client Tools SDK.
This might help you when this comes in published server
http://blogs.msdn.com/b/adonet/archive/2013/12/09/microsoft-sqlserver-types-nuget-package-spatial-on-azure.aspx
If you have control over the server you can just install the CLR Types
for SQL Server. The SQL Server 2012 SP1 version of the CLR Types can
be downloaded here. SQLSysClrTypes.msi is the installer you want and
there is an x86 (32 bit) and x64 (64 bit) version depending on the
architecture of the machine you are deploying to.
However, installing extra software on the target machine is not always
an option – especially if you are deploying to a machine you don’t own
(such as Windows Azure Web Sites). Fortunately the required assemblies
can be deployed along with your application.
Step 1: Install the Microsoft.SqlServer.Types NuGet package.
PM> Install-Package Microsoft.SqlServer.Types
Step 2: Ensure the appropriate version of the native
SqlServerSpatial110.dll assembly is copied to the output directory
and deployed with your application.
Steps on how to do this are included in a ReadMe.txt file that will
open in Visual Studio when you install the package.
I have a perfectly working windows forms C# .NET 4 application that uses a SQLite3 database file to store data and display forms.
When I deploy my app on any machine other then the dev machine, I get an exception thrown and it's message is "Could not load assembly System.Data.SQLite.dll or one of its dependencies. The specified module could not be found."
The System.Data.SQLite.dll reference in the project is set to Copy Local = True. Also, I tried manually loading the assembly with Assembly.LoadFile. The dll is placed in the output directory. I also tried setting the platform target to Any CPU as well as x86, no difference. All machines I am working with are 32-bit. What is the issue here? Why is my application trying to load the assembly and can't find it?
Thanks!
I had the same problem after publishing my program to a separate computer. Installing Microsoft Visual C++ 2010 Redistributable Package (x86) on the separate computer fixed the problem.
Note: the separate computer already had Microsoft Visual C++ 2010 Redistributable Package (x64) installed, the x86 version was needed.
'System.Data.SQLite.dll" requires "msvcr100.dll" which is one of it's Dependencies. This will be available only if you installed latest "Microsoft Visual C++ Redistributable" or any other product which internally provides this.
For example, VS2010 will install C++ Redistributable by default. Thats the reason your application doesnot works in some machine but works in others.
You could try pasting the "msvcr100.dll" in your application bin folder and distribute if you dont want to install VC++ 2010 Redist in all the PC's.
Some of the System.Data.Sqlite.dll modules depend on the "Microsoft Visual C++ 2012 Redistributable Package" .
You can find required dependencies on the official download page : http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
The answers already given didn't solve my problem. I tried to deploy to a VMware server. The solution that did help where given here: http://sqlite.1065341.n5.nabble.com/System-Data-SQLite-Deployment-Mystery-td71752.html Two methods are described there.
When i install this sqlite-netFx45-setup-bundle-x86-2012-1.0.88.0.exe, my app is able to find the right dll.
The second method is to add the dll to de app.exe.config in the debug or release dir. If you edit this file directly, there is a change VC will overwrite the file.
My main problem was that i installed the sqlite package manually. I didn't use NuGet, because i'm behind a proxy. If you do use Nuget, the information in the app.exe.config will be provided automatically.
Using NuGet behind a proxy is described here: NuGet Behind Proxy
I have a new development machine Windows 7 x64 and am writing an MVC3 application that targets an Oracle database. I have tried everything that I know of to get it running with no success.
Previously, I was developing on a Win7 x32 box and could debug fine locally, but was unable to deploy and run it on a Win2008 x64 Server despite having ODP.Net and 11g Client installed.
"Could not load file or assembly 'Oracle.DataAccess' or one of its
dependencies. An attempt was made to load a program with an incorrect
format"
On my new x64 machine, I can build the project but when i try to run it in via the IDE I get:
"The provider is not compatible with the version of Oracle client"
I am at a complete loss.
Does anyone have a similar setup that could share detailed instructions of what to install where and how to to reference Oracle.DataAccess in such a way that I can debug in the IDE on my x64 box, and also deploy to x64 server?
It should not have to be this difficult.
I do have this running on Windows 7x64 with the Oracle 11g R2 client that comes with the ODAC installation here:
http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
Make sure you have the x64 version installed locally, and you may have to do the uninstall-reboot-reinstall-reboot tango. I also had weird problems getting it to see TNSNAMES entries and had to go with EZCONNECT strings, but that's not your problem.
In fact, I've also gotten it working on x64 using the 32 bit EF beta and it works fine:
http://www.oracle.com/technetwork/topics/dotnet/downloads/oracleefbeta-302521.html
Although I don't think the EF implementatinon is 100% ready for prime time yet (we ended up using the DevArt driver instead because it had more reliable support for computed fields - we never did get Computed or Identity Timestamps working in ODP.NET EF Beta, although oddly Primary Key NUMBER fields populated by triggers did work.)
I didn't have to do anything special, and I didn't have to do anything special on the server side either (with both 10g and 11gR2).
So I finally figured it out. Here is what I did step-by-step:
On my Win7 x64 development machine I removed all Oracle products in an attempt to start from scratch (including manually deleting registry keys and files/folders)
I installed "Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64) " ON BOTH the dev machine and production IIS server
I selected the RUNTIME option for the installation
During my first attempt the installation complained of not enough room in the PATH
environment variable so I had to cancel the install, remove some path values (which a replaced after the install completed
I installed to C:\oracle was my base path and client_x64 was my HOME so it installed to C:\oracle\product\11.2.0\client_x64
I then installed "64-bit ODAC 11.2 Release 3 (11.2.0.2.1) for Windows x64" on BOTH the dev and production mahcines.
install.bat odp.net4 c:\oracle\odac11.2.x64 odac112x64
The above statement creates a new home named odac112x64
At this point I built a simple console app using the following setup
Added reference to Oracle.DataAccess.dll located in C:\oracle\odac11.2.x64\odp.net\bin\4
Set CopyLocal = FALSE for the Oracle.DataAccess reference
Set the application to build for "ANY PROCESSOR"
The app connected to my oracle database and returned records on both machines
I then created a sample MVC website project with the same connection code as the console app.
When I ran it locally in the IDE it threw an error:
"Could not load file or assembly 'Oracle.DataAccess,
Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'
or one of its dependencies. The system cannot find the file specified."
I believe this is because the IDE is 32bit and could not load a 64bit Oracle.DataAccess
I published that exact code to the production server and it ran successfully
At this point my only problem is getting it to run locally for development purposes
I installed "ODAC 11.2 Release 3 (11.2.0.2.1) with Xcopy Deployment" which is the x32 version of ODP.NET
install.bat odp.net4 c:\oracle\odac11.2.x32 odac112x32
When I re-ran the MVC website project locally it worked as expected!
UPDATED FOLLOW-UP INFORMATION #1:
After getting this to work I attempted to apply the same steps to another server and it failed. The problem was that "Allow 32-bit Applications" was set to TRUE in the application pool. DISABLING 32-bit apps (only allowing 64bit) resolved the problem on the new machine.
UPDATED FOLLOW-UP INFORMATION #2:
The ODAC installation on the new machine failed to place the installation and bin directory in the environment path (I hate Oracle). Once that was added, all was running as desired.
I have not worked with ODP.NET for quite some time, so I am running from memory of issues I had when I last used it.
The ODP.NET bits have to be installed on the server (or at least deployed, although I am not sure how that is accomplished off hand). The actual client in ODP.NET is the same Java libraries used for Oracle access. If installed, then you have some type of configuration error or permissions issue with using the underlying Java libraries.
I am not sure what the IDE message is about, however.
I am following the learning ASP.NET 3.5 by O'REILLY to write some ASP.NET 3.5 code using Visual Studio 2008 SP1. I have gotten to the point to where I need to Configure a Data Source using the SqlDataSource control. I chose Microsoft SQL Server (SqlClient) even though I have SQL Server Express 2005 - This seems like the only logical choice.
I get to the Add Connection window and successfully add a Server name and I use the Select or enter a database name of AdventureWorks. When I click on Test Connection I get the Test Connection Succeeded message box.
Unfortunately, when I click OK I get an error message of the following:
Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral,
PublicKey Token=89845dcd8080cc91' or one of its dependecies. The system cannot find
the file specified.
At his point I am at a loss and everywhere I look and find something similar to my issue it involves other versions of either Visual Studio or SQL Server.
I'd really appreciate any help on this!
You may investigate this recipe.
You may need to reinstall your copy of SQL 2005 Express. But sure to install all of the client-side developer packages in the installer.
I had the exact same issue.
Following the suggestions in this thread , I went to the "Microsoft SQL Server 2008 Feature Pack, August 2008 " - and downloaded (and installed) the "Microsoft SQL Server 2005 Backward Compatibility Components ". This did not help.
Then I also downloaded and installed the following components: SharedManagementObjects.msi, sqlncli.msi, SQLSysClrTypes.msi.
And now it works for me.
I'm using SQL Server 2008 Express and Visual Web Developer 2008 Express Edition.