In my VS2012 project I use a third party dll. I do not add it into project references, but I have added its path into environment system variables (in Path), as suggested into the user manual of the third party software.
So inside my project I don't have any references to that dll, but only a .cs file where there are some [DllImport("xxx.dll")].
In the same solution, I've created an InstallShield project, to create a setup for my application. When I run the setup, I notice that the dll is copied into my application folder. That is not good for me, because if I try to run my application I have some compatibility problem with other dlls of the third party software.
If I remove manually the xxx.dll from my application folder, it works correctly.
So, how can I avoid that xxx.dll is copied inside the application folder?
Turn off any of the "magic" options so that you can control exactly what files you install. For example, set.NET Scan at Build to Properties instead of Dependencies and Properties.
Related
When importing dlls in Visual Studio (VS2017) I have to choose the path where the dll file is. If I move the dlls file later, or I share the project, reference will be broken.
I can see there is a COM option where you can see system DLLs plus some libraries from installed software.
How can I create a set of dll files (SDK) so I can see them there?
At this moment, I'm creating a lib folder in the solution directory where I put all my dlls, so I can import them easily and share the project including libraries.
The idea is that every developer must install an SDK with all these libraries in order to use them, and add them without having to copy files. It might make lib updates easier for us.
Also, when deploying the proyject solution will every user need the SDK installed? I guess I have to mark the library for local copy.
I'm trying to create exe/msi for my solution
it contains the following Projects
ActiveDirectoryEngine: library used to implement AD operations
ADService: windows service - performs the work in the background
CryptographyEngine: library used to encrypt/decrypt data
TerranovaActiveDirectoryHost: Dashboars/win form to manage/check the service's status
SyncToolSetup: the setup project "it only targets TerranovaActiveDirectoryHost"
Here is the contents of the Setup project:
I tried the same steps for different Solution, with ONLY one windows forms application, and it worked fine, but it looks that it doesn't work when I have more than one referenced projects.
The install and Uninstall options are not enabled
Update:
all the previous projects are referenced in the Win forms project, so am I targeting the right one when creating the exe/msi?
The only project with the Install option is the setup project. Other projects in the solution do not have install option just because there is a setup project as part of the solution.
References in a non-setup project (such as a C# build) are not automatically included in a setup project. References used to build code are not necessarily things that need installing on the target system. The setup will try to help with dependencies, but it's unreliable, and only a guide. For example, your Application Folder view contains some files that are part of the .NET Framework, and you definitely don't install them because they are installed as part of the standard .NET framework install.
The setup project must be told what needs to be installed on the target system. There are generally two ways of doing this:
Selecting project output as input to the setup project. This can be rather indeterminate because it's not always obvious what files are included, or what to do if the files need installing to different locations.
Add the files that you know you need one at a time by adding them in the File System view of the directory they need installing into. Typically, executables go into the Application Folder (defaults to Program Files..), data files to User's Application Data, shared files to Common Files folder, some assemblies to the GAC and so on.
I have several 3rd party dll's for .net. I have the following requirements:
- They must each be in their own sharepoint 2010 wsp
- They must be deployed the bin, not the GAC
I'm having troubles accomplishing this. What steps need to be taken to do this?
I've tried creating a new sharepoint application, mapping bin, placing dll there then deploying.
I've tried creating new sharepoint application, adding the dll as a reference, selecting web application instead of global assembly cache and deploying.
Neither method has worked when I tried to use another webpart that required those dll's.
Edit - This page is an excellent example of what I need to do with 3rd party dll's but it doesn't have the details on how to do it. http://ranaictiu-technicalblog.blogspot.sg/2012/06/sharepoint-package-your-external.html
Appreciate any help.
Oké, getting your solution to deploy a DLL to the bin folder you need to change the deployment target from GAC to WebApplication. When the project is deployed the project assembly will be deployed to the bin folder of the project the DLLL will be located at C:\inetpub\wwwroot\wss\VirtualDirectories[SiteName]\bin
For the second question I don't know what you are trying to accomplish. Maybe you can give some more context.
I have a Command line console app that references a dll 'VMware.Vim.dll', but this has other referenced dll's like VimService41.dll, VimService20.dll etc saved off in the GAC on my local machine.
I want to deploy this exe to any computer and be able to run it by passing arguments. When I copy over the exe and VMware.Vim.dll, it complains about the other missing dll's although they are not part of the release folder.
I tried the Publish option and created a ClickOnce Application to deploy it to the machine I want to execute the exe from. This created a setup.exe and a manifest file. When I run it, it complains that the external dlls have not been added to the GAC.
How do I run this clickonce console app by passing arguments?
First, you don't run a ClickOnce application by running the EXE. If you're going to do that, just xcopy the bin folder from your build over to the machine. You're wasting your life using ClickOnce if you don't need to do automatic updates.
Second, you can try tracking down all of the dll's that you need and including them in the project. This includes all of the secondary or tertiary dependencies. Add them to your project, set the build action to "content", and set "copy to output directory" to "copy always". Then they will be included in the output directory when you build.
Some applications' dll's will work when deployed locally (like DirectX) and some won't (SQLServer Express). You'll just have to try it and see if these do.
I would say, however, that using VMWare assemblies probably is against the EULA. That's like trying to include Office assemblies in order to run Excel on a machine w/o it installed.
As for passing arguments, if you really DO want to use it as a ClickOnce application, here is a blog entry explaining how to pass arguments to an offline (or online) ClickOnce application:
http://robindotnet.wordpress.com/2010/03/21/how-to-pass-arguments-to-an-offline-clickonce-application/
I don't think this scenario is an appropriate for click once. If you need to install things which modifying the gac is then you need to use an installer.
If you can find all the dependencies you can include them (by setting them to copy local in VS) with the release and then you shouldn't have a problem.
If you want to use ClickOnce, what you need is to add a custom pre-requisite so that the application installs it's dependencies in the GAC.
Look at: http://msdn.microsoft.com/en-us/library/ms165429(v=VS.100).aspx
What exactly is needed for someone to use my C# windows application in executable form? I do know that .NET framework has to be installed on the computer, but I heard there is much more. And is there any way to spread the application besides doing installable form via "Publish"? I mean, which project files are needed? Only exe file, or these pdb and manifest files too? Do they have to be from bin/debug or bin/Release, or makes no difference? (I know files created with this application are saved in "debug") Because I need to show my program (as exe) to certain person with .NET framework...
You only really need the .NET framework, unless you've used third party components.
If you use a Package and Deployment project in your solution it will automatically generate a .msi file for you with everything that your app needs to be installed.
You need .pdb files if you want file and line number detail in any exceptions thrown by your app. If you're selling the app as a product, don't include them as that information poses a security risk. If it's an internal app, then consider including them in your package and deployment project, because it's useful information to get with exception logs.
For runtime etc, .NET should be enough. Or with some tools (like as is used via MonoTouch and some others), not even that.
For the application, just the exe is necessary, but there can be lots of other required files - a config file perhaps, or maybe supporting non-CLR dlls (third party dlls perhaps).
For deployment, you can just use the exe etc (xcopy deployment), or ClickOnce (.application), or an installer (.exe / .msi).
The best option is to give them the files from your bin/release folder.
PDB files (which you should only find in your debug folder) contain the symbols for debugging your application, so you don't need to give them those.
There are other options such as ClickOnce deployment or an MSI, but it sounds like you just need to temporarily show this to only one individual, so it won't be worth it to go down this path.
In short, as long as the user has the correct version of the .NET framework installed on their machine, and you give them all of the relevant files from your bin/release folder (the EXE file, any additional DLLs that your application references, and any miscellaneous files like an app.config file), they should be able to run it just fine.