'OraOLEDB.Oracle' provider is not registered on the local machine, when working with a console application - asp.net

I have a very similar situation as described in below thread:
The 'OraOLEDB.Oracle' provider is not registered on the local machine, when working with a console application?
I have website application .Net 4.5, on windows server 2016 and vs2017 with configuration as 'Any CPU'. I have a service layer to connect to oracle database and get the data. It runs very fine and connect to oracle database.
Now, i have a console application to run a job and once this job completes, i need to update the database. I call service layer from console application to update the database. However this call fails, and gives me 'The 'OraOLEDB.Oracle' provider is not registered on the local machine' error.
Solution provided in above given post (i.e. compile your console app in x86) does work for me but i don't have this option (as i have dependency on some other things as well).
Do i have any other option to resolve this issue?
EDIT: I removed oracle client installed on machine and then reinstalled 64 bit ODAC but still same problem :(

Related

Deploying to our test server from a dev machine doesn't work

We have 2 dev machines (dev1 and dev2) and we are trying to change the way we deploy. Until now we used to deploy to the local biztalk admin console, then create an MSI and instal that to the live server.
Now, we want to directly deploy to a test server (bztest-03) and once testing is done, create an msi on that machine. This works for the dev2 mavhine, but the dev1 machine gives the below error. the machine gives this error even when the same user as on dev2 is logged on and the rights on the database look the same (and on user roles)
What could cause these errors? The analytics_PortTrackingInfo isn't something we made and i find little hits on google about it and biztalk.
Severity Code Description Project File Line Suppression State
Error Deployment cannot initialize the connection to the database
"BizTalkMgmtDb" on server "BZTEST-03\DTA". Verify that you have the
required security permissions and that communication between
Distributed Transaction Coordinator services on the machines involved
is not prevented by current DTC security, firewall or authentication
settings. Invalid object name 'analytics_PortTrackingInfo'. 0
That error notwithstanding, you can't Deploy to a remote machine from Visual Studio. That has always been the case.
If you're looking to improve your Deploy process, the 'correct' way would be to add BTDF to your Solutions.
Deployment Framework for BizTalk

ASP.NET (macOS) - Send Windows Credentials in SQL Connection

I'm a contractor working remotely on a legacy ASP.NET application. I'm struggling to stand up a local instance of the project due to the error SQL Exception - SQL Server does not exist or access denied. I suspect this is because of the use of Windows Authentication for the SQL databases backing the project.
Before I launch into a lot more detail I'll ask my question: what are my options to pass Windows credentials to an SQL server in an ASP.NET project built on OSX?
I believe I've proven this is possible with some steps I'll detail below, but the actual implementation in an ASP.NET project is escaping me due to my inexperience with everything .NET, and the many-fold differences between my setup and the typical dev.
Standard Dev Setup
The devs I'm working alongside are using Windows machines housed in their corporate domain, running Visual Studio 2012. Because they're already logged into their machines with the appropriate credentials, the use of Integrated Security=SSPI in the SQL connection string "just works".
My Setup
I'm running a Mac Mini outside of their corporate domain, and using Visual Studio in conjunction with Mono to support the .NET Framework-based project. Passing the SSPI option won't work out of the box because I'm not connected to any Active Directory. That said, I do have valid credentials to log into their network.
What's worked so far
I've proven that a connection to their network resources is possible:
When logged into a virtual Windows machine, I can connect to a shared drive on that network with the credentials I was provided.
I then set up that same shared drive on my Mac Mini with those same credentials.
Using SQL Pro for MSSQL, I was able to connect to the desired database using my credentials.
As I understand it, what I'm looking for can be accomplished on Windows with Credential Manager, so bottom line I think I'm looking for the equivalent solution on OSX that plays nicely with ASP.NET project as compiled by Visual Studio.

Deploy ACCESS OleDb driver

I've tried to deploy a small website (ASP.NET) which is using an MS ACCESS 2010 db. Deploying the website on the server I get the following error:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Connectionstring used : Provider=Microsoft.ACE.OLEDB.12.0; Data Source=path-to-db
MS Office is not installed on the server and neither is the Access Database engine. The website is runnin in a shared hosting environment, so I am not able to install office on that server, so may I somehow deploy the provider by dll's?
Is it possible to deploy the drivers needed for ASP.Net to connect to the database without having to run an installation on the server. As this is in a shared hosting environment, I am not able to install anything. Only fileupload by ftp.
Open IIS, navigate to Application Pools, find the appPool for your website, right click, advanced settings, set "Enable 32-Bit Applications" to true.
Looking around, this has nothing to do with Office. If you're only using Access as the database, then you don't need to install it. Info here: http://www.mytechsupport.ca/forums/index.php?topic=11237.0
I found this StackOverflow thread with the same error you did so it sounds like it might be the same issue. Microsoft.ACE.OLEDB.12.0 provider is not registered
If its running windows then look through that thread and see if the 64-bit issue is the problem. I've had this same issue before and its apparently quite common. You may need to e-mail whoever for support on your server.
Is it running Linux? If it is running linux then the issue might be just an entire lack of the driver to connect to Access databases. If this is the case I would e-mail your support and ask them if they can install the proper drivers for you. Info here: http://nixcraft.com/databases-servers/11878-connect-microsoft-access-database-php-linux-server.html

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.7.3

I am trying to open a connection to DB2 in console application. It works fine.
when I use the same code in a service, hosted in IIS it throws an error for DB2. Following is the error details. Am I missing some permissions in IIS ?
dll :IBM.data.DB2.dll
Code :
DB2Connection db2Connection = new DB2Connection(connectionString);
DB2Command cmdSelectUsrNameAndPassword = new DB2Command(querySelectUsernameAndPassword, db2Connection);
cmdSelectUsrNameAndPassword.Connection.Open();
Throws :
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.7.3
If I try a DSN with ODBC in console it works, but same throws another error in IIS.
OdbcConnection DbConnection = new OdbcConnection(DSNName);
DbConnection.Open();
Throws :
ASP.NET V4.0 does not have the authority to perform the requested command or operation.
guess it has something to do with App pool identity. I set the app pool identity as "Network service" and gave full permission to "Network Service" on "IBM.Data.DB.dll" in C:\Program Files\IBM\SQLLIB\BIN\netf20_32\ Worked neat.
Have a look at IBM support doc below which outlines why it happens and what the message means http://www-01.ibm.com/support/docview.wss?uid=swg21413731. It helped me, adding to the DB2USERS group allowed our app to work and is probably better than running as Network Service.
While installing IBM data server client you did not uncheck the option to enable operating system security.
So you have to add the user(s), that need to use DB2 client dll, to DB2USERS group as it states in the final step of installation.
If you want IIS application pool identity use: "IIS AppPool\DefaultAppPool". Add that user to DB2USERS group.
DefaultAppPool-> your application pool identity name
I encountered a very similar error message on one of my projects:
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 10.1.5
Having tried all of the solutions listed above and on the IBM documentation site, it ultimately ended up just being the case that the DB2 Connect installer needed to be run as administrator, rather than as a user account. Uninstalling it and reinstalling it as administrator resolved the problem.
Running the installer as administrator also unlocked options such as the ability to turn off extended security which had previously not been presented.
I had the same problem with an application running on IIS Express. Tried running Visual Studio as administrator and the problem is solved.
Versions:
DB2 Client Version 10.5,
Visual Studio 2015.

WCF Data Service, EDMX Entity Data Model, Oracle 11 database, not deploying to IIS

I am implementing a WCF Data service that implements the following method:
http://debugmode.net/2010/06/13/introduction-to-wcf-data-service-and-odata/
I've installed the following beta ODAC component:
http://www.oracle.com/technetwork/topics/dotnet/downloads/oracleefbeta-302521.html
When I run the solution in Visual Studio 2010, it returns data perfectly, when I deploy the application to IIS 7, it throws the following exception:
The underlying provider failed on Open.
I checked the connection strings in both, they are set up identically, the only thing I can think of, which I believe is a non-issue is that the Oracle client components install the TNSNAMES.ora and sqlnet.ora in the following location:
There are 2 for the username
C:\app\<username>\product\11.2.0\client_1\Network\Admin
C:\app\<username>\product\11.2.0\client_2\Network\Admin
and there's one for oraclebase -
C:\app\oraclebase\product\11.2.0\client_1\Network\Admin
I've copied the working files to all the right locations, in fact, I can connect perfectly fine via SQL Plus
My gut tells me that the application pool/identity that IIS is running under isn't loading the correct configuration values, but, I changed the app pool account to run under -my- account.
Here's the connection strings that are being used from the ASP.NET application (in case it helps)
metadata=res://*/ENTITY_NAME.csdl|res://*/ENTITY_NAME.ssdl|res://*/ENTITY_NAME.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=DATABASENAME;PASSWORD=PASSWORD;PERSIST SECURITY INFO=True;USER ID=USERNAME"
By the way, I have another WCF data service on the same server, it's pointing to a SQL instance and pulling data just beautifully, there was an issue with the identity on that app pool, but that was resolved.
Anyone know what it might be?
Note: I am also doing a connection.open() and connection.close() on the entities in code.
I resolved this issue. The problem was that my application pool wasn't configured to enable 32-bit applications to run. The ODAC component is 32-bit.
In a round about kinda way, this post was helpful too, to help understand the various moving parts in configuring Oracle to connect.

Resources