I have a c# .net app.
I'm using a WebKitBrowser.
The problem is that the app does not work if i don't put all the webkit DLLs into the debug/release folder.
What i'm trying to do, is to put all these files into a folder like debug/WebkitFiles and all the files to be token from there.
Any help? thanks
This should help:
<probing> and <privatePath>
Read up on the <assemblyBinding> tag in MSDN as well:
Note the changes go into your app.config file.
You can xcopy the files in your post-build event, under the project properties
Additionally, how did you first referenced the WebKitBrowser DLLs?
If you expect .NET do bind to an assembly but it is failing, do the following:
1. Open the Visual Studio Command Prompt
2. Type 'fuslogvw'
-- every load of an .NET assembly will be registered in the console
Put your DLLs where you want then add a reference to them and set "copy local" to true. If you want to keep dependencies in a sub-folder you have to modify your assembly manifest file.
Related
I'm using Visual Studio to "Publish" my application, but when I install it on another PC I get an error for a missing .DLL
Is there a setting in the properties that I'm overlooking maybe?
This is very frustrating because on my development PC it works.
It is called FK623Attend.dll
This is the FKAttendDLL.cs Code
This is the DLL Properties
The Original Program doesn't have the DLL in the solution... It was registered during installation.
Thanks in advance
right click on the dll and go to properties. then set "Copy to Output directory" to " always copy" .then publish... Let me know if it works
If it is a managed dll (.NET assembly) it should be added as a reference to the project and not as a file. If it’s a native DLL that just needs to be included, check the properties of the file and make sure the settings for copying are either Copy always or Copy if newer and type is Content. Otherwise the file is ignored.
Is it possible to change the references build folder? I want my dlls when i compile to be in a /bin/Debug/Data and not in /bin/Debug.
Thank you
Update 1: Is it possible when i build the references dlls are posted in another folder?
You can use Post-build Event in project properties.
Using this event you can copy dll file any other place or directory after build
but dll project must be added in this project.
Go to Projct properties. Tab "Build". Change Output path
If I am not wrong I believe you can using Element . You can do this in app.config file The following example shows how to specify application base subdirectories the runtime should search for assemblies.
Personally I have not tested this. I found this in here: https://msdn.microsoft.com/en-us/library/823z9h8w.aspx
This article demonstrating Setting a Custom Reference Path
Add the following line before the main Form is initialized
AppDomain.CurrentDomain.AppendPrivatePath(#"bin\Data");
I'm new about code developing with Visual Studio 2010 and I would like to ask you a simple question about something after build a project.
I have a C# project and when I build It in Release mode some file are created and some of them copied from another in to \output\bin\Release\ folder. My question is that How can I manage that which created dll or created file will be in \output\bin\Release\ folder.
I tried to take a look at build properties of project but I could not find any option about it.
Thank you.
Actually I do not need this dll in my project output folder because I
add this dlls as a reference to my project
And this is exactly why this file appear in output folder.
There are several ways to "put" file in output folder. For normal files in the project you can set property Copy to Output Directory.
If we talking about dll's, (as mentioned Hans), there is Copy Local property for each assembly in References.
By default VS set this according to our GAC, so if you are using 3rd part assembly or from another project VS will set this property to True and file will be copied to output folder.
If you don't want to put this file in output folder, just set this property to False. But remember, at run time this assembly should exist.
For more information: How to: Set the Copy Local Property of a Reference
Another explanation: you just messed up with Output path in the project properties and two project has the same output folder. :)
I suggest that you ignore the extra files that are created. One way to do this is to configure the destination of these to a different location.
I use this:
property pages->General
- Output Directory = $(SolutionDir)..\link\
- Intermediate Directory = c:\temp\vc10\$(SolutionName)\$(Configuration)\
Use the same settings for debug and release.
i am using some libraries and i added a reference to that library dll and i set the "Copy Local" to true.
but i want to change the location of the dll to be a subfolder in the exe folder and not with the exe.
how is this possible?
thanks
Update:
i used the following Post-build event [as Jon Skeet recommended]
move /y $(TargetDir)\System.Data.SqlServerCe.dll $(TargetDir)\Lib\SqlSrvCe\System.Data.SqlServerCe.dll
You'll need a .config file for your .exe so that the probing path is changed. A subdirectory is no problem, just use the <probing> element, its privatePath attribute is a relative folder name.
Beware however that you'll get little help from the IDE to put the DLL in that spot. You'll need a post build event that creates the folder if necessary and xcopy's the DLL there. Something like this:
if not exist "$(TargetDir)mumble" mkdir "$(TargetDir)mumble"
xcopy /d /y "$(TargetDir)something.dll" "$(TargetDir)mumble"
I don't know whether it's feasible within "normal" build rules, but you could add post-build steps which basically moved the files. It would be ugly, but it should work.
Do you need it as a reference? Or is the reference only to copy the dll to the desired location?
If you do not need the reference, try adding it to the project and setting it to always copy.
Add the dll to a folder in the project and set to Copy to Output Directory http://web11.twitpic.com/img/146848312-ecfdeadf5b322fe755c7a764d6e6dbf0.4c69c2f0-full.png
I have created a ClickOnce Solution with VS2008.
My main project references another project who references COM dll as "links".
When I build my solution in VS the dlls from the orther projects are moved in my bin folder but when I publish and launch the project these files are not presents in my Local Settings\Apps\2.0... folder.
I know that I can add each dll of the other project as a reference of my main project but I'd like a cleaner solution ...
Is it possible ?
First add those files to your project directly.
Then goto Application properties -> Publish -> Application files
Select "show all files" if you do not see the files you need and then set their
publish status to "Include" NOT "Include (Auto)". This is important or they will not be added.
Please note if you update the files, you will have to remove them and add them again
and set their publish Status again. This is a small bug.
See a previous question of mine for more info:
ClickOnce - Overwriting content files
You need to open the "Application Files" dialog in the Publish tab of your project. From there you can set the publish type (Include, Prerequisite, etc.) of each of your files.
If it's an unmanaged DLL, you'll need to add the actual .dll as a file to your project and mark its build action as "Data". You can then set the Publish Type of that file to Include.
I had the same issue.... and the only way to fix this after going through many options, was by adding those dlls to References.
It works, but I hope there would be a cleaner solution to it in future.