Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Publish Web feature not including all DLLs

I have an ASP.NET MVC 2 application.

  • Web project contains a reference to SomeProject
  • SomeProject contains references to ExternalAssembly1 and ExternalAssembly2.
  • SomeProject explicitly calls into ExternalAssembly1, but NOT ExternalAssembly2.
  • ExternalAssembly1 calls into ExternalAssembly2

When I perform 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 appears to ignore assemblies that aren't directly used (remember, ExternalAssembly2 is only used by ExternalAssembly1).

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

I can write a dummy method that calls into ExternalAssembly2. This does work, but I really don't want to have dummy code for the sole purpose of causing VS2010 to publish the DLL.

like image 349
reustmd Avatar asked May 12 '10 01:05

reustmd


People also ask

How do I publish a web service in Visual Studio 2010?

Start Visual Studio 2010 and load up the Contoso University C# solution. Click the Package/Publish Web tab. Choose the Configuration for the package. Packages are configuration specific and settings are per configuration, so you need to choose the configuration and configure the setting before creating a package.

How do I publish a DLL in Visual Studio?

Right-click on project menu and select Publish. Select the option to publish to a Folder. Clicking Publish (I didn't change the output directory, but that doesn't matter)

How do I change publish settings in Visual Studio?

On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish. If you have previously configured any publishing profiles, the Publish pane appears. Click New or Create new profile.


2 Answers

None of these answers are sufficient in my mind. This does seem to be a genuine bug. I will update this response if I ever find a non-hack solution, or Microsoft fixes the bug.

Update:

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

like image 114
reustmd Avatar answered Sep 21 '22 19:09

reustmd


I am having this same problem (different assemblies though). If I reference the assemblies in my web project, then they will get included in the publish output, but they should be included anyway because they are indirect dependencies:

Web Project ---> Assembly A ---> Assembly B

On build, assemblies A and B are outputed to the \bin folder. On publish, only assembly A is outputed to the publish folder.

I have tried changing the publish settings to include all files in the web project, but then I have files in my publish output that shouldn't be deployed.

This seems like a bug to me.

like image 31
Nicholas Cloud Avatar answered Sep 19 '22 19:09

Nicholas Cloud