Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you include a non-referenced dll when publishing a web application?

I have various dll's that I am not directly referencing in a ASP.NET website I am attempting to publish via the "Package/Publish Web" feature in Visual Studio 2010.

How can I tell the publishing feature that it needs to include these certain files?

Note that I do not want to directly reference these dll's (the solution has specifically been setup in a way so that these specific dll's are not directly referenced).

I've found a <ExcludeFilesFromDeployment/> but I can't find a way to specifically include files.

like image 832
Brad Leach Avatar asked Dec 30 '10 21:12

Brad Leach


People also ask

How do I add a DLL reference in Visual Studio NET core?

One of the things I did miss was a clear direction on how to reference a . NET dll directly (and of course still enjoy the benefits of intellisense), basically the same thing as doing Project > Add Reference > Browse in Visual Studio. And that's it!

How do I reference a DLL in C #?

Using DLL File Step 1 - Open Visual Studio then select "File" -> "New" -> "Project..." then select "Visual C#" -> "Windows Forms application". Step 2 - Design the form as in the following image: Step 3 - Add a reference for the dll file, "calculation. dll", that we created earlier.

How do I add a DLL to a VB NET project?

In Solution Explorer, double-click the My Project node for the project. In the Project Designer, click the References tab. Click the Add button to open the Add Reference dialog box.


3 Answers

If you want to include files through the Publish method you could use "FilesForPackagingFromProject" elements in the MSbuild file (.*proj)

Usefull link : http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx

like image 191
Sanderi Avatar answered Oct 05 '22 14:10

Sanderi


You can add them to the project (just like you add an image) and change the property Copy To Output Directory to Copy if Newer. Then when you build they should be placed into the bin. That should work when you publish too.

like image 37
Josh Avatar answered Oct 05 '22 16:10

Josh


It will only publish from the folders in your website. I have always just had the website reference those files so when I built it they were then local to the site and would be published along with everything else.

like image 35
phillip Avatar answered Oct 05 '22 15:10

phillip