I'm creating a web service that uses multiple DLLs, some of which are projects that I have developed and others are external DLLs. Those that are external, I have simply copied into the Bin directory of my WebService. However, those that are from my own projects I have added as references by right clicking on the bin folder and selecting add reference. This adds both a dll and a pdb file to the bin folder. However, when I build the website, I am not sure where these two files are pulled from. I need to know because I am trying to encrypt these DLLs as a post build step on the web service and I need to know where I can find the DLL I should encrypt. Need any more information let me know.
If the files are part of another project in your solution, then open the project folder for those projects (right click on the project node in VS and choose "Open In Explorer..."). There is a bin directory in that folder that the assembly for that project is placed in after it is built. When the web site project is built, the assembly is copied from this bin folder into the bin folder for the web site.
EDIT
As discovered (in the comments to this answer), VS actually copies assemblies from the obj directory rather than the bin directory.
Related
I'm using Accord.video.ffmpeg.x64. My project is built in x64 as well. It is a click once windows forms application. I installed accord through nuget. C++ redistributor is installed.
Everything works fine when I run the program from debug. But when I publish it and try to run it (on the same machine or any other machine) I get the error "could not load file or assembly 'accord.video.ffmpeg.x64.dll' or one of its dependencies."
Thank you for any help you can provide.
Install on the machine both
vc_redist-2015.x64.exe
vc_redist-2015.x86.exe
and copy all files from your Nuget packages folders
packages\Accord.Video.FFMPEG.x64.3.8.0\lib\net(Version)
packages\Accord.Video.FFMPEG.x64.3.8.0\build
to the installation folder of your application.
I had the same issue this week, but I found the solution! When I compared the files in the bin folder vs the application directory under programs files, the bin folder had 8 additional files that weren't in the application installed folder:
avcodec-57.dll,
avdevice-57.dll,
avfilter-6.dll,
avformat-57.dll,
avutil-55.dll,
postproc-54.dll,
swresample-2.dll,
swscale-4.dll,
These files need to be copied into the application install folder. They can't be referenced since they aren't .net they are c++ dll. So what I did was added the dll files directly to my project , then right click each file properties and for build action I selected "content", then for copy to output directory, I put "copy if newer." This fixed the issue for me, so I hope it works for you too!
When I upload a project from the local machine to the server repository, and try to download it from the server to another machine I am always missing some .dll files and cannot build the project?
It sounds like you're likely keeping externally needed DLLs in your bin folder, which would not be added to (many) source controls by default, as the DLLs in your bin folder get updated after each build.
The not adding bin to source is the correct route, you have a few options on what what you would need to do:
Use nuget packages that get restored automatically during build
add the DLLS to a separate folder (I like to use "extLib" or "3rdParty" as my folder name, and add that to source, referencing the DLLs in the separate folder.
ensure all machines have required DLLs/SDKs installed on the machine
They are listed in (my) order of preference, but that's just my own opinion.
Probably because repo's ignore file is ignoring those file types. Check you .gitignore file in the root of the repo.
I have an ASP.NET MVC 3 web-application with post-build build events that copies some interop dll's into subfolders of bin as follows
bin\x86\Sqlite.interop.dll
bin\x64\Sqlite.interpo.dll
When I deploy this project onto the web-server, it does not copy the x86 or x64 subfolders.
How can I make the deployment copy those two sub-folders?
I've tried including the files in the project with "copy to output folder" setting, but this does not copy to a subfolder, only to bin. I need to publish both subfolders all the time.
In case you have common DAL assembly you can perform a such trick:
Embedd native dll's to your assembly as resources
Create static constructor to your 'entry point' class (Session, SessionFactory, etc.) and save to FS native dll's if necessary from this constructor
Update:
Also you can add to your project all native dll's. Mark them as Content and Copy Always. In this case they will be deployed with your service
I Created a WCF Service and added a dll file as a reference and i am getting the error mentioned in the title during runtime.
Created a WPF application and added the same dll file as a reference but it worked.
The dll file has other references that i added manually in the bin/debug folder of the wpf app.
When i try to do the same for WCF service it is not working.
Please help me figure it out.
I am new to C#. Unfortunately no one answered it, i found solution myself after three hours :(.
A dll file will always be used by an exe file.
In this case the exe was in the folder C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0 which is the folder for ASP.NET development server.
So the dependent dll files need to be copied there. Copying to the bin folder will not work.
MVC project.
On my data access layer I have a libs folder where I store some dlls that the project needs t oaccess data. One of them is set "copy local" to true. The goal is to copy the dll to the bin folder so I can deploy it with the application.
The thing is, when I build the app, it does copy to the bin folder, but to the bin folder on the DAL project only. Since it is a web applicaiton I want to build the web project and have the dll copied to its bin folder so I can just deploy it withou having to manually coping it from the bin on the dal to the bin of the deployed appliation.
What do I need to do to accomplish that?
Build Action = Content might help; but then it will only come in to your DAL Bin if it is referenced there.
You can right click on the web project and than click on Deployment project as given below ..this will add all required dll for your project in the path of your poject which you can see in ouput window