I'm writing some integration my program which uses an ODBC dll on Visual Studio Online. The VSO provides Hosted Build Controllers so that I don't have to set up my own TFS server. However, to use the ODBC dll you normally have to install it for which the Hosted Build Controllers don't give me that permission.
Just wondering if it is possible to bypass the installation and load up the dll directly in some way?
Couldn't find some information about that anywhere.
Related
I have a web app on Azure. It uses .NET Core 3.1. I use two C++ DLL files as dependencies in the app. The first DLL depends or uses the second DLL. When I run the project in Visual Studio locally, there is no issue. When I deploy the app to Azure, it complains only from the second DLL, and it says "unable to load dll or one of its dependencies". As I said the first DLL use the second DLL in its codes by using " [DllImport(#"..\Folder\Second.dll")] ". What do I need to do or add in web app? Why it is working locally anf not on Azure? Any help would be appreciate.
First make sure that your .dll does not need to be registered in the registry on your local computer. Then you can copy and paste your .dll file directly into the scm website for testing. If it can be successful, then it can be supported.
In this way, we only need to add the following code to the .csproj file, and include your .dll file when publishing.
The specified files are included in the release.
If your .dll needs to be registered in the computer registry, then I can tell you clearly that azure web app is not supported because it is a sandbox environment.
But you can publish your application through azure container webapp or virtual machine.
Related Post
DLLImport does not work on Azure App Service Net. 3.1
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
Is it possible to create a fully-distributable application using C# that installs in a "proper" location (i.e. C:\Program Files\MyAppName) using only Visual Studio?
I'm new to creating stand-alone apps and I have created a first simple test app, but now wish to develop a home inventory-type application. It requires the distributable SQL Server database (which I used in my test app), and I would like it to install to a "normal" location. Right now, it seems to install to C:\Users\%Username%\AppData\Local\Apps\2.0.
Can this be done with C#, or does it require some 3rd party installation creation package?
As long as they don't rely on assemblies in the GAC, etc. .NET applications are standalone / "fully-distributable" by default. The most common way that I install my applications to other machines is by copying the output folder, (bin\Release for example) to my desired install location. For applications that are to be downloaded off of a website, zipping the folder should be sufficient, and the user can unzip to any location that they wish.
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 have a .net solution with a C# project and a C++ project. The C++ project is an automation server (.exe). The C# project references an ActiveX interface produced by the C++ project (.tlb or registered interface on the machine). This works great on a development machine as I am registering the .tlb using regtlibv12.exe in a post build event in the C++ project. On the build machine, this fails because the service that runs the builds does not have rights to update the registry.
Is it typical to have the service that runs automated builds run as an administrator? Is there another preferred way to do this?
I also read that regtlibv12.exe is not always installed. Is there another way that is preferred to register a .tlb?
In a C# project just check if C++ application (automation server) is running and run it if not.
Then automation server (.exe) will register all available CLSID's in a system
I found no other way to register the type library in the build process other than using regtlibv12.exe. I had to make sure the automated build service is an administrator and everything works.