Visual Studio 2010 Publish Web Publish Feature Does Not Include All DLLs

I have an ASP.NET MVC 2 application.

  • The web project contains a link to SomeProject
  • SomeProject contains links to ExternalAssembly1 and ExternalAssembly2.
  • SomeProject explicitly calls ExternalAssembly1, but not ExternalAssembly2.
  • ExternalAssembly1 calls ExternalAssembly2

When I do a local build, everything is cool. All DLLs are included in the bin \ debug folder. The problem is that when I use the Publish Web command in Visual Studio 2010, it deploys everything except ExternalAssembly2.

It seems to ignore assemblies that are not used directly (remember, ExternalAssembly2 is used only by ExternalAssembly1).

Is there any way I can tell Visual Studio 2010 to enable ExternalAssembly2?

I can write a dummy method that calls ExternalAssembly2. This really works, but I really don't want to have dummy code for the sole purpose of getting VS2010 to publish DLLs.

+52
build-process visual-studio-2010 deployment asp.net-mvc-2 msdeploy
May 12 '10 at 1:29
source share
13 answers

None of these answers are sufficient for me. This seems to be a real mistake. I will update this answer if I ever find a solution without a hack, or Microsoft fixes the error.

Update:

Doesn't seem promising. https://connect.microsoft.com/VisualStudio/feedback/details/731303/publish-web-feature-not-including-all-dlls

+20
May 24 '10 at 15:14
source share

I have the same problem (different builds). If I refer to assemblies in my web project, they will be included in the output of the publication, but they should be included in any case, because they are indirect dependencies:

Web project ---> Assembly A ---> Assembly B

In the assembly, assemblies A and B are output to the \ bin folder. When publishing, only the assembly is displayed in the publication folder.

I tried changing the publishing settings to include all the files in the web project, but then I have the files in my publication release that should not be deployed.

It seems to me that this is a mistake.

+7
May 15 '10 at 16:20
source share

I had the same problem with VS2010 and with the WCF service application.

It turns out that if your (directly or indirectly) a link to a DLL is deployed in the GAC, the VS publish function excludes them. As soon as I removed the assemblies from the GAC, the publish function started working as expected.

I assume that VS assumes that if your assemblies can be located in the GAC on the machine you will create, they will also be located in the GAC on the target machine. At least in my case this assumption is wrong.

+6
Jun 13 2018-12-12T00:
source share

My tests show that external assemblies are published when I have a link to them in a web project. I do not need to write any dummy code for it to work. That seems acceptable to me.

I agree with Nicholas that this seems like a mistake in the visual studio. At least it eludes me, what is the reason for this behavior.

+3
May 18 '10 at 19:10
source share

I created this problem as a bug in Microsoft Connect. If someone experiences this, he can vote for him https://connect.microsoft.com/VisualStudio/feedback/details/637071/publish-web-feature-not-including-all-dlls , so hopefully we can do something about it.

+3
Jan 20 2018-11-11T00:
source share

If you go to the ExternalAssembly2 link property list and change β€œCopy Local” to β€œTrue”, I think this may solve your problem.

+2
May 14 '10 at 3:01 a.m.
source share

I don’t know if you are looking at it yet, but I found a solution (I had the same problem) through this MSDN article . In the "Build Action" section for the file, select "Content", which should include it in the list of files published when publication.

+2
Oct 04 2018-10-10
source share

I created a new Connect error here https://connect.microsoft.com/VisualStudio/feedback/details/731303/publish-web-feature-not-including-all-dlls

I also attached a solution and detailed steps to reproduce this problem. We hope that this time they will not close it, because they cannot reproduce it.

Vote for this connection problem if you have a problem with a missing DLL.

+2
Mar 15 '12 at 8:37
source share

Copy the local trick. I had a problem with the assembly of Newtonsoft.Json included in the deploymeny package. The local copy was set to false.

+2
Feb 04 '14 at 8:56
source share

I am experiencing the same type of problem with a web project. I have a web project that references assembly A, which references assembly B. It has been working fine for some time, but today it was broken. I did a reconnection of the solution, and this time it deployed everything correctly.

+1
03 Mar. 2018-11-21T00:
source share

I had the same problem today. I published my web project and realized that not all link DLLs were there. In particular, links to indirect DLLs.

It turns out that the directory in which I published was out of disk space (network resource). I had enough space to publish all the files, with the exception of a few indirect support DLLs. The sad part is that VS08 did not produce any errors. He just published the files as usual. I cleared the hard disk space and everything worked fine.

I did not find a problem with the disk on the hard drive until I tried to manually move the DLL.

+1
Jul 11 2018-11-11T00:
source share

in my case it’s rather complicated. A reference to ExternalAssembly2 is not required to create a project, but is important for runtime because we use the mapping to configure the Unity container. So, I delete the link - successfully create the project, but get an error at runtime. If I save the link, I can create and run the application, but I cannot publish it using ExternalAssembly2 - get an exception at runtime. This is due to VS2010 build optimization.

So what can we do here? 1. Put some raw code snippet to use any ExternalAssembly2 class. 2. Run away from reflection and use static assemblies.

Hope this helps smbd.

+1
Jun 19 2018-12-12T00:
source share

I have the same problem and this is VS2010 error if there is a link: Web project β†’ user project β†’ assembly1 β†’ (indirectly) assembly2.

Now, when I refer to Assembly1 in a web project, assembly2 is included in the bin folder. So I had to add an additional link: Web project β†’ assembly1 β†’ (indirectly) assembly2. Then VS can recognize assembly2 and include its DLL file in the publish action.

0
Jan 18 '11 at 11:13
source share



All Articles