dll Not Found After Build and Upload to Server to Run - c#

we're trying to use a dll given to us by a different company, and on all development computer this dll is found fine and runs properly, but once we try to do the final build and publish it on one of our servers, the outside dll that we're usin gfrom this company is unable to be found and leads to the program crashing, any ideas for solutions and/or causes?

Related

Unstable Clickonce Deployment Application - Cannot Load file or Assembly....module was expected to Contain Manifest

The company I work for has recently decided to move to a ClickOnce deployment strategy for one of our internal applications that needs to be run by a hundred or so production computers. The previous strategy of building a .msi and installing worked fine between updates and we never experienced any problems after updates. Now that we have switched to ClickOnce we are experiencing a number of problems. After the initial install everything was working fine until we pushed out our first update. All of the computers successfully updated and ran that software fine for the day. The next morning when they were booted a number of the computers gave the error:
Could not load file or assembly "_______, Version=1.0.0.0. Culture=neutral, PublicKeyToken=null" or one of it's dependecies. The module was expected to contain an assembly manifest.
Where the blank is one of two C# dlls that is part of the application.
We never get these errors in development and I am unable to reproduce the issue on any computers I try. Even one of the production computers doesn't throw the error when I tried restarting it (hard reset and soft reset).
Here are some of the things we have tried:
Making sure the main application and all the dlls are built for any CPU as this seems to cause this problem often from our research. This has been verified by looking at the assembly information of the built executable.
Made sure all the dlls and manifest files were in their correct place in the ClickOnce folders, comparing them to working computers shows no real difference
It is not even all the computers that go down with each restart, it seems like a matter of chance, some are fine on a particular restart and others are not. These computers have all been imaged to be identical and none of the external dependencies have changed between the two builds so I am having issues finding any difference there.
Any insight from someone that has experienced similar issues and/or knows what could cause these issues in a ClickOnce-deployed application would be appreciated.
Some further details.:
Looking deeper into the particular dll that is having an issue that was on one of the computers it almost looks as if it is just a blank dll as it won't bring up any information on its assembly when I run a utility against it. However it is the perfect size that it should be so it can't be completely blank (408KB). Any clue why that could be? Why would ClickOnce download a blank dll when other computers had gotten the correct dll from the same place and the application had had the correct dll on the original run?
The way we have been 'fixing' this is by uninstalling and re-installing the software which basically fixes it for the day or until the system is restarted. Although we have hit a computer or two that even after a re-install will give the same error even though the initial install was fine.
Hopefully this can help.

Use .dll in server instead of in deployed application

My application needs an Oracle .dll which I deploy into the bin folder of the application along with the rest, and it works fine.
But what I want to do is to avoid deploying the library, so I need the server to know where to look for it. I added the .dll into C:\Oracle\bin, a path which is included at Path system variable. But it can't find the assembly if it's not into the application's bin folder.
Any hints, please?
This is pretty much have things work. You have discovered 2 viable deployment options. 1) Bundle it in your applications bin directory or 2) Install the oracle network protocol correctly and using the install API.
There are really only 2 more options that I can think of. 1) Statically link with the necessary network libraries -- I don't recall ever seeing these available on Windows, I know I have used static linking to OCI libraries on Unix, been a long time ago though. 2) Host the Oracle connectivity in a middle tier and have you deployed application always make calls to your middle tier (instead of direct Oracle calls)
BTW, you probably do not want to use the OCI libraries, ugly code compared to the modern ways of doing it.
If you go into the reference properties for the dll that you are trying to add you can change the Copy Local property to False.
This will allow for the program to pull the dll from the original location that you found the dll in.
The only thing that you have to watch out for is that your dll is in the same location on your dev PC as it is on your Server if it isn't your program will not find your dll. an example of this is if the dll on your server is in C:\Oracle\bin it must be at C:\Oracle\bin on your dev PC.

Visual Studio 2012 C# Building Final Setup for Publishing

I have built a windows application on VS2012 (C#) with the following features
1. Codes accessing pictures from project resources folder.
2. Codes accessing other multimedia (like videos, txt, sounds, etc) using something like: addr = #directoryName + "\\videos\\*.mp4".
Hence, I've added few folders in my Debug folder which I require to be in the same directory level as my main .exe file. All works fine on the debug mode, and even while running the .exe without debug mode.
Then I created my application setup (a 1.8GB setup file including all resources needed) using Inno Setup Compiler and it works like magic on the same computer, but not on another.
I was then curious whether the problem is with the setup or the .exe. So I tried copying the whole project folder into another laptop of mine, ran the .exe file on the debug folder, but nope, nothing came. Checked the Task Manager and found out that my .exe was running for 5 seconds under the Processes Tab, then it just disappeared.
(Similar to the problem stated here: Not able to run the .exe file created from c#).
Note: .NET Framework 4.5 have been installed perfectly on the other machine and all files needed have been copied.
So now I'm faced with two major issues:
- First, my .exe is not running on another machine.
- Second, which folders to include on my setup file as I do not want to include the .cs files and the other source codes. Just enough for my users to run my app flawlessly. Tried Inno (best one), InstallShield and had a quick glance at WIX.
Any help will be greatly appreciated. Been working, searching and doing trial and errors on making the setup file for almost 2 weeks now. Thanks in advance!
Regards,
Ken

C# ClickOnce Application Can't Load DLL

I have a small application that includes two third-party DLLs, pjsipDll.dll and sipeksdk.dll. Both of these DLLs are set to True for Copy Local. When I publish the application and install it on a second computer running Windows 7, it loads the sipeksdk dll fine and then that dll tries to use something from pjsipDll and it errors out saying:
"Unable to load DLL 'pjsipDll.dll': The specified module could not be found."
If I install this clickonce deployment on my development computer it works fine.
I looked in the deployment directory in on both computers, both DLLs are present, all the files are the same. On both systems I'm running as an administrator.
Any ideas on what I might be missing?
Thank you,
Stateful
It's funny how you fix the problem after posting on StackOverflow. It appears I was using incompatible builds of the DLLs. I found an older version of each that were known to work together and everything started working.

opencvsharp application post-setup not working

I have made an application in openCVSharp.It works great. I have made the setup/installer to this app and have included all the dlls required, also as mentioned in the Readme file that comes along openCVSharp, i have included openCVSharExtern.dll . When i execute the setup in my PC, its installs the app fine and the app runs fine too. But when i install the app on someother pc, it installs fine, but when its run on that pc, it throws an exception P/Invoke and something about cxcore210.dll...
What am i doing wrong?
Thanks
When you reference the DLL in your project, are you referencing the DLL in the location that gets installed by the installer?
e.g. if the DLL is installed one directory back in a certain folder then it should be referenced on your PC when you build it, one directory back with the same named folder.
I'm just wondering if when you build the app on you PC you are referencing the DLL from a different location (which works find on your PC because it exists) but on another PC it can't find it.

Categories