Visual Studio 2010 Publish Web feature not including all DLLs

后端 未结 13 2044
梦毁少年i
梦毁少年i 2021-01-31 07:14

I have an ASP.NET MVC 2 application.

  • Web project contains a reference to SomeProject
  • SomeProject contains references to ExternalAssembly1 and ExternalAs
相关标签:
13条回答
  • 2021-01-31 08:03

    I had the same problem with VS2010 and a WCF Service Application.

    It turns out that if your (directly or indirectly) referenced DLL's are deployed to GAC, the VS publishing feature excludes them. Once I removed the assemblies from GAC, publishing feature started working as expected.

    I guess VS is assuming that if your assemblies can be located in GAC on the machine you build, they will be located in GAC on the target machine as well. At least in my case this assumption is false.

    0 讨论(0)
  • 2021-01-31 08:05

    I don't know if you are watching this still but I found the solution (I had the exact same issue) via this MSDN article. Under "build action" for the file choose "Content" that should include it in the list of files publish brings over.

    0 讨论(0)
  • 2021-01-31 08:05

    Copy local did the trick. I had an issue that the Newtonsoft.Json assembly get included in the deploymeny package. Copy local was set to false.

    0 讨论(0)
  • 2021-01-31 08:12

    I got the same problem and this is a VS2010 bug if there's a reference link like: Web Project --> custom project --> assembly1 -->(indirectly) assembly2.

    For now I find if I reference the Assembly1 in the web project, then assembly2 is included in the bin folder. So I had to add an additional reference link like: Web project --> assembly1 -->(indirectly) assembly2. Then VS can recognize assembly2 and include its dll file in publish action.

    0 讨论(0)
  • 2021-01-31 08:14

    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.

    0 讨论(0)
  • 2021-01-31 08:14

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

    0 讨论(0)
提交回复
热议问题