0

So I have a web application in Visual Studio 2010. Im depending on 2 DLLs. One of these are not a "real" DLL but a COM object. The first DLL is wrapper for this COM object.

So the first DLL is easy to add with a reference and when I deploy it gets put in the bin folder on the destination. The problem is the COM DLL. I can not add it as a reference. So I tried the accepted answer on this How do you include additional files using VS2010 web deployment packages? but I could not make it work. (some comment suggest this edit should be in the .pubxml file but i don´t even have that one?)

I also tried the second answer on the same question but still no luck.

The only thing that works if I go to the project properties and select "all files in this project" but I really don´t like that.

I know these answers I refer to are a bit old so maybe there is a new way of doing this?

Community
  • 1
  • 1
Jepzen
  • 2,942
  • 6
  • 40
  • 62

2 Answers2

0

I have experienced a similar situation in the past. The only viable way around I have found was to manually copy the files I needed when building the application using the "Build Events" screen (Go to "My Project" > "Compile". It is a the bottom right hand corner).

In the "Post-build event command line", I have entered a script that copies the DLLs I need into the bin folder of my web app:

XCOPY "E:\ThirdParty\Example.dll"  "$(TargetDir)"  /Y /R

This script simply copies the dll "Example.dll" from a repository folder into the bin folder of the web app I am compiling. You can find a lot more about these build events on MSDN: https://msdn.microsoft.com/en-us/library/ms165412.aspx

Hope this solves your problem and good luck!

TrustNo_1
  • 51
  • 7
  • My DLL ends up in the bin folder locally but it does not get included in the deploy package – Jepzen Sep 03 '15 at 09:19
0

I managed to work it out. I found this http://sedodream.com/2012/06/15/VisualStudio2010WebPublishUpdates.aspx page and installed the update for web publishing.

After that I had the pubxml files and I edited it according to the guidelines.

As found on http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-extra-files

Jepzen
  • 2,942
  • 6
  • 40
  • 62