I wrote an application that work with Git using the library LibGit2Sharp, everything works properly.
After finishing development, we publish to a common folder from which everyone works.
I want to create an installation for the application and that everyone will install it.
To create an installation for the application, I added a new Setup Project to Solution and referenced all the projects in Solution to it.
I installed the app and it runs, but crashes when trying to work with Git.
The error I get:
DllNotFoundException: Unable to load DLL 'git2-106a5f2' or one of its dependencies: The specified module could not be found.
The point is that the Dll file described exists in the installation folder as it exists in the Publish folder.
Is there anything I should have taken into account during the installation process?
what am I missing?
This error can occur if the required dependencies of the "git2-106a5f2" DLL are not installed or are not located in the PATH. If the necessary dependencies are installed and found in the PATH, you may check for them. If not, you may do so when installing by adding them to the PATH.
Another choice is to deliver your program along with the installation package that contains the necessary dependencies.
By doing this, regardless of the user's environment, you can make sure that your application always has access to the necessary dependencies.
Make sure you are using the appropriate version of the "git2-106a5f2" DLL for your program by checking to see if it is an x86 or x64 DLL. Use the x86 version of the DLL if your program was created for that architecture, and the x64 version if it was.
Related
I had a working Solution on my computer using "visual studio community" and a win7 x32 install. (it uses PcapDotNet package)
I migrated my system to another computer and installed a win7 x64.
Now, my program using the PcapDotNet package does not work anymore.
Error : System.IO.FileNotFoundException : Unable to load file or assembly 'PcapDotNet.Core.dll' or one of its dependency.
I tried to change package AND target builds to x64 but still, have the same issue...
The four required DLLs are well into both Debug and Release folders with the .exe file.
PcapDotNet.Base.dll
PcapDotNet.Core.dll
PcapDotNet.Core.Extensions.dll
PcapDotNet.Packets.dll
I even tried to target the newest Framework 4.6.1, and it didn't changes anything.
Does anyone have any idea of what to do about it, please?
You can use the depends tool to check the dependencies of your DLL. Then you can cross-check whether all dependencies are present.
The tool is available here:
http://www.dependencywalker.com/
Are the dlls referenced in the solution? My suggestion is to have them in a separate folder (inside or outside your solution folder), reference them in the solution (from the new path) and after that select them and open the properties tool window. There set CopyLocal to true.
Hope this helps.
The C# application that I'm trying to deploy has two critical references, A.dll and B.dll.
First, I used InstallShield LE which includes everything (.dll's and .pdb's) in release folder into application files, application is deployed to different computers without problem. The app is about 6M after installation.
Then, I started to use VS installer, including "primary output" into application folder. I can see both A.dll and B.dll are included. After install the app on another computer, A and B exist in the installation directory too. When I run the application, it gives me "could not load file or assembly "B.dll" or one of its dependencies" error. B.dll only depends on .NET framework. The app is only 3M after installation because the installation directory has only the .dll's (no .pdb's).
Did I miss anything here? Any idea would be helpful, Thank you.
Edit:
The difference between A.dll and B.dll is that B.dll is compiled from a C++/cli program while A.dll is from C#. Does this make them different in deployment?
I would suggest using Fusion log viewer on the target machine to determine why the DLL is not found.
http://msdn.microsoft.com/en-us/library/e74a18c4.aspx
Sometimes Fuslogvw can be a pain to get working, if so try restarting the machine, or see any of the blog posts about it
https://www.google.ca/search?q=fuslogvw.exe&oq=fuslog
I'm sure once you find the reason (in the logs) it will be obvious what the problem is with the MSI, but if not post your findings.
So I made a C# project in visual studio with 3 class library projects. Everything works fine when debugging but When I try to deploy. Database and Program installs just fine but when I try to open the Application, I get an Assembly or File not Found Exception. The DLL he can't find is a class library in my project.
On the File System Editor, VS automatically detected the dependencies and included the 3 dll files in to application directory. I tried excluding these dll's and just adding the class library projects's primary output's (Same dll) but still the same error.
I used a Custom Installer class for creating my database on installation. But I don't think that is relevant.
If you have verified that your 3 assemblies are indeed deployed to your destination folder,
it could very well be an another dependency that you have not included in your setup project.
Please double check that you indeed have the right number of assemblies included.
You can also right click the setup project and refresh dependencies.
Have you checked that dependencies in the setup project aren't excluded (by mistake)?
Furthermore, it may also be a .NET profile issue. Do you depend on assemblies that are only available in the full .NET profile, and your destination only has the client profile installed?
In worst case, run the SysInternals process monitor and that way figure out which assembly is missing.
you need to include all dll's that are not part of the .net framework with your deployable. Your custom installer will copy these files to the location of the executable on install.
i usually create a folder called /deploy and copy all my needed dlls in there. I also change my projects settings to output to the /deploy-directory (instead of bin/). after you build, this directory will contain all dll's and other resources needed to run the application.
Here's an error I get when I try to install my application from the publish location:
I have my application (and a DLL used by it) linked to version 1.61.4111... of QWhale.Common which is a 3rd party DLL. I have been used this version since about 4 updates ago and never had this problem. I have no idea which part of my application or DLL could be trying to link to the older version. The only thing I did different on this version is that I moved my application's project folders to a new location in my computer.
Where should I start trying to find where this problem is coming from? Did you ever have this problem before?
As Yahia commented, this can be a licensing issue but if you've been using this assembly for a while and if you've been compiling it with your application, there is a chance that a setting associated with the file could have changed with your projects settings.
Assuming you are using Visual Studio, I recommend opening your Projects properties window and navigating to the Publish tab and opening the Application Files Dialog.
From there, find the referenced, 3rd party assemblies make try setting the Publish Status to Include and the DownloadGroup to (Required).
Save your changes and republish your application.
I downloaded setup.exe, and then begin to install and it immediately crashes.
On win7 it worked fine. On XP it doesn't work.
Error text:
Unable to install or run the
application. The application requires
that assemble stdole Version
7.0.3300.0 be installed in the Global Assembly Cache (GAC) first.
You'll need to include stdole.dll as a required file in your Publish settings in Visual Studio. Once you publish your app again, it should then include that file in your app when it's installed.
More info can be found here.
This happened to a few people that i had to install a click once application i developed. Basically something happened in their installation of .NET and the needed .DLL's were not moved to the GAC. It's very simple to fix, basically You need to copy stdole.dll from C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ to C:\Windows\Assembly ... that should fix your issue. Including them in the application isn't the best idea, this will fix it for ALL click once applications rather then just that one you are currently building.
P.S. Dragging the files to the location will work, you might get an error if you try to copy it.